#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*/ complexitySelector(int, int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ sleep(int);
int main() {
  int i, length, com;
  int a[50];
  printf("......................BarkerCode Chipping Sequence "
         "Creator.....................\n");
  printf("Enter your bit Pattern length and Pattern\n");
  scanf("%d", &length);
  for (i = 0; i < length; i++)
    scanf("%d", &a[i]);
  printf("Enter your complexity (1-7)\n");
  scanf("%d", &com);
  printf("Checking your input...\n");
  sleep(2);
  if (com > 0 && com < 8) {
    printf("Selecting complex algorithms...\n");
    sleep(2);
    printf("X0Ring your values...\n");
    sleep(1);
    printf("Getting Results...\n");
    complexitySelector(com, a, length);
  } else {
    printf("Bad Complexity Range. Please enter range from (1-7)\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
lea    0xeec(%rip),%rdi
call   1040 <printf@plt>
lea    0xf0b(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b9 <main+0x79>
movslq -0x8(%rbp),%rax
lea    -0xe0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xed6(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1181 <main+0x41>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
cmpl   $0x0,-0x10(%rbp)
jle    124e <main+0x10e>
cmpl   $0x8,-0x10(%rbp)
jge    124e <main+0x10e>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%edi
lea    -0xe0(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <complexitySelector@plt>
jmp    125a <main+0x11a>
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xe0,%rsp
lea    0xeb0(%rip),%rdi
call   1040 <puts@plt>
lea    0xef4(%rip),%rdi
call   1040 <puts@plt>
lea    0xe95(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11ad <main+0x6d>
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
lea    0xe76(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     1190 <main+0x50>
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
lea    0xe40(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x6,%eax
ja     1238 <main+0xf8>
lea    0xef1(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
lea    0xefb(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    0xefb(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%edx
lea    0x10(%rsp),%rsi
call   1030 <complexitySelector@plt>
jmp    1244 <main+0x104>
lea    0xe71(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [81 x i8] c"......................BarkerCode Chipping Sequence Creator.....................\0A\00"
@.str.1 = [43 x i8] c"Enter your bit Pattern length and Pattern\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [29 x i8] c"Enter your complexity (1-7)\0A\00"
@.str.4 = [24 x i8] c"Checking your input...\0A\00"
@.str.5 = [33 x i8] c"Selecting complex algorithms...\0A\00"
@.str.6 = [23 x i8] c"X0Ring your values...\0A\00"
@.str.7 = [20 x i8] c"Getting Results...\0A\00"
@.str.8 = [53 x i8] c"Bad Complexity Range. Please enter range from (1-7)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [50 x i32]
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
store i32 0, i32* %2
br label %9
9: ; preds = %18, %0
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [50 x i32], [50 x i32]* %5, i64 0, i64 %15
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %16)
br label %18
18: ; preds = %13
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %9
21: ; preds = %9
%22 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%24 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%25 = call i32 @sleep(i32 2)
%26 = load i32, i32* %4
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %41
28: ; preds = %21
%29 = load i32, i32* %4
%30 = icmp slt i32 %29, 8
br i1 %30, label %31, label %41
31: ; preds = %28
%32 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%33 = call i32 @sleep(i32 2)
%34 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%35 = call i32 @sleep(i32 1)
%36 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%37 = load i32, i32* %4
%38 = getelementptr inbounds [50 x i32], [50 x i32]* %5, i64 0, i64 0
%39 = load i32, i32* %3
%40 = call i32 @complexitySelector(i32 %37, i32* %38, i32 %39)
br label %43
41: ; preds = %28, %21
%42 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.8, i64 0, i64 0))
br label %43
43: ; preds = %41, %31
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@str = [80 x i8] c"......................BarkerCode Chipping Sequence Creator.....................\00"
@str.9 = [42 x i8] c"Enter your bit Pattern length and Pattern\00"
@str.10 = [28 x i8] c"Enter your complexity (1-7)\00"
@str.11 = [23 x i8] c"Checking your input...\00"
@str.12 = [52 x i8] c"Bad Complexity Range. Please enter range from (1-7)\00"
@str.13 = [32 x i8] c"Selecting complex algorithms...\00"
@str.14 = [22 x i8] c"X0Ring your values...\00"
@str.15 = [19 x i8] c"Getting Results...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [50 x i32]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [50 x i32]* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.9, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %0, %12
%13 = phi i64 [ %16, %12 ], [ 0, %0 ]
%14 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %14)
%16 = add nuw nsw i64 %13, 1
%17 = load i32, i32* %1
%18 = sext i32 %17 to i64
%19 = icmp slt i64 %16, %18
br i1 %19, label %12, label %20
20: ; preds = %12, %0
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.10, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.11, i64 0, i64 0))
%24 = call i32 @sleep(i32 2)
%25 = load i32, i32* %2
%26 = add i32 %25, -1
%27 = icmp ult i32 %26, 7
br i1 %27, label %28, label %38
28: ; preds = %20
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.13, i64 0, i64 0))
%30 = call i32 @sleep(i32 2)
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.14, i64 0, i64 0))
%32 = call i32 @sleep(i32 1)
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.15, i64 0, i64 0))
%34 = load i32, i32* %2
%35 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 0
%36 = load i32, i32* %1
%37 = call i32 @complexitySelector(i32 %34, i32* %35, i32 %36)
br label %40
38: ; preds = %20
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.12, i64 0, i64 0))
br label %40
40: ; preds = %38, %28
ret i32 0
}