#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*/ rdar_12075238__aux(unsigned long);
int rdar_12075238_(unsigned long count) {
  if ((count < 3) || (count > 6))
    return 0;
  unsigned long array[6];
  unsigned long i = 0;
  for (; i <= count - 2; i++) {
    array[i] = i;
  }
  array[count - 1] = i;
  rdar_12075238__aux(array[2]);
  return 0;
}


x86 assembly (clang, -O0):
<rdar_12075238_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x3,-0x10(%rbp)
jb     1132 <rdar_12075238_+0x22>
cmpq   $0x6,-0x10(%rbp)
jbe    113e <rdar_12075238_+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    119a <rdar_12075238_+0x8a>
movq   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x2,%rcx
cmp    %rcx,%rax
ja     1179 <rdar_12075238_+0x69>
mov    -0x48(%rbp),%rcx
mov    -0x48(%rbp),%rax
mov    %rcx,-0x40(%rbp,%rax,8)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1146 <rdar_12075238_+0x36>
mov    -0x48(%rbp),%rcx
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rcx,-0x40(%rbp,%rax,8)
mov    -0x30(%rbp),%rdi
call   1030 <rdar_12075238__aux@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdar_12075238_>:
lea    -0x7(%rdi),%rax
cmp    $0xfffffffffffffffc,%rax
jb     1179 <rdar_12075238_+0x69>
sub    $0x38,%rsp
lea    -0x1(%rdi),%rax
movq   $0x0,(%rsp)
cmp    $0x1,%rax
je     1166 <rdar_12075238_+0x56>
movq   $0x1,0x8(%rsp)
cmp    $0x2,%rax
je     1166 <rdar_12075238_+0x56>
movq   $0x2,0x10(%rsp)
cmp    $0x3,%rax
je     1166 <rdar_12075238_+0x56>
movq   $0x3,0x18(%rsp)
cmp    $0x4,%rax
je     1166 <rdar_12075238_+0x56>
movq   $0x4,0x20(%rsp)
mov    %rax,-0x8(%rsp,%rdi,8)
mov    0x10(%rsp),%rdi
call   1030 <rdar_12075238__aux@plt>
add    $0x38,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @rdar_12075238_(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca [6 x i64]
%5 = alloca i64
store i64 %0, i64* %3
%6 = load i64, i64* %3
%7 = icmp ult i64 %6, 3
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %3
%10 = icmp ugt i64 %9, 6
br i1 %10, label %11, label %12
11: ; preds = %8, %1
store i32 0, i32* %2
br label %33
12: ; preds = %8
store i64 0, i64* %5
br label %13
13: ; preds = %22, %12
%14 = load i64, i64* %5
%15 = load i64, i64* %3
%16 = sub i64 %15, 2
%17 = icmp ule i64 %14, %16
br i1 %17, label %18, label %25
18: ; preds = %13
%19 = load i64, i64* %5
%20 = load i64, i64* %5
%21 = getelementptr inbounds [6 x i64], [6 x i64]* %4, i64 0, i64 %20
store i64 %19, i64* %21
br label %22
22: ; preds = %18
%23 = load i64, i64* %5
%24 = add i64 %23, 1
store i64 %24, i64* %5
br label %13
25: ; preds = %13
%26 = load i64, i64* %5
%27 = load i64, i64* %3
%28 = sub i64 %27, 1
%29 = getelementptr inbounds [6 x i64], [6 x i64]* %4, i64 0, i64 %28
store i64 %26, i64* %29
%30 = getelementptr inbounds [6 x i64], [6 x i64]* %4, i64 0, i64 2
%31 = load i64, i64* %30
%32 = call i32 @rdar_12075238__aux(i64 %31)
store i32 0, i32* %2
br label %33
33: ; preds = %25, %11
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @rdar_12075238_(i64 %0) {
%2 = alloca [6 x i64]
%3 = add i64 %0, -7
%4 = icmp ult i64 %3, -4
br i1 %4, label %26, label %5
5: ; preds = %1
%6 = bitcast [6 x i64]* %2 to i8*
%7 = add nsw i64 %0, -1
%8 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 0
store i64 0, i64* %8
%9 = icmp eq i64 %7, 1
br i1 %9, label %21, label %10
10: ; preds = %5
%11 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 1
store i64 1, i64* %11
%12 = icmp eq i64 %7, 2
br i1 %12, label %21, label %13
13: ; preds = %10
%14 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 2
store i64 2, i64* %14
%15 = icmp eq i64 %7, 3
br i1 %15, label %21, label %16
16: ; preds = %13
%17 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 3
store i64 3, i64* %17
%18 = icmp eq i64 %7, 4
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 4
store i64 4, i64* %20
br label %21
21: ; preds = %19, %16, %13, %10, %5
%22 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 %7
store i64 %7, i64* %22
%23 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 2
%24 = load i64, i64* %23
%25 = tail call i32 @rdar_12075238__aux(i64 %24)
br label %26
26: ; preds = %1, %21
ret i32 0
}