#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 */
scalar_t__ EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ root(unsigned long long, unsigned long long,
                        unsigned long long);
scalar_t__ scanf(char *, unsigned long long *, unsigned long long *,
                 unsigned long long *);
int main() {
  unsigned long long x, y, k;
  while (scanf("%llu%llu%llu", &x, &y, &k) != EOF) {
    printf("%llu\n", root(x, y, k - 1));
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1050 <scanf@plt>
mov    0x2e7a(%rip),%rcx
cmp    (%rcx),%rax
je     119f <main+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
sub    $0x1,%rdx
call   1040 <root@plt>
mov    %eax,%esi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
jmp    114f <main+0xf>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeab(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1050 <scanf@plt>
mov    0x2e7a(%rip),%rbp
cmp    0x0(%rbp),%rax
je     11c8 <main+0x88>
lea    0xe92(%rip),%r14
lea    0xe7e(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%r13
mov    %rsp,%rbx
nop
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    (%rsp),%rdx
add    $0xffffffffffffffff,%rdx
call   1040 <root@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
call   1050 <scanf@plt>
cmp    0x0(%rbp),%rax
jne    1190 <main+0x50>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%llu%llu%llu\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
br label %5
5: ; preds = %9, %0
%6 = call i64 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3, i64* %4)
%7 = load i64, i64* @EOF
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i64, i64* %2
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = sub i64 %12, 1
%14 = call i32 @root(i64 %10, i64 %11, i64 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %5
16: ; preds = %5
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"%llu%llu%llu\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%llu\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
%5 = bitcast i64* %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = call i64 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2, i64* %3)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %20, label %10
10: ; preds = %0, %10
%11 = load i64, i64* %1
%12 = load i64, i64* %2
%13 = load i64, i64* %3
%14 = add i64 %13, -1
%15 = call i32 @root(i64 %11, i64 %12, i64 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = call i64 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2, i64* %3)
%18 = load i64, i64* @EOF
%19 = icmp eq i64 %17, %18
br i1 %19, label %20, label %10
20: ; preds = %10, %0
%21 = call i32 @exit(i32 0)
unreachable
}