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

/* Variables and functions */
int ffts_ctzl(size_t);
int /*<<< orphan*/ ffts_hardcodedleaf_is_rec_even4(int /*<<< orphan*/ **,
                                                   size_t, int, int, int);
int /*<<< orphan*/ ffts_hardcodedleaf_is_rec_even8(int /*<<< orphan*/ **,
                                                   size_t, int, int, int);
int /*<<< orphan*/ *malloc(size_t);
ptrdiff_t *ffts_init_is(size_t N, size_t leaf_N, int VL) {
  int i, i0, i1, i2;
  int stride = ffts_ctzl(N / leaf_N);
  ptrdiff_t *is, *pis;
  is = malloc(N / VL * sizeof(*is));
  if (!is) {
    return NULL;
  }
  i0 = N / leaf_N / 3 + 1;
  i1 = i2 = N / leaf_N / 3;
  if ((N / leaf_N) % 3 > 1) {
    i1++;
  }
  pis = is;
  for (i = 0; i < i0; i++) {
    ffts_hardcodedleaf_is_rec_even8(&pis, N, i, stride, VL);
  }
  for (i = i0; i < i0 + i1; i++) {
    ffts_hardcodedleaf_is_rec_even4(&pis, N, i, stride + 1, VL);
    ffts_hardcodedleaf_is_rec_even4(&pis, N, i - (1 << stride), stride + 1, VL);
  }
  for (i = 0 - i2; i < 0; i++) {
    ffts_hardcodedleaf_is_rec_even8(&pis, N, i, stride, VL);
  }
  return is;
}


x86 assembly (clang, -O0):
<ffts_init_is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,%rdi
call   1050 <ffts_ctzl@plt>
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdi
shl    $0x2,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    119f <ffts_init_is+0x5f>
movq   $0x0,-0x8(%rbp)
jmp    12e5 <ffts_init_is+0x1a5>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
add    $0x1,%rax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x2c(%rbp)
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x1,%rdx
jbe    1201 <ffts_init_is+0xc1>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1241 <ffts_init_is+0x101>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    -0x40(%rbp),%rdi
call   1030 <ffts_hardcodedleaf_is_rec_even8@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1210 <ffts_init_is+0xd0>
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x24(%rbp),%ecx
add    -0x28(%rbp),%ecx
cmp    %ecx,%eax
jge    12a6 <ffts_init_is+0x166>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
mov    -0x1c(%rbp),%r8d
lea    -0x40(%rbp),%rdi
call   1040 <ffts_hardcodedleaf_is_rec_even4@plt>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    %eax,%edx
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
mov    -0x1c(%rbp),%r8d
lea    -0x40(%rbp),%rdi
call   1040 <ffts_hardcodedleaf_is_rec_even4@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1247 <ffts_init_is+0x107>
xor    %eax,%eax
sub    -0x2c(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    12dd <ffts_init_is+0x19d>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    -0x40(%rbp),%rdi
call   1030 <ffts_hardcodedleaf_is_rec_even8@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12ae <ffts_init_is+0x16e>
mov    -0x38(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffts_init_is>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edx,%ebx
mov    %rdi,%r12
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     116c <ffts_init_is+0x2c>
mov    %r12,%rax
xor    %edx,%edx
div    %rsi
mov    %rax,%r15
jmp    1176 <ffts_init_is+0x36>
mov    %r12d,%eax
xor    %edx,%edx
div    %esi
mov    %eax,%r15d
mov    %r15,%rdi
call   1050 <ffts_ctzl@plt>
mov    %eax,%r13d
movslq %ebx,%rcx
mov    %r12,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     119a <ffts_init_is+0x5a>
mov    %r12,%rax
xor    %edx,%edx
div    %rcx
jmp    11a1 <ffts_init_is+0x61>
mov    %r12d,%eax
xor    %edx,%edx
div    %ebx
shl    $0x2,%rax
mov    %rax,%rdi
call   1060 <malloc@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     12e8 <ffts_init_is+0x1a8>
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mov    %r15,%rax
mul    %rcx
mov    %rdx,%r14
shr    %r14
mov    %ebx,%r8d
lea    0x1(%r14),%ebx
lea    (%r14,%r14,2),%rax
sub    %rax,%r15
cmp    $0x2,%r15
mov    %r14d,%eax
cmovae %ebx,%eax
mov    %eax,0x8(%rsp)
mov    0x20(%rsp),%rax
mov    %rax,0x10(%rsp)
cmp    $0x7ffffffe,%r14d
ja     1241 <ffts_init_is+0x101>
cmp    $0x2,%ebx
mov    $0x1,%eax
cmovge %ebx,%eax
mov    %eax,0x18(%rsp)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x10(%rsp),%rdi
mov    %r12,%rsi
mov    %ebp,%edx
mov    %r13d,%ecx
mov    %r8d,%r15d
call   1030 <ffts_hardcodedleaf_is_rec_even8@plt>
mov    %r15d,%r8d
add    $0x1,%ebp
cmp    0x18(%rsp),%ebp
jne    1220 <ffts_init_is+0xe0>
mov    %r13d,0xc(%rsp)
mov    0x8(%rsp),%ebp
test   %ebp,%ebp
mov    %r8d,%r15d
jle    12b7 <ffts_init_is+0x177>
add    %ebx,%ebp
mov    0xc(%rsp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,0x8(%rsp)
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %rdx,0x18(%rsp)
mov    0x8(%rsp),%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x10(%rsp),%rdi
mov    %r12,%rsi
mov    %ebx,%edx
mov    %r13d,%ecx
mov    %r15d,%r8d
call   1040 <ffts_hardcodedleaf_is_rec_even4@plt>
mov    0x18(%rsp),%rax
lea    (%rbx,%rax,1),%edx
lea    0x10(%rsp),%rdi
mov    %r12,%rsi
mov    %r13d,%ecx
mov    %r15d,%r8d
call   1040 <ffts_hardcodedleaf_is_rec_even4@plt>
add    $0x1,%ebx
cmp    %ebp,%ebx
jl     1280 <ffts_init_is+0x140>
test   %r14d,%r14d
mov    0xc(%rsp),%ebp
jle    12e8 <ffts_init_is+0x1a8>
mov    %r15d,%ebx
neg    %r14d
lea    0x10(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
call   1030 <ffts_hardcodedleaf_is_rec_even8@plt>
inc    %r14d
jne    12d0 <ffts_init_is+0x190>
mov    0x20(%rsp),%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32* @ffts_init_is(i64 %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32*
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
%15 = load i64, i64* %5
%16 = load i64, i64* %6
%17 = udiv i64 %15, %16
%18 = call i32 @ffts_ctzl(i64 %17)
store i32 %18, i32* %12
%19 = load i64, i64* %5
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = udiv i64 %19, %21
%23 = mul i64 %22, 4
%24 = call i32* @malloc(i64 %23)
store i32* %24, i32** %13
%25 = load i32*, i32** %13
%26 = icmp ne i32* %25, null
br i1 %26, label %28, label %27
27: ; preds = %3
store i32* null, i32** %4
br label %107
28: ; preds = %3
%29 = load i64, i64* %5
%30 = load i64, i64* %6
%31 = udiv i64 %29, %30
%32 = udiv i64 %31, 3
%33 = add i64 %32, 1
%34 = trunc i64 %33 to i32
store i32 %34, i32* %9
%35 = load i64, i64* %5
%36 = load i64, i64* %6
%37 = udiv i64 %35, %36
%38 = udiv i64 %37, 3
%39 = trunc i64 %38 to i32
store i32 %39, i32* %11
store i32 %39, i32* %10
%40 = load i64, i64* %5
%41 = load i64, i64* %6
%42 = udiv i64 %40, %41
%43 = urem i64 %42, 3
%44 = icmp ugt i64 %43, 1
br i1 %44, label %45, label %48
45: ; preds = %28
%46 = load i32, i32* %10
%47 = add nsw i32 %46, 1
store i32 %47, i32* %10
br label %48
48: ; preds = %45, %28
%49 = load i32*, i32** %13
store i32* %49, i32** %14
store i32 0, i32* %8
br label %50
50: ; preds = %60, %48
%51 = load i32, i32* %8
%52 = load i32, i32* %9
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %63
54: ; preds = %50
%55 = load i64, i64* %5
%56 = load i32, i32* %8
%57 = load i32, i32* %12
%58 = load i32, i32* %7
%59 = call i32 @ffts_hardcodedleaf_is_rec_even8(i32** %14, i64 %55, i32 %56, i32 %57, i32 %58)
br label %60
60: ; preds = %54
%61 = load i32, i32* %8
%62 = add nsw i32 %61, 1
store i32 %62, i32* %8
br label %50
63: ; preds = %50
%64 = load i32, i32* %9
store i32 %64, i32* %8
br label %65
65: ; preds = %87, %63
%66 = load i32, i32* %8
%67 = load i32, i32* %9
%68 = load i32, i32* %10
%69 = add nsw i32 %67, %68
%70 = icmp slt i32 %66, %69
br i1 %70, label %71, label %90
71: ; preds = %65
%72 = load i64, i64* %5
%73 = load i32, i32* %8
%74 = load i32, i32* %12
%75 = add nsw i32 %74, 1
%76 = load i32, i32* %7
%77 = call i32 @ffts_hardcodedleaf_is_rec_even4(i32** %14, i64 %72, i32 %73, i32 %75, i32 %76)
%78 = load i64, i64* %5
%79 = load i32, i32* %8
%80 = load i32, i32* %12
%81 = shl i32 1, %80
%82 = sub nsw i32 %79, %81
%83 = load i32, i32* %12
%84 = add nsw i32 %83, 1
%85 = load i32, i32* %7
%86 = call i32 @ffts_hardcodedleaf_is_rec_even4(i32** %14, i64 %78, i32 %82, i32 %84, i32 %85)
br label %87
87: ; preds = %71
%88 = load i32, i32* %8
%89 = add nsw i32 %88, 1
store i32 %89, i32* %8
br label %65
90: ; preds = %65
%91 = load i32, i32* %11
%92 = sub nsw i32 0, %91
store i32 %92, i32* %8
br label %93
93: ; preds = %102, %90
%94 = load i32, i32* %8
%95 = icmp slt i32 %94, 0
br i1 %95, label %96, label %105
96: ; preds = %93
%97 = load i64, i64* %5
%98 = load i32, i32* %8
%99 = load i32, i32* %12
%100 = load i32, i32* %7
%101 = call i32 @ffts_hardcodedleaf_is_rec_even8(i32** %14, i64 %97, i32 %98, i32 %99, i32 %100)
br label %102
102: ; preds = %96
%103 = load i32, i32* %8
%104 = add nsw i32 %103, 1
store i32 %104, i32* %8
br label %93
105: ; preds = %93
%106 = load i32*, i32** %13
store i32* %106, i32** %4
br label %107
107: ; preds = %105, %27
%108 = load i32*, i32** %4
ret i32* %108
}

LLVM IR (-O2):
define i32* @ffts_init_is(i64 %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = udiv i64 %0, %1
%6 = tail call i32 @ffts_ctzl(i64 %5)
%7 = bitcast i32** %4 to i8*
%8 = sext i32 %2 to i64
%9 = udiv i64 %0, %8
%10 = shl i64 %9, 2
%11 = tail call i32* @malloc(i64 %10)
%12 = icmp eq i32* %11, null
br i1 %12, label %50, label %13
13: ; preds = %3
%14 = udiv i64 %5, 3
%15 = trunc i64 %14 to i32
%16 = add i32 %15, 1
%17 = urem i64 %5, 3
%18 = icmp ugt i64 %17, 1
%19 = select i1 %18, i32 %16, i32 %15
store i32* %11, i32** %4
%20 = icmp ult i32 %15, 2147483647
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = call i32 @llvm.smax.i32(i32 %16, i32 1)
br label %29
23: ; preds = %29, %13
%24 = add nsw i32 %19, %16
%25 = icmp sgt i32 %19, 0
br i1 %25, label %26, label %41
26: ; preds = %23
%27 = add nsw i32 %6, 1
%28 = shl nsw i32 -1, %6
br label %34
29: ; preds = %21, %29
%30 = phi i32 [ %32, %29 ], [ 0, %21 ]
%31 = call i32 @ffts_hardcodedleaf_is_rec_even8(i32** %4, i64 %0, i32 %30, i32 %6, i32 %2)
%32 = add nuw nsw i32 %30, 1
%33 = icmp eq i32 %32, %22
br i1 %33, label %23, label %29
34: ; preds = %26, %34
%35 = phi i32 [ %16, %26 ], [ %39, %34 ]
%36 = call i32 @ffts_hardcodedleaf_is_rec_even4(i32** %4, i64 %0, i32 %35, i32 %27, i32 %2)
%37 = add i32 %35, %28
%38 = call i32 @ffts_hardcodedleaf_is_rec_even4(i32** %4, i64 %0, i32 %37, i32 %27, i32 %2)
%39 = add nsw i32 %35, 1
%40 = icmp slt i32 %39, %24
br i1 %40, label %34, label %41
41: ; preds = %34, %23
%42 = icmp sgt i32 %15, 0
br i1 %42, label %43, label %50
43: ; preds = %41
%44 = sub nsw i32 0, %15
br label %45
45: ; preds = %43, %45
%46 = phi i32 [ %48, %45 ], [ %44, %43 ]
%47 = call i32 @ffts_hardcodedleaf_is_rec_even8(i32** %4, i64 %0, i32 %46, i32 %6, i32 %2)
%48 = add i32 %46, 1
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %45
50: ; preds = %45, %41, %3
ret i32* %11
}