#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 *, unsigned long long *, unsigned long long *);
int main() {
  unsigned long long n, k;
  int i;
  printf("Please enter n and k with interval: ");
  scanf("%llu %llu", &n, &k);
  unsigned long long result = 1, nMinusKFact = 1;
  for (i = k + 1; i <= n; i++) {
    result = (result * i) / nMinusKFact++;
  }
  printf("%lld\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
movq   $0x1,-0x28(%rbp)
movq   $0x1,-0x30(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     11ac <main+0x8c>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   %rcx,%rax
mov    -0x30(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x30(%rbp)
xor    %edx,%edx
div    %rcx
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116c <main+0x4c>
mov    -0x28(%rbp),%rsi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
mov    0x10(%rsp),%rcx
add    $0x1,%eax
movslq %eax,%rsi
mov    $0x1,%edi
cmp    %rsi,%rcx
jae    117e <main+0x5e>
mov    $0x1,%eax
lea    0xec2(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
movabs $0x100000000,%r8
mov    $0x1,%eax
jmp    11a9 <main+0x89>
nop
xor    %edx,%edx
div    %rdi
add    $0x1,%rdi
shl    $0x20,%rsi
add    %r8,%rsi
sar    $0x20,%rsi
cmp    %rsi,%rcx
jb     1166 <main+0x46>
imul   %rsi,%rax
mov    %rax,%rdx
or     %rdi,%rdx
shr    $0x20,%rdx
jne    1190 <main+0x70>
xor    %edx,%edx
div    %edi
jmp    1195 <main+0x75>

LLVM IR (-O0):
@.str = [37 x i8] c"Please enter n and k with interval: \00"
@.str.1 = [10 x i8] c"%llu %llu\00"
@.str.2 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64* %2, i64* %3)
store i64 1, i64* %5
store i64 1, i64* %6
%9 = load i64, i64* %3
%10 = add i64 %9, 1
%11 = trunc i64 %10 to i32
store i32 %11, i32* %4
br label %12
12: ; preds = %25, %0
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = load i64, i64* %2
%16 = icmp ule i64 %14, %15
br i1 %16, label %17, label %28
17: ; preds = %12
%18 = load i64, i64* %5
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = mul i64 %18, %20
%22 = load i64, i64* %6
%23 = add i64 %22, 1
store i64 %23, i64* %6
%24 = udiv i64 %21, %22
store i64 %24, i64* %5
br label %25
25: ; preds = %17
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %12
28: ; preds = %12
%29 = load i64, i64* %5
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Please enter n and k with interval: \00"
@.str.1 = [10 x i8] c"%llu %llu\00"
@.str.2 = [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 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64* %1, i64* %2)
%7 = load i64, i64* %2
%8 = load i64, i64* %1
%9 = shl i64 %7, 32
%10 = add i64 %9, 4294967296
%11 = ashr exact i64 %10, 32
%12 = icmp ult i64 %8, %11
br i1 %12, label %24, label %13
13: ; preds = %0, %13
%14 = phi i64 [ %22, %13 ], [ %11, %0 ]
%15 = phi i64 [ %18, %13 ], [ 1, %0 ]
%16 = phi i64 [ %19, %13 ], [ 1, %0 ]
%17 = mul i64 %14, %16
%18 = add i64 %15, 1
%19 = udiv i64 %17, %15
%20 = shl nsw i64 %14, 32
%21 = add i64 %20, 4294967296
%22 = ashr exact i64 %21, 32
%23 = icmp ult i64 %8, %22
br i1 %23, label %24, label %13
24: ; preds = %13, %0
%25 = phi i64 [ 1, %0 ], [ %19, %13 ]
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 %25)
ret i32 0
}