#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 *, int *);
int main() {
  int n, aw = 1;
  printf("Enter the number of letters to be arranged:");
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    aw *= i;
  printf("\nA group of %d letters can be arranged in %d different ways.\n", n,
         aw);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     117f <main+0x5f>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115b <main+0x3b>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf78(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf96(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jle    118e <main+0x6e>
mov    $0x1,%eax
mov    $0x1,%edx
cmp    $0x8,%esi
jb     1380 <main+0x260>
mov    %esi,%eax
and    $0xfffffff8,%eax
lea    -0x8(%rax),%edi
mov    %edi,%edx
shr    $0x3,%edx
add    $0x1,%edx
mov    %edx,%ecx
and    $0x3,%ecx
cmp    $0x18,%edi
jae    1198 <main+0x78>
movdqa 0xe83(%rip),%xmm1
movdqa 0xe8b(%rip),%xmm0
movdqa %xmm1,%xmm4
jmp    12d1 <main+0x1b1>
mov    $0x1,%edx
jmp    139a <main+0x27a>
and    $0xfffffffc,%edx
movdqa 0xe5d(%rip),%xmm1
movdqa 0xe65(%rip),%xmm0
movdqa 0xe7c(%rip),%xmm9
movdqa 0xe83(%rip),%xmm10
movdqa 0xe8a(%rip),%xmm11
movdqa 0xe91(%rip),%xmm12
movdqa 0xe98(%rip),%xmm13
movdqa 0xe9f(%rip),%xmm14
movdqa 0xea6(%rip),%xmm15
movdqa %xmm1,%xmm4
xchg   %ax,%ax
movdqa %xmm0,%xmm5
paddd  0xe24(%rip),%xmm5
pshufd $0xf5,%xmm1,%xmm6
pshufd $0xf5,%xmm0,%xmm7
pmuludq %xmm6,%xmm7
pmuludq %xmm0,%xmm1
pshufd $0xf5,%xmm4,%xmm6
pshufd $0xf5,%xmm5,%xmm2
pmuludq %xmm6,%xmm2
pmuludq %xmm4,%xmm5
movdqa %xmm0,%xmm4
paddd  %xmm9,%xmm4
movdqa %xmm0,%xmm6
paddd  %xmm10,%xmm6
pmuludq %xmm4,%xmm1
pshufd $0xf5,%xmm4,%xmm4
pmuludq %xmm7,%xmm4
pmuludq %xmm6,%xmm5
pshufd $0xf5,%xmm6,%xmm6
pmuludq %xmm2,%xmm6
movdqa %xmm0,%xmm2
paddd  %xmm11,%xmm2
movdqa %xmm0,%xmm7
paddd  %xmm12,%xmm7
pshufd $0xf5,%xmm2,%xmm3
pmuludq %xmm4,%xmm3
pmuludq %xmm1,%xmm2
pshufd $0xf5,%xmm7,%xmm8
pmuludq %xmm6,%xmm8
pmuludq %xmm5,%xmm7
movdqa %xmm0,%xmm4
paddd  %xmm13,%xmm4
movdqa %xmm0,%xmm5
paddd  %xmm14,%xmm5
pmuludq %xmm4,%xmm2
pshufd $0xe8,%xmm2,%xmm1
pshufd $0xf5,%xmm4,%xmm2
pmuludq %xmm3,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm1
pmuludq %xmm5,%xmm7
pshufd $0xe8,%xmm7,%xmm4
pshufd $0xf5,%xmm5,%xmm2
pmuludq %xmm8,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm4
paddd  %xmm15,%xmm0
add    $0xfffffffc,%edx
jne    11f0 <main+0xd0>
movdqa %xmm1,%xmm5
movdqa %xmm4,%xmm6
test   %ecx,%ecx
je     134d <main+0x22d>
movdqa 0xd3b(%rip),%xmm2
movdqa 0xd43(%rip),%xmm3
nopl   (%rax)
movdqa %xmm0,%xmm6
paddd  %xmm2,%xmm6
movdqa %xmm0,%xmm5
pmuludq %xmm1,%xmm5
pshufd $0xe8,%xmm5,%xmm5
pshufd $0xf5,%xmm1,%xmm1
pshufd $0xf5,%xmm0,%xmm7
pmuludq %xmm1,%xmm7
pshufd $0xe8,%xmm7,%xmm1
punpckldq %xmm1,%xmm5
pshufd $0xf5,%xmm6,%xmm1
pmuludq %xmm4,%xmm6
pshufd $0xe8,%xmm6,%xmm6
pshufd $0xf5,%xmm4,%xmm4
pmuludq %xmm1,%xmm4
pshufd $0xe8,%xmm4,%xmm1
punpckldq %xmm1,%xmm6
paddd  %xmm3,%xmm0
movdqa %xmm5,%xmm1
movdqa %xmm6,%xmm4
add    $0xffffffff,%ecx
jne    12f0 <main+0x1d0>
pshufd $0xf5,%xmm5,%xmm0
pshufd $0xf5,%xmm6,%xmm1
pmuludq %xmm0,%xmm1
pmuludq %xmm5,%xmm6
pshufd $0xee,%xmm6,%xmm0
pmuludq %xmm6,%xmm0
pshufd $0xaa,%xmm1,%xmm2
pmuludq %xmm1,%xmm2
pmuludq %xmm0,%xmm2
movd   %xmm2,%edx
cmp    %eax,%esi
je     139a <main+0x27a>
or     $0x1,%eax
lea    0x1(%rsi),%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
imul   %eax,%edx
add    $0x1,%eax
cmp    %eax,%ecx
jne    1390 <main+0x270>
lea    0xd2e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Enter the number of letters to be arranged:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [62 x i8] c"\0AA group of %d letters can be arranged in %d different ways.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
store i32 1, i32* %4
br label %7
7: ; preds = %15, %0
%8 = load i32, i32* %4
%9 = load i32, i32* %2
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = mul nsw i32 %13, %12
store i32 %14, i32* %3
br label %15
15: ; preds = %11
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %7
18: ; preds = %7
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i32 %19, i32 %20)
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [44 x i8] c"Enter the number of letters to be arranged:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [62 x i8] c"\0AA group of %d letters can be arranged in %d different ways.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 1
br i1 %6, label %69, label %7
7: ; preds = %0
%8 = icmp ult i32 %5, 8
br i1 %8, label %66, label %9
9: ; preds = %7
%10 = and i32 %5, -8
%11 = or i32 %10, 1
%12 = add i32 %10, -8
%13 = lshr exact i32 %12, 3
%14 = add nuw nsw i32 %13, 1
%15 = and i32 %14, 3
%16 = icmp ult i32 %12, 24
br i1 %16, label %42, label %17
17: ; preds = %9
%18 = and i32 %14, 1073741820
br label %19
19: ; preds = %19, %17
%20 = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %17 ], [ %39, %19 ]
%21 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %17 ], [ %37, %19 ]
%22 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %17 ], [ %38, %19 ]
%23 = phi i32 [ 0, %17 ], [ %40, %19 ]
%24 = add <4 x i32> %20, <i32 4, i32 4, i32 4, i32 4>
%25 = mul <4 x i32> %20, %21
%26 = mul <4 x i32> %24, %22
%27 = add <4 x i32> %20, <i32 8, i32 8, i32 8, i32 8>
%28 = add <4 x i32> %20, <i32 12, i32 12, i32 12, i32 12>
%29 = mul <4 x i32> %27, %25
%30 = mul <4 x i32> %28, %26
%31 = add <4 x i32> %20, <i32 16, i32 16, i32 16, i32 16>
%32 = add <4 x i32> %20, <i32 20, i32 20, i32 20, i32 20>
%33 = mul <4 x i32> %31, %29
%34 = mul <4 x i32> %32, %30
%35 = add <4 x i32> %20, <i32 24, i32 24, i32 24, i32 24>
%36 = add <4 x i32> %20, <i32 28, i32 28, i32 28, i32 28>
%37 = mul <4 x i32> %35, %33
%38 = mul <4 x i32> %36, %34
%39 = add <4 x i32> %20, <i32 32, i32 32, i32 32, i32 32>
%40 = add i32 %23, 4
%41 = icmp eq i32 %40, %18
br i1 %41, label %42, label %19
42: ; preds = %19, %9
%43 = phi <4 x i32> [ undef, %9 ], [ %37, %19 ]
%44 = phi <4 x i32> [ undef, %9 ], [ %38, %19 ]
%45 = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %9 ], [ %39, %19 ]
%46 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %9 ], [ %37, %19 ]
%47 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %9 ], [ %38, %19 ]
%48 = icmp eq i32 %15, 0
br i1 %48, label %60, label %49
49: ; preds = %42, %49
%50 = phi <4 x i32> [ %57, %49 ], [ %45, %42 ]
%51 = phi <4 x i32> [ %55, %49 ], [ %46, %42 ]
%52 = phi <4 x i32> [ %56, %49 ], [ %47, %42 ]
%53 = phi i32 [ %58, %49 ], [ 0, %42 ]
%54 = add <4 x i32> %50, <i32 4, i32 4, i32 4, i32 4>
%55 = mul <4 x i32> %50, %51
%56 = mul <4 x i32> %54, %52
%57 = add <4 x i32> %50, <i32 8, i32 8, i32 8, i32 8>
%58 = add i32 %53, 1
%59 = icmp eq i32 %58, %15
br i1 %59, label %60, label %49
60: ; preds = %49, %42
%61 = phi <4 x i32> [ %43, %42 ], [ %55, %49 ]
%62 = phi <4 x i32> [ %44, %42 ], [ %56, %49 ]
%63 = mul <4 x i32> %62, %61
%64 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %63)
%65 = icmp eq i32 %5, %10
br i1 %65, label %69, label %66
66: ; preds = %7, %60
%67 = phi i32 [ 1, %7 ], [ %11, %60 ]
%68 = phi i32 [ 1, %7 ], [ %64, %60 ]
br label %72
69: ; preds = %72, %60, %0
%70 = phi i32 [ 1, %0 ], [ %64, %60 ], [ %75, %72 ]
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %70)
ret i32 0
72: ; preds = %66, %72
%73 = phi i32 [ %76, %72 ], [ %67, %66 ]
%74 = phi i32 [ %75, %72 ], [ %68, %66 ]
%75 = mul nsw i32 %73, %74
%76 = add nuw i32 %73, 1
%77 = icmp eq i32 %73, %5
br i1 %77, label %69, label %72
}