#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*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ checkIntInput(int *, int *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int n, k;
  int factorialN = 1;
  int factorialK = 1;
  printf("Enter n and k: ");
  checkIntInput(&n, &k);
  if (k > 1 && k < n && k < 100) {
    int i;
    for (i = 1; i <= n; i++) {
      factorialN *= i;
      if (i <= k) {
        factorialK *= i;
      }
    }
    printf("%d", factorialN / factorialK);
  } else {
    printf("The numbers should be (1 < k < n < 100)!");
    exit(EXIT_FAILURE);
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <checkIntInput@plt>
cmpl   $0x1,-0xc(%rbp)
jle    11ea <main+0xba>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ea <main+0xba>
cmpl   $0x64,-0xc(%rbp)
jge    11ea <main+0xba>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11ce <main+0x9e>
mov    -0x18(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11bb <main+0x8b>
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11c0 <main+0x90>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    118f <main+0x5f>
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1206 <main+0xd6>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf28(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <checkIntInput@plt>
mov    (%rsp),%r10d
cmp    $0x2,%r10d
jl     14fc <main+0x3cc>
cmp    $0x63,%r10d
ja     14fc <main+0x3cc>
mov    0x4(%rsp),%edx
cmp    %edx,%r10d
jge    14fc <main+0x3cc>
test   %edx,%edx
jle    14ae <main+0x37e>
mov    $0x1,%r9d
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%eax
cmp    $0x8,%edx
jb     147f <main+0x34f>
mov    %edx,%edi
and    $0xfffffff8,%edi
movd   %r10d,%xmm0
pshufd $0x0,%xmm0,%xmm12
lea    -0x8(%rdi),%eax
mov    %eax,%r8d
shr    $0x3,%r8d
add    $0x1,%r8d
test   %eax,%eax
je     14cc <main+0x39c>
mov    %r8d,%eax
and    $0xfffffffe,%eax
movdqa 0xe34(%rip),%xmm9
movdqa 0xe3b(%rip),%xmm8
movdqa 0xe62(%rip),%xmm10
movdqa 0xe69(%rip),%xmm11
movdqa %xmm9,%xmm15
movdqa %xmm9,%xmm5
movdqa %xmm9,%xmm2
cs nopw 0x0(%rax,%rax,1)
movdqa %xmm8,%xmm4
paddd  0xe13(%rip),%xmm4
pshufd $0xf5,%xmm5,%xmm0
pshufd $0xf5,%xmm8,%xmm3
pmuludq %xmm0,%xmm3
pmuludq %xmm8,%xmm5
pshufd $0xf5,%xmm2,%xmm6
pshufd $0xf5,%xmm4,%xmm0
pmuludq %xmm6,%xmm0
pmuludq %xmm4,%xmm2
movdqa %xmm8,%xmm6
pcmpgtd %xmm12,%xmm6
movdqa %xmm4,%xmm1
pcmpgtd %xmm12,%xmm1
movdqa %xmm6,%xmm7
pandn  %xmm8,%xmm7
psubd  %xmm6,%xmm7
movdqa %xmm1,%xmm6
pandn  %xmm4,%xmm6
psubd  %xmm1,%xmm6
pshufd $0xf5,%xmm7,%xmm1
pshufd $0xf5,%xmm9,%xmm14
pmuludq %xmm1,%xmm14
pmuludq %xmm9,%xmm7
pshufd $0xf5,%xmm6,%xmm1
pshufd $0xf5,%xmm15,%xmm13
pmuludq %xmm1,%xmm13
pmuludq %xmm15,%xmm6
movdqa %xmm8,%xmm1
paddd  0xd9a(%rip),%xmm1
pshufd $0xf5,%xmm1,%xmm4
pmuludq %xmm3,%xmm4
movdqa %xmm8,%xmm3
paddd  %xmm10,%xmm3
pmuludq %xmm1,%xmm5
pshufd $0xe8,%xmm5,%xmm5
pshufd $0xe8,%xmm4,%xmm4
punpckldq %xmm4,%xmm5
pmuludq %xmm3,%xmm2
pshufd $0xe8,%xmm2,%xmm2
pshufd $0xf5,%xmm3,%xmm4
pmuludq %xmm0,%xmm4
pshufd $0xe8,%xmm4,%xmm0
punpckldq %xmm0,%xmm2
movdqa %xmm1,%xmm0
pcmpgtd %xmm12,%xmm0
movdqa %xmm0,%xmm4
pandn  %xmm1,%xmm4
movdqa %xmm3,%xmm1
pcmpgtd %xmm12,%xmm1
psubd  %xmm0,%xmm4
movdqa %xmm1,%xmm0
pandn  %xmm3,%xmm0
psubd  %xmm1,%xmm0
pmuludq %xmm4,%xmm7
pshufd $0xf5,%xmm4,%xmm1
pmuludq %xmm14,%xmm1
pshufd $0xe8,%xmm7,%xmm9
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm1,%xmm9
pmuludq %xmm0,%xmm6
pshufd $0xf5,%xmm0,%xmm0
pmuludq %xmm13,%xmm0
pshufd $0xe8,%xmm6,%xmm15
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm15
paddd  %xmm11,%xmm8
add    $0xfffffffe,%eax
jne    1200 <main+0xd0>
test   $0x1,%r8b
je     141b <main+0x2eb>
movdqa 0xcc4(%rip),%xmm0
paddd  %xmm8,%xmm0
movdqa %xmm8,%xmm1
pmuludq %xmm5,%xmm1
pshufd $0xf5,%xmm5,%xmm3
pshufd $0xe8,%xmm1,%xmm5
pshufd $0xf5,%xmm8,%xmm1
pmuludq %xmm3,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm1,%xmm5
pshufd $0xf5,%xmm0,%xmm1
movdqa %xmm0,%xmm3
pcmpgtd %xmm12,%xmm3
movdqa %xmm3,%xmm4
pandn  %xmm0,%xmm4
pmuludq %xmm2,%xmm0
pshufd $0xf5,%xmm2,%xmm2
pmuludq %xmm2,%xmm1
pshufd $0xe8,%xmm0,%xmm2
pshufd $0xe8,%xmm1,%xmm0
punpckldq %xmm0,%xmm2
movdqa %xmm8,%xmm0
pcmpgtd %xmm12,%xmm0
movdqa %xmm0,%xmm1
pandn  %xmm8,%xmm1
psubd  %xmm0,%xmm1
psubd  %xmm3,%xmm4
pshufd $0xf5,%xmm1,%xmm0
pmuludq %xmm9,%xmm1
pshufd $0xf5,%xmm9,%xmm3
pshufd $0xe8,%xmm1,%xmm9
pmuludq %xmm0,%xmm3
pshufd $0xe8,%xmm3,%xmm0
punpckldq %xmm0,%xmm9
pshufd $0xf5,%xmm4,%xmm0
pmuludq %xmm15,%xmm4
pshufd $0xf5,%xmm15,%xmm1
pshufd $0xe8,%xmm4,%xmm15
pmuludq %xmm0,%xmm1
pshufd $0xe8,%xmm1,%xmm0
punpckldq %xmm0,%xmm15
pshufd $0xf5,%xmm5,%xmm0
pshufd $0xf5,%xmm2,%xmm1
pmuludq %xmm0,%xmm1
pmuludq %xmm5,%xmm2
pshufd $0xee,%xmm2,%xmm0
pmuludq %xmm2,%xmm0
pshufd $0xaa,%xmm1,%xmm2
pmuludq %xmm1,%xmm2
pmuludq %xmm0,%xmm2
movd   %xmm2,%eax
pshufd $0xf5,%xmm9,%xmm0
pshufd $0xf5,%xmm15,%xmm1
pmuludq %xmm0,%xmm1
pmuludq %xmm9,%xmm15
pshufd $0xee,%xmm15,%xmm0
pmuludq %xmm15,%xmm0
pshufd $0xaa,%xmm1,%xmm2
pmuludq %xmm1,%xmm2
pmuludq %xmm0,%xmm2
movd   %xmm2,%esi
cmp    %edi,%edx
je     14a6 <main+0x376>
or     $0x1,%edi
add    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
imul   %edi,%eax
cmp    %r10d,%edi
mov    %edi,%ecx
cmovg  %r9d,%ecx
imul   %ecx,%esi
add    $0x1,%edi
cmp    %edi,%edx
jne    1490 <main+0x360>
xor    %edx,%edx
div    %esi
mov    %eax,%esi
jmp    14b3 <main+0x383>
mov    $0x1,%esi
lea    0xbb6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2b10(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
movdqa 0xb2b(%rip),%xmm9
movdqa 0xb32(%rip),%xmm8
movdqa %xmm9,%xmm15
movdqa %xmm9,%xmm5
movdqa %xmm9,%xmm2
test   $0x1,%r8b
jne    1354 <main+0x224>
jmp    141b <main+0x2eb>
lea    0xb70(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2acf(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Enter n and k: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [41 x i8] c"The numbers should be (1 < k < n < 100)!\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %4
store i32 1, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @checkIntInput(i32* %2, i32* %3)
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %43
11: ; preds = %0
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %43
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 100
br i1 %17, label %18, label %43
18: ; preds = %15
store i32 1, i32* %6
br label %19
19: ; preds = %35, %18
%20 = load i32, i32* %6
%21 = load i32, i32* %2
%22 = icmp sle i32 %20, %21
br i1 %22, label %23, label %38
23: ; preds = %19
%24 = load i32, i32* %6
%25 = load i32, i32* %4
%26 = mul nsw i32 %25, %24
store i32 %26, i32* %4
%27 = load i32, i32* %6
%28 = load i32, i32* %3
%29 = icmp sle i32 %27, %28
br i1 %29, label %30, label %34
30: ; preds = %23
%31 = load i32, i32* %6
%32 = load i32, i32* %5
%33 = mul nsw i32 %32, %31
store i32 %33, i32* %5
br label %34
34: ; preds = %30, %23
br label %35
35: ; preds = %34
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %19
38: ; preds = %19
%39 = load i32, i32* %4
%40 = load i32, i32* %5
%41 = sdiv i32 %39, %40
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %41)
br label %47
43: ; preds = %15, %11, %0
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%45 = load i32, i32* @EXIT_FAILURE
%46 = call i32 @exit(i32 %45)
unreachable
47: ; preds = %38
%48 = load i32, i32* @EXIT_SUCCESS
ret i32 %48
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter n and k: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [41 x i8] c"The numbers should be (1 < k < n < 100)!\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @checkIntInput(i32* %1, i32* %2)
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %114
9: ; preds = %0
%10 = load i32, i32* %1
%11 = icmp slt i32 %7, %10
%12 = icmp ult i32 %7, 100
%13 = and i1 %12, %11
br i1 %13, label %14, label %114
14: ; preds = %9
%15 = icmp slt i32 %10, 1
br i1 %15, label %110, label %16
16: ; preds = %14
%17 = icmp ult i32 %10, 8
br i1 %17, label %92, label %18
18: ; preds = %16
%19 = and i32 %10, -8
%20 = or i32 %19, 1
%21 = insertelement <4 x i32> poison, i32 %7, i64 0
%22 = shufflevector <4 x i32> %21, <4 x i32> poison, <4 x i32> zeroinitializer
%23 = insertelement <4 x i32> poison, i32 %7, i64 0
%24 = shufflevector <4 x i32> %23, <4 x i32> poison, <4 x i32> zeroinitializer
%25 = add i32 %19, -8
%26 = lshr exact i32 %25, 3
%27 = add nuw nsw i32 %26, 1
%28 = and i32 %27, 1
%29 = icmp eq i32 %25, 0
br i1 %29, label %61, label %30
30: ; preds = %18
%31 = and i32 %27, 1073741822
br label %32
32: ; preds = %32, %30
%33 = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %30 ], [ %58, %32 ]
%34 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %30 ], [ %56, %32 ]
%35 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %30 ], [ %57, %32 ]
%36 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %30 ], [ %50, %32 ]
%37 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %30 ], [ %51, %32 ]
%38 = phi i32 [ 0, %30 ], [ %59, %32 ]
%39 = add <4 x i32> %33, <i32 4, i32 4, i32 4, i32 4>
%40 = mul <4 x i32> %33, %36
%41 = mul <4 x i32> %39, %37
%42 = icmp sgt <4 x i32> %33, %22
%43 = icmp sgt <4 x i32> %39, %24
%44 = select <4 x i1> %42, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %33
%45 = select <4 x i1> %43, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %39
%46 = mul <4 x i32> %44, %34
%47 = mul <4 x i32> %45, %35
%48 = add <4 x i32> %33, <i32 8, i32 8, i32 8, i32 8>
%49 = add <4 x i32> %33, <i32 12, i32 12, i32 12, i32 12>
%50 = mul <4 x i32> %48, %40
%51 = mul <4 x i32> %49, %41
%52 = icmp sgt <4 x i32> %48, %22
%53 = icmp sgt <4 x i32> %49, %24
%54 = select <4 x i1> %52, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %48
%55 = select <4 x i1> %53, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %49
%56 = mul <4 x i32> %54, %46
%57 = mul <4 x i32> %55, %47
%58 = add <4 x i32> %33, <i32 16, i32 16, i32 16, i32 16>
%59 = add i32 %38, 2
%60 = icmp eq i32 %59, %31
br i1 %60, label %61, label %32
61: ; preds = %32, %18
%62 = phi <4 x i32> [ undef, %18 ], [ %50, %32 ]
%63 = phi <4 x i32> [ undef, %18 ], [ %51, %32 ]
%64 = phi <4 x i32> [ undef, %18 ], [ %56, %32 ]
%65 = phi <4 x i32> [ undef, %18 ], [ %57, %32 ]
%66 = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %18 ], [ %58, %32 ]
%67 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %18 ], [ %56, %32 ]
%68 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %18 ], [ %57, %32 ]
%69 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %18 ], [ %50, %32 ]
%70 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %18 ], [ %51, %32 ]
%71 = icmp eq i32 %28, 0
br i1 %71, label %82, label %72
72: ; preds = %61
%73 = add <4 x i32> %66, <i32 4, i32 4, i32 4, i32 4>
%74 = mul <4 x i32> %66, %69
%75 = mul <4 x i32> %73, %70
%76 = icmp sgt <4 x i32> %66, %22
%77 = icmp sgt <4 x i32> %73, %24
%78 = select <4 x i1> %76, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %66
%79 = select <4 x i1> %77, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %73
%80 = mul <4 x i32> %78, %67
%81 = mul <4 x i32> %79, %68
br label %82
82: ; preds = %61, %72
%83 = phi <4 x i32> [ %62, %61 ], [ %74, %72 ]
%84 = phi <4 x i32> [ %63, %61 ], [ %75, %72 ]
%85 = phi <4 x i32> [ %64, %61 ], [ %80, %72 ]
%86 = phi <4 x i32> [ %65, %61 ], [ %81, %72 ]
%87 = mul <4 x i32> %84, %83
%88 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %87)
%89 = mul <4 x i32> %86, %85
%90 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %89)
%91 = icmp eq i32 %10, %19
br i1 %91, label %106, label %92
92: ; preds = %16, %82
%93 = phi i32 [ 1, %16 ], [ %20, %82 ]
%94 = phi i32 [ 1, %16 ], [ %90, %82 ]
%95 = phi i32 [ 1, %16 ], [ %88, %82 ]
br label %96
96: ; preds = %92, %96
%97 = phi i32 [ %104, %96 ], [ %93, %92 ]
%98 = phi i32 [ %103, %96 ], [ %94, %92 ]
%99 = phi i32 [ %100, %96 ], [ %95, %92 ]
%100 = mul nsw i32 %97, %99
%101 = icmp sgt i32 %97, %7
%102 = select i1 %101, i32 1, i32 %97
%103 = mul nsw i32 %102, %98
%104 = add nuw i32 %97, 1
%105 = icmp eq i32 %97, %10
br i1 %105, label %106, label %96
106: ; preds = %96, %82
%107 = phi i32 [ %88, %82 ], [ %100, %96 ]
%108 = phi i32 [ %90, %82 ], [ %103, %96 ]
%109 = udiv i32 %107, %108
br label %110
110: ; preds = %106, %14
%111 = phi i32 [ %109, %106 ], [ 1, %14 ]
%112 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %111)
%113 = load i32, i32* @EXIT_SUCCESS
ret i32 %113
114: ; preds = %9, %0
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%116 = load i32, i32* @EXIT_FAILURE
%117 = call i32 @exit(i32 %116)
unreachable
}