#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);
int /*<<< orphan*/ scanf(char *, int *);
void rekurzivnoPunjenjePolja(int *polje, int duzinaPolja, int indeks) {
  if (indeks > duzinaPolja - 1) {
    return;
  }
  printf("Unesite %d. element (pozicija %d): ", indeks + 1, indeks);
  scanf("%d", polje + indeks);
  indeks++;
  rekurzivnoPunjenjePolja(polje, duzinaPolja, indeks);
}


x86 assembly (clang, -O0):
<rekurzivnoPunjenjePolja>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    1158 <rekurzivnoPunjenjePolja+0x28>
jmp    11a0 <rekurzivnoPunjenjePolja+0x70>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea1(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <rekurzivnoPunjenjePolja@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rekurzivnoPunjenjePolja>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    %edx,%esi
jle    1177 <rekurzivnoPunjenjePolja+0x57>
movslq %edx,%rax
movslq %esi,%rbp
lea    (%rdi,%rax,4),%rbx
sub    %rax,%rbp
lea    0xec0(%rip),%r14
lea    0xedd(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x1(%rdx),%r12d
mov    %r14,%rdi
mov    %r12d,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x4,%rbx
mov    %r12d,%edx
add    $0xffffffffffffffff,%rbp
jne    1150 <rekurzivnoPunjenjePolja+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Unesite %d. element (pozicija %d): \00"
@.str.1 = [3 x i8] c"%d\00"
define void @rekurzivnoPunjenjePolja(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = icmp sgt i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %27
12: ; preds = %3
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
%17 = load i32*, i32** %4
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %20)
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
%24 = load i32*, i32** %4
%25 = load i32, i32* %5
%26 = load i32, i32* %6
br label %27
27: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Unesite %d. element (pozicija %d): \00"
@.str.1 = [3 x i8] c"%d\00"
define void @rekurzivnoPunjenjePolja(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %6, %5 ], [ %10, %8 ]
%10 = add nsw i64 %9, 1
%11 = trunc i64 %10 to i32
%12 = trunc i64 %9 to i32
%13 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = getelementptr inbounds i32, i32* %0, i64 %9
%15 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = icmp eq i64 %10, %7
br i1 %16, label %17, label %8
17: ; preds = %8, %3
ret void
}