#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 /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int number;
  printf("===== Exercise 7 =====\n");
  printf("Even or Odd / Positive or Negative\n");
  printf("The number of numbers you'll enter. : ");
  scanf("%i", &number);
  int numbers[number];
  printf("Enter all integer numbers(Write one number and Enter).:\n");
  for (int i = 0; i < number; i++) {
    scanf("%i", &numbers[i]);
  }
  for (int k = 0; k < number; k++) {
    if (numbers[k] == 0) {
      printf("--> %i is 0.\n", numbers[k]);
    } else if (numbers[k] % 2 == 0) {
      if (numbers[k] > 0) {
        printf("--> %i is EVEN and POSITIVE.\n", numbers[k]);
      } else {
        printf("--> %i is EVEN and NEGATIVE.\n", numbers[k]);
      }
    } else {
      if (numbers[k] > 0) {
        printf("--> %i is ODD and POSITIVE.\n", numbers[k]);
      } else {
        printf("--> %i is ODD and NEGATIVE.\n", numbers[k]);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x39(%rbp)
call   1030 <printf@plt>
mov    -0x39(%rbp),%al
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x39(%rbp),%al
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
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)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11e6 <main+0xc6>
mov    -0x38(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe90(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11b1 <main+0x91>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12f9 <main+0x1d9>
mov    -0x38(%rbp),%rax
movslq -0x30(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1229 <main+0x109>
mov    -0x38(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e6 <main+0x1c6>
mov    -0x38(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1293 <main+0x173>
mov    -0x38(%rbp),%rax
movslq -0x30(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    1275 <main+0x155>
mov    -0x38(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    128e <main+0x16e>
mov    -0x38(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e1 <main+0x1c1>
mov    -0x38(%rbp),%rax
movslq -0x30(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    12c3 <main+0x1a3>
mov    -0x38(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12dc <main+0x1bc>
mov    -0x38(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e1 <main+0x1c1>
jmp    12e6 <main+0x1c6>
jmp    12eb <main+0x1cb>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11ed <main+0xcd>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xf66(%rip),%rdi
call   1030 <puts@plt>
lea    0xf71(%rip),%rdi
call   1030 <puts@plt>
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1050 <scanf@plt>
mov    %rsp,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%r13
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
lea    0xf4e(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    125b <main+0x12b>
xor    %r15d,%r15d
lea    0xe74(%rip),%r14
mov    %r13,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
add    $0x1,%r15
movslq -0x2c(%rbp),%rax
add    $0x4,%rbx
cmp    %rax,%r15
jl     11c0 <main+0x90>
test   %eax,%eax
jle    125b <main+0x12b>
lea    0xe43(%rip),%rbx
lea    0xe4a(%rip),%r14
lea    0xe7f(%rip),%r12
xor    %r15d,%r15d
jmp    1219 <main+0xe9>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15
movslq -0x2c(%rbp),%rax
cmp    %rax,%r15
jge    125b <main+0x12b>
mov    0x0(%r13,%r15,4),%esi
test   %esi,%esi
je     1200 <main+0xd0>
test   $0x1,%sil
jne    1240 <main+0x110>
test   %esi,%esi
jle    1249 <main+0x119>
mov    %r14,%rdi
jmp    1205 <main+0xd5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   %esi,%esi
jle    1252 <main+0x122>
mov    %r12,%rdi
jmp    1205 <main+0xd5>
lea    0xe06(%rip),%rdi
jmp    1205 <main+0xd5>
lea    0xe38(%rip),%rdi
jmp    1205 <main+0xd5>
mov    -0x38(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"===== Exercise 7 =====\0A\00"
@.str.1 = [36 x i8] c"Even or Odd / Positive or Negative\0A\00"
@.str.2 = [39 x i8] c"The number of numbers you'll enter. : \00"
@.str.3 = [3 x i8] c"%i\00"
@.str.4 = [57 x i8] c"Enter all integer numbers(Write one number and Enter).:\0A\00"
@.str.5 = [14 x i8] c"--> %i is 0.\0A\00"
@.str.6 = [30 x i8] c"--> %i is EVEN and POSITIVE.\0A\00"
@.str.7 = [30 x i8] c"--> %i is EVEN and NEGATIVE.\0A\00"
@.str.8 = [29 x i8] c"--> %i is ODD and POSITIVE.\0A\00"
@.str.9 = [29 x i8] c"--> %i is ODD and NEGATIVE.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%15 = load i32, i32* %6
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %7
%18 = alloca i32, i64 %16
store i64 %16, i64* %8
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %9
br label %20
20: ; preds = %29, %2
%21 = load i32, i32* %9
%22 = load i32, i32* %6
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %32
24: ; preds = %20
%25 = load i32, i32* %9
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %18, i64 %26
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %27)
br label %29
29: ; preds = %24
%30 = load i32, i32* %9
%31 = add nsw i32 %30, 1
store i32 %31, i32* %9
br label %20
32: ; preds = %20
store i32 0, i32* %10
br label %33
33: ; preds = %96, %32
%34 = load i32, i32* %10
%35 = load i32, i32* %6
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %99
37: ; preds = %33
%38 = load i32, i32* %10
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %18, i64 %39
%41 = load i32, i32* %40
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %49
43: ; preds = %37
%44 = load i32, i32* %10
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i32, i32* %18, i64 %45
%47 = load i32, i32* %46
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %47)
br label %95
49: ; preds = %37
%50 = load i32, i32* %10
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i32, i32* %18, i64 %51
%53 = load i32, i32* %52
%54 = srem i32 %53, 2
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %75
56: ; preds = %49
%57 = load i32, i32* %10
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i32, i32* %18, i64 %58
%60 = load i32, i32* %59
%61 = icmp sgt i32 %60, 0
br i1 %61, label %62, label %68
62: ; preds = %56
%63 = load i32, i32* %10
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i32, i32* %18, i64 %64
%66 = load i32, i32* %65
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %66)
br label %74
68: ; preds = %56
%69 = load i32, i32* %10
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i32, i32* %18, i64 %70
%72 = load i32, i32* %71
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %72)
br label %74
74: ; preds = %68, %62
br label %94
75: ; preds = %49
%76 = load i32, i32* %10
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i32, i32* %18, i64 %77
%79 = load i32, i32* %78
%80 = icmp sgt i32 %79, 0
br i1 %80, label %81, label %87
81: ; preds = %75
%82 = load i32, i32* %10
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i32, i32* %18, i64 %83
%85 = load i32, i32* %84
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %85)
br label %93
87: ; preds = %75
%88 = load i32, i32* %10
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i32, i32* %18, i64 %89
%91 = load i32, i32* %90
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i32 %91)
br label %93
93: ; preds = %87, %81
br label %94
94: ; preds = %93, %74
br label %95
95: ; preds = %94, %43
br label %96
96: ; preds = %95
%97 = load i32, i32* %10
%98 = add nsw i32 %97, 1
store i32 %98, i32* %10
br label %33
99: ; preds = %33
store i32 0, i32* %3
%100 = load i8*, i8** %7
%101 = load i32, i32* %3
ret i32 %101
}

LLVM IR (-O2):
@.str.2 = [39 x i8] c"The number of numbers you'll enter. : \00"
@.str.3 = [3 x i8] c"%i\00"
@.str.5 = [14 x i8] c"--> %i is 0.\0A\00"
@.str.6 = [30 x i8] c"--> %i is EVEN and POSITIVE.\0A\00"
@.str.7 = [30 x i8] c"--> %i is EVEN and NEGATIVE.\0A\00"
@.str.8 = [29 x i8] c"--> %i is ODD and POSITIVE.\0A\00"
@.str.9 = [29 x i8] c"--> %i is ODD and NEGATIVE.\0A\00"
@str = [23 x i8] c"===== Exercise 7 =====\00"
@str.10 = [35 x i8] c"Even or Odd / Positive or Negative\00"
@str.11 = [56 x i8] c"Enter all integer numbers(Write one number and Enter).:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.10, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
%12 = alloca i32, i64 %10
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.11, i64 0, i64 0))
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, 0
br i1 %15, label %18, label %26
16: ; preds = %18
%17 = icmp sgt i32 %23, 0
br i1 %17, label %27, label %26
18: ; preds = %2, %18
%19 = phi i64 [ %22, %18 ], [ 0, %2 ]
%20 = getelementptr inbounds i32, i32* %12, i64 %19
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %20)
%22 = add nuw nsw i64 %19, 1
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = icmp slt i64 %22, %24
br i1 %25, label %18, label %16
26: ; preds = %48, %2, %16
ret i32 0
27: ; preds = %16, %48
%28 = phi i64 [ %49, %48 ], [ 0, %16 ]
%29 = getelementptr inbounds i32, i32* %12, i64 %28
%30 = load i32, i32* %29
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 0)
br label %48
34: ; preds = %27
%35 = and i32 %30, 1
%36 = icmp eq i32 %35, 0
%37 = icmp sgt i32 %30, 0
br i1 %36, label %38, label %43
38: ; preds = %34
br i1 %37, label %39, label %41
39: ; preds = %38
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %30)
br label %48
41: ; preds = %38
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %30)
br label %48
43: ; preds = %34
br i1 %37, label %44, label %46
44: ; preds = %43
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %30)
br label %48
46: ; preds = %43
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i32 %30)
br label %48
48: ; preds = %32, %44, %46, %39, %41
%49 = add nuw nsw i64 %28, 1
%50 = load i32, i32* %3
%51 = sext i32 %50 to i64
%52 = icmp slt i64 %49, %51
br i1 %52, label %27, label %26
}