main() {
  int arr[6], i, *p, k;
  char c;
  printf("enter elements");
  for (i = 0; i < 5; i++)
    scanf("%d", &arr[i]);
  while (1) {
    printf("enter element which position you want to find:");
    scanf("%d", &k);
    for (i = 0; i < 5; i++) {
      if (arr[i] == k) {
        p = &arr[i];
        printf("%d", p);
      }
    }
    printf("will u want to continue(y/n):");
    scanf("%c", &c);
    if (c == 'n' || c == 'N')
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    1179 <main+0x59>
movslq -0x24(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1144 <main+0x24>
jmp    117e <main+0x5e>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7c(%rip),%rdi
lea    -0x34(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    11f8 <main+0xd8>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
cmp    -0x34(%rbp),%eax
jne    11e5 <main+0xc5>
movslq -0x24(%rbp),%rcx
lea    -0x20(%rbp),%rax
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ea <main+0xca>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a5 <main+0x85>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe52(%rip),%rdi
lea    -0x35(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x35(%rbp),%eax
cmp    $0x6e,%eax
je     1232 <main+0x112>
movsbl -0x35(%rbp),%eax
cmp    $0x4e,%eax
jne    1237 <main+0x117>
jmp    123c <main+0x11c>
jmp    117e <main+0x5e>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecc(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe7d(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xea0(%rip),%r12
lea    0xeb7(%rip),%r13
lea    0xb(%rsp),%rbp
jmp    11d6 <main+0xb6>
nop
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movzbl 0xb(%rsp),%eax
and    $0xdf,%al
cmp    $0x4e,%al
je     129c <main+0x17c>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %eax,0x10(%rsp)
je     1220 <main+0x100>
cmp    %eax,0x14(%rsp)
je     1239 <main+0x119>
cmp    %eax,0x18(%rsp)
je     1252 <main+0x132>
cmp    %eax,0x1c(%rsp)
je     126b <main+0x14b>
cmp    %eax,0x20(%rsp)
jne    11b0 <main+0x90>
jmp    1288 <main+0x168>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
cmp    %eax,0x14(%rsp)
jne    11fd <main+0xdd>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
cmp    %eax,0x18(%rsp)
jne    1203 <main+0xe3>
mov    %rbx,%rdi
lea    0x18(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
cmp    %eax,0x1c(%rsp)
jne    1209 <main+0xe9>
mov    %rbx,%rdi
lea    0x1c(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
cmp    %eax,0x20(%rsp)
jne    11b0 <main+0x90>
mov    %rbx,%rdi
lea    0x20(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11b0 <main+0x90>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"enter elements\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [47 x i8] c"enter element which position you want to find:\00"
@.str.3 = [30 x i8] c"will u want to continue(y/n):\00"
@.str.4 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %8
8: ; preds = %16, %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 5
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %13
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
br label %16
16: ; preds = %11
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %8
19: ; preds = %8
br label %20
20: ; preds = %19, %54
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
store i32 0, i32* %3
br label %23
23: ; preds = %40, %20
%24 = load i32, i32* %3
%25 = icmp slt i32 %24, 5
br i1 %25, label %26, label %43
26: ; preds = %23
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = load i32, i32* %5
%32 = icmp eq i32 %30, %31
br i1 %32, label %33, label %39
33: ; preds = %26
%34 = load i32, i32* %3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %35
store i32* %36, i32** %4
%37 = load i32*, i32** %4
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %37)
br label %39
39: ; preds = %33, %26
br label %40
40: ; preds = %39
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %23
43: ; preds = %23
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%45 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %6)
%46 = load i8, i8* %6
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 110
br i1 %48, label %53, label %49
49: ; preds = %43
%50 = load i8, i8* %6
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 78
br i1 %52, label %53, label %54
53: ; preds = %49, %43
br label %55
54: ; preds = %49
br label %20
55: ; preds = %53
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"enter elements\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [47 x i8] c"enter element which position you want to find:\00"
@.str.3 = [30 x i8] c"will u want to continue(y/n):\00"
@.str.4 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = alloca i8
%4 = bitcast [6 x i32]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 1
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 2
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %11)
%13 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 3
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 4
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %15)
br label %17
17: ; preds = %0, %53
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%20 = load i32, i32* %7
%21 = load i32, i32* %2
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %26
23: ; preds = %17
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%25 = load i32, i32* %2
br label %26
26: ; preds = %17, %23
%27 = phi i32 [ %21, %17 ], [ %25, %23 ]
%28 = load i32, i32* %9
%29 = icmp eq i32 %28, %27
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%32 = load i32, i32* %2
br label %33
33: ; preds = %30, %26
%34 = phi i32 [ %32, %30 ], [ %27, %26 ]
%35 = load i32, i32* %11
%36 = icmp eq i32 %35, %34
br i1 %36, label %37, label %40
37: ; preds = %33
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %11)
%39 = load i32, i32* %2
br label %40
40: ; preds = %37, %33
%41 = phi i32 [ %39, %37 ], [ %34, %33 ]
%42 = load i32, i32* %13
%43 = icmp eq i32 %42, %41
br i1 %43, label %44, label %47
44: ; preds = %40
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%46 = load i32, i32* %2
br label %47
47: ; preds = %44, %40
%48 = phi i32 [ %46, %44 ], [ %41, %40 ]
%49 = load i32, i32* %15
%50 = icmp eq i32 %49, %48
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %15)
br label %53
53: ; preds = %51, %47
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%55 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %3)
%56 = load i8, i8* %3
%57 = and i8 %56, -33
%58 = icmp eq i8 %57, 78
br i1 %58, label %59, label %17
59: ; preds = %53
ret i32 0
}