#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 dobiPrvihNMest(long long, int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, long long *, long long *);
int vrniDolzino(long long);
int main() {
  long long osnova, mesta;
  int kjeMesta = 0, kjeOsnova = 0;
  scanf("%lld%lld", &osnova, &mesta);
  while (kjeMesta < vrniDolzino(mesta)) {
    int kolikoIzpisi = dobiPrvihNMest(mesta, 1, kjeMesta);
    printf("%lld\n", dobiPrvihNMest(osnova, kolikoIzpisi, kjeOsnova));
    kjeOsnova += kolikoIzpisi;
    kjeMesta++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xe9c(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <scanf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <vrniDolzino@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
cmp    %ecx,%eax
jge    11d5 <main+0x95>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    $0x1,%esi
call   1040 <dobiPrvihNMest@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1040 <dobiPrvihNMest@plt>
mov    %eax,%esi
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1171 <main+0x31>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xeaf(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1060 <scanf@plt>
mov    0x8(%rsp),%rdi
call   1050 <vrniDolzino@plt>
test   %eax,%eax
jle    11c0 <main+0x80>
xor    %ebx,%ebx
lea    0xe92(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    0x8(%rsp),%rdi
mov    $0x1,%esi
mov    %ebx,%edx
call   1040 <dobiPrvihNMest@plt>
mov    %eax,%r15d
mov    0x10(%rsp),%rdi
mov    %eax,%esi
mov    %ebp,%edx
call   1040 <dobiPrvihNMest@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    %r15d,%ebp
add    $0x1,%ebx
mov    0x8(%rsp),%rdi
call   1050 <vrniDolzino@plt>
cmp    %eax,%ebx
jl     1180 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%lld%lld\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* %2
%7 = call i32 @vrniDolzino(i64 %6)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %0, %9
%10 = phi i32 [ %18, %9 ], [ 0, %0 ]
%11 = phi i32 [ %17, %9 ], [ 0, %0 ]
%12 = load i64, i64* %2
%13 = call i32 @dobiPrvihNMest(i64 %12, i32 1, i32 %10)
%14 = load i64, i64* %1
%15 = call i32 @dobiPrvihNMest(i64 %14, i32 %13, i32 %11)
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = add nsw i32 %13, %11
%18 = add nuw nsw i32 %10, 1
%19 = load i64, i64* %2
%20 = call i32 @vrniDolzino(i64 %19)
%21 = icmp slt i32 %18, %20
br i1 %21, label %9, label %22
22: ; preds = %9, %0
ret i32 0
}