#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*/ nCr(long long, long long);
int /*<<< orphan*/ printf(char *, long long, long long, int /*<<< orphan*/);
int scanf(char *, long long *, long long *);
int main() {
  long long n, r;
  while (scanf("%lld%lld", &n, &r) == 2) {
    if (n == 0 && r == 0)
      break;
    printf("%lld things taken %lld at a time is %lld exactly.\n", n, r,
           nCr(n, r));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11af <main+0x7f>
cmpq   $0x0,-0x10(%rbp)
jne    1177 <main+0x47>
cmpq   $0x0,-0x18(%rbp)
jne    1177 <main+0x47>
jmp    11af <main+0x7f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <nCr@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebb(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11c0 <main+0x90>
lea    0xea9(%rip),%r14
lea    0xe99(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rbx
mov    0x8(%rsp),%rbp
mov    %rbx,%rax
or     %rbp,%rax
je     11c0 <main+0x90>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <nCr@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%lld%lld\00"
@.str.1 = [51 x i8] c"%lld things taken %lld at a time is %lld exactly.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i64, i64* %2
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i64, i64* %3
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
br label %21
14: ; preds = %10, %7
%15 = load i64, i64* %2
%16 = load i64, i64* %3
%17 = load i64, i64* %2
%18 = load i64, i64* %3
%19 = call i32 @nCr(i64 %17, i64 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i64 %15, i64 %16, i32 %19)
br label %4
21: ; preds = %13, %4
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%lld%lld\00"
@.str.1 = [51 x i8] c"%lld things taken %lld at a time is %lld exactly.\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 = icmp eq i32 %5, 2
br i1 %6, label %7, label %18
7: ; preds = %0, %13
%8 = load i64, i64* %1
%9 = icmp eq i64 %8, 0
%10 = load i64, i64* %2
%11 = icmp eq i64 %10, 0
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %18, label %13
13: ; preds = %7
%14 = call i32 @nCr(i64 %8, i64 %10)
%15 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i64 %8, i64 %10, i32 %14)
%16 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%17 = icmp eq i32 %16, 2
br i1 %17, label %7, label %18
18: ; preds = %13, %7, %0
ret i32 0
}