#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 mas[200];
  int i;
  int k;
  int t = 0;
  int q = 0;
  printf("vuvedi maksimalna stoinost\n");
  scanf("%d", &k);
  printf("vuvedi stoinosti\n");
  scanf("%d", mas);
  while (i <= k) {
    if (mas[t] = mas[i]) {
      q++;
      printf("%d: %d\n", t, q);
    }
    t++;
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x33c(%rbp)
movl   $0x0,-0x340(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x338(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x330(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x334(%rbp),%eax
cmp    -0x338(%rbp),%eax
jg     120b <main+0xeb>
movslq -0x334(%rbp),%rax
mov    -0x330(%rbp,%rax,4),%eax
movslq -0x33c(%rbp),%rcx
mov    %eax,-0x330(%rbp,%rcx,4)
cmp    $0x0,%eax
je     11e8 <main+0xc8>
mov    -0x340(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x340(%rbp)
mov    -0x33c(%rbp),%esi
mov    -0x340(%rbp),%edx
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x33c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x33c(%rbp)
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    1188 <main+0x68>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x330,%rsp
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb2(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe88(%rip),%r14
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    11a1 <main+0x71>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rbx),%rax
movslq 0xc(%rsp),%rcx
cmp    %rcx,%rbx
mov    %rax,%rbx
jge    11bb <main+0x8b>
cmpl   $0x0,0x10(%rsp,%rbx,4)
je     1190 <main+0x60>
add    $0x1,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1190 <main+0x60>
xor    %eax,%eax
add    $0x330,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"vuvedi maksimalna stoinost\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"vuvedi stoinosti\0A\00"
@.str.3 = [8 x i8] c"%d: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [200 x i32], [200 x i32]* %2, i64 0, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
br label %12
12: ; preds = %31, %0
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %36
16: ; preds = %12
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [200 x i32], [200 x i32]* %2, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [200 x i32], [200 x i32]* %2, i64 0, i64 %22
store i32 %20, i32* %23
%24 = icmp ne i32 %20, 0
br i1 %24, label %25, label %31
25: ; preds = %16
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %28, i32 %29)
br label %31
31: ; preds = %25, %16
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %12
36: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [8 x i8] c"%d: %d\0A\00"
@str = [27 x i8] c"vuvedi maksimalna stoinost\00"
@str.4 = [17 x i8] c"vuvedi stoinosti\00"
define i32 @main() {
%1 = alloca [200 x i32]
%2 = alloca i32
%3 = bitcast [200 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0))
%8 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
br label %10
10: ; preds = %0, %20
%11 = phi i64 [ 0, %0 ], [ %22, %20 ]
%12 = phi i32 [ 0, %0 ], [ %21, %20 ]
%13 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 %11
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %10
%17 = add nsw i32 %12, 1
%18 = trunc i64 %11 to i32
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %18, i32 %17)
br label %20
20: ; preds = %16, %10
%21 = phi i32 [ %17, %16 ], [ %12, %10 ]
%22 = add nuw nsw i64 %11, 1
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = icmp slt i64 %11, %24
br i1 %25, label %10, label %26
26: ; preds = %20
ret i32 0
}