#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 *, double, double, double);
int scanf(char *, double *, double *);
int main() {
  double n, m, p, q, l, i, total;
  while (scanf("%lf %lf", &n, &m) == 2) {
    if (n == 0 && m == 0)
      break;
    total = 1;
    p = n - m;
    if (p <= m) {
      q = p;
      l = m;
    } else {
      q = m;
      l = p;
    }
    for (i = n; i > q; i--) {
      total = (total * i) / l;
      l--;
    }
    printf("%.0lf things taken %.0lf at a time is %.0lf exactly.\n", n, m,
           total);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1255 <main+0x135>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1181 <main+0x61>
jp     1181 <main+0x61>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1181 <main+0x61>
jp     1181 <main+0x61>
jmp    1255 <main+0x135>
movsd  0xe77(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11ca <main+0xaa>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11de <main+0xbe>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1235 <main+0x115>
movsd  -0x40(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xdf4(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xde2(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    11e8 <main+0xc8>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
lea    0xdcd(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xee6(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    122b <main+0x10b>
movsd  0xeb6(%rip),%xmm6
lea    0xec7(%rip),%r14
lea    0xeb8(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%rbx
jmp    1197 <main+0x77>
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
movsd  0xe7a(%rip),%xmm6
cmp    $0x2,%eax
jne    122b <main+0x10b>
movsd  0x10(%rsp),%xmm0
ucomisd 0xe6b(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
jne    11bb <main+0x9b>
jp     11bb <main+0x9b>
ucomisd 0xe59(%rip),%xmm1
jne    11bb <main+0x9b>
jnp    122b <main+0x10b>
movapd %xmm0,%xmm5
subsd  %xmm1,%xmm5
movapd %xmm5,%xmm3
cmpnlesd %xmm1,%xmm3
movapd %xmm3,%xmm2
andnpd %xmm5,%xmm2
movapd %xmm3,%xmm4
andpd  %xmm1,%xmm4
orpd   %xmm2,%xmm4
ucomisd %xmm4,%xmm0
movsd  0xe14(%rip),%xmm2
jbe    1170 <main+0x50>
andpd  %xmm3,%xmm5
andnpd %xmm1,%xmm3
orpd   %xmm5,%xmm3
movsd  0xdfe(%rip),%xmm2
movapd %xmm0,%xmm5
cs nopw 0x0(%rax,%rax,1)
mulsd  %xmm5,%xmm2
divsd  %xmm3,%xmm2
addsd  %xmm6,%xmm3
addsd  %xmm6,%xmm5
ucomisd %xmm4,%xmm5
ja     1210 <main+0xf0>
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [54 x i8] c"%.0lf things taken %.0lf at a time is %.0lf exactly.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 0, i32* %1
br label %9
9: ; preds = %49, %0
%10 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %54
12: ; preds = %9
%13 = load double, double* %2
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load double, double* %3
%17 = fcmp oeq double %16, 0.000000e+00
br i1 %17, label %18, label %19
18: ; preds = %15
br label %54
19: ; preds = %15, %12
store double 1.000000e+00, double* %8
%20 = load double, double* %2
%21 = load double, double* %3
%22 = fsub double %20, %21
store double %22, double* %4
%23 = load double, double* %4
%24 = load double, double* %3
%25 = fcmp ole double %23, %24
br i1 %25, label %26, label %29
26: ; preds = %19
%27 = load double, double* %4
store double %27, double* %5
%28 = load double, double* %3
store double %28, double* %6
br label %32
29: ; preds = %19
%30 = load double, double* %3
store double %30, double* %5
%31 = load double, double* %4
store double %31, double* %6
br label %32
32: ; preds = %29, %26
%33 = load double, double* %2
store double %33, double* %7
br label %34
34: ; preds = %46, %32
%35 = load double, double* %7
%36 = load double, double* %5
%37 = fcmp ogt double %35, %36
br i1 %37, label %38, label %49
38: ; preds = %34
%39 = load double, double* %8
%40 = load double, double* %7
%41 = fmul double %39, %40
%42 = load double, double* %6
%43 = fdiv double %41, %42
store double %43, double* %8
%44 = load double, double* %6
%45 = fadd double %44, -1.000000e+00
store double %45, double* %6
br label %46
46: ; preds = %38
%47 = load double, double* %7
%48 = fadd double %47, -1.000000e+00
store double %48, double* %7
br label %34
49: ; preds = %34
%50 = load double, double* %2
%51 = load double, double* %3
%52 = load double, double* %8
%53 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), double %50, double %51, double %52)
br label %9
54: ; preds = %18, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [54 x i8] c"%.0lf things taken %.0lf at a time is %.0lf exactly.\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %34
7: ; preds = %0, %29
%8 = load double, double* %1
%9 = fcmp oeq double %8, 0.000000e+00
%10 = load double, double* %2
%11 = fcmp oeq double %10, 0.000000e+00
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %34, label %13
13: ; preds = %7
%14 = fsub double %8, %10
%15 = fcmp ugt double %14, %10
%16 = select i1 %15, double %10, double %14
%17 = fcmp ogt double %8, %16
br i1 %17, label %18, label %29
18: ; preds = %13
%19 = select i1 %15, double %14, double %10
br label %20
20: ; preds = %18, %20
%21 = phi double [ %25, %20 ], [ 1.000000e+00, %18 ]
%22 = phi double [ %27, %20 ], [ %8, %18 ]
%23 = phi double [ %26, %20 ], [ %19, %18 ]
%24 = fmul double %22, %21
%25 = fdiv double %24, %23
%26 = fadd double %23, -1.000000e+00
%27 = fadd double %22, -1.000000e+00
%28 = fcmp ogt double %27, %16
br i1 %28, label %20, label %29
29: ; preds = %20, %13
%30 = phi double [ 1.000000e+00, %13 ], [ %25, %20 ]
%31 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), double %8, double %10, double %30)
%32 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%33 = icmp eq i32 %32, 2
br i1 %33, label %7, label %34
34: ; preds = %29, %7, %0
ret i32 0
}