#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*/ printf(char *, int, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int LEN = 5;
  int arr[LEN];
  int odd_array[LEN], even_array[LEN];
  int i = 0;
  printf("Enter %d numbers: \n", LEN);
  for (i = 0; i < LEN; i++) {
    scanf("%d", &arr[i]);
    if (arr[i] % 2 != 0)
      odd_array[i] = arr[i];
    else
      even_array[i] = arr[i];
  }
  for (i = 0; i < LEN; i++) {
    printf("Odd[%d] = %d\tEven[%d] = %d\n", i, odd_array[i], i, even_array[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1243 <main+0x123>
mov    -0x48(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe36(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x48(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     121a <main+0xfa>
mov    -0x40(%rbp),%rax
mov    -0x48(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,4),%edx
movslq -0x2c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1230 <main+0x110>
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,4),%edx
movslq -0x2c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1235 <main+0x115>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11bc <main+0x9c>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    128f <main+0x16f>
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    -0x2c(%rbp),%esi
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,4),%edx
mov    -0x2c(%rbp),%ecx
movslq -0x2c(%rbp),%rdi
mov    (%rax,%rdi,4),%r8d
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    124a <main+0x12a>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecc(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    (%rsp),%ebp
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x4(%rsp),%r14d
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%r12d
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%r15d
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x10(%rsp),%ebx
lea    0xe73(%rip),%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
mov    %ebp,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13,%rdi
mov    $0x2,%esi
mov    %r12d,%edx
mov    $0x2,%ecx
mov    %r12d,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13,%rdi
mov    $0x3,%esi
mov    %r15d,%edx
mov    $0x3,%ecx
mov    %r15d,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13,%rdi
mov    $0x4,%esi
mov    %ebx,%edx
mov    $0x4,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter %d numbers: \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"Odd[%d] = %d\09Even[%d] = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %3
%11 = alloca i32, i64 %9
store i64 %9, i64* %4
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = alloca i32, i64 %13
store i64 %13, i64* %5
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = alloca i32, i64 %16
store i64 %16, i64* %6
store i32 0, i32* %7
%18 = load i32, i32* %2
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %18)
store i32 0, i32* %7
br label %20
20: ; preds = %52, %0
%21 = load i32, i32* %7
%22 = load i32, i32* %2
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %55
24: ; preds = %20
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %11, i64 %26
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %27)
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %11, i64 %30
%32 = load i32, i32* %31
%33 = srem i32 %32, 2
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %43
35: ; preds = %24
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32, i32* %11, i64 %37
%39 = load i32, i32* %38
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %14, i64 %41
store i32 %39, i32* %42
br label %51
43: ; preds = %24
%44 = load i32, i32* %7
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i32, i32* %11, i64 %45
%47 = load i32, i32* %46
%48 = load i32, i32* %7
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i32, i32* %17, i64 %49
store i32 %47, i32* %50
br label %51
51: ; preds = %43, %35
br label %52
52: ; preds = %51
%53 = load i32, i32* %7
%54 = add nsw i32 %53, 1
store i32 %54, i32* %7
br label %20
55: ; preds = %20
store i32 0, i32* %7
br label %56
56: ; preds = %72, %55
%57 = load i32, i32* %7
%58 = load i32, i32* %2
%59 = icmp slt i32 %57, %58
br i1 %59, label %60, label %75
60: ; preds = %56
%61 = load i32, i32* %7
%62 = load i32, i32* %7
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i32, i32* %14, i64 %63
%65 = load i32, i32* %64
%66 = load i32, i32* %7
%67 = load i32, i32* %7
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32, i32* %17, i64 %68
%70 = load i32, i32* %69
%71 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %61, i32 %65, i32 %66, i32 %70)
br label %72
72: ; preds = %60
%73 = load i32, i32* %7
%74 = add nsw i32 %73, 1
store i32 %74, i32* %7
br label %56
75: ; preds = %56
%76 = load i8*, i8** %3
%77 = load i32, i32* %1
ret i32 %77
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter %d numbers: \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"Odd[%d] = %d\09Even[%d] = %d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%5 = load i32, i32* %3
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = load i32, i32* %9
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%14 = load i32, i32* %12
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %15)
%17 = load i32, i32* %15
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 %5, i32 0, i32 %5)
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 %8, i32 1, i32 %8)
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 %11, i32 2, i32 %11)
%21 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 %14, i32 3, i32 %14)
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 %17, i32 4, i32 %17)
ret i32 0
}