#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() {
  long f = 1;
  int i, num, min, max;
  printf("Enter the minimum range: ");
  scanf("%d", &min);
  printf("Enter the maximum range: ");
  scanf("%d", &max);
  printf("Factorial series in given range: ");
  for (num = min; num <= max; num++) {
    f = 1;
    for (i = 1; i <= num; i++)
      f = f * i;
    printf("%ld ", f);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     11ec <main+0xcc>
movq   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     11cc <main+0xac>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a2 <main+0x82>
mov    -0x10(%rbp),%rsi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1187 <main+0x67>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%ebx
cmp    0x8(%rsp),%ebx
jle    1190 <main+0x70>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x1(%rbx),%r15d
lea    0xebe(%rip),%r14
mov    %r15d,%r12d
xor    %ebp,%ebp
jmp    11d1 <main+0xb1>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1(%rbx),%eax
add    $0x1,%ebp
add    $0x1,%r12d
cmp    0x8(%rsp),%ebx
mov    %eax,%ebx
jge    1181 <main+0x61>
test   %ebx,%ebx
jle    11b0 <main+0x90>
lea    (%r15,%rbp,1),%edx
lea    -0x1(%rdx),%r8
add    $0xfffffffffffffffe,%rdx
mov    $0x1,%eax
mov    $0x1,%esi
cmp    $0x7,%rdx
jb     1262 <main+0x142>
mov    %r12d,%edx
add    $0xffffffffffffffff,%rdx
and    $0xfffffffffffffff8,%rdx
neg    %rdx
mov    $0x1,%esi
mov    $0x8,%eax
nopl   0x0(%rax)
lea    -0x7(%rax),%rdi
imul   %rsi,%rdi
lea    -0x6(%rax),%rsi
lea    -0x5(%rax),%rcx
imul   %rcx,%rsi
imul   %rdi,%rsi
lea    -0x4(%rax),%rcx
lea    -0x3(%rax),%rdi
imul   %rdi,%rcx
lea    -0x2(%rax),%rdi
imul   %rcx,%rdi
imul   %rsi,%rdi
lea    -0x1(%rax),%rsi
imul   %rax,%rsi
imul   %rdi,%rsi
lea    (%rdx,%rax,1),%rcx
add    $0x8,%rcx
add    $0x8,%rax
cmp    $0x8,%rcx
jne    1210 <main+0xf0>
add    $0xfffffffffffffff9,%rax
test   $0x7,%r8b
je     11b5 <main+0x95>
mov    %ebx,%ecx
and    $0x7,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %rax,%rsi
add    $0x1,%rax
add    $0xffffffffffffffff,%rcx
jne    1280 <main+0x160>
jmp    11b5 <main+0x95>

LLVM IR (-O0):
@.str = [26 x i8] c"Enter the minimum range: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"Enter the maximum range: \00"
@.str.3 = [34 x i8] c"Factorial series in given range: \00"
@.str.4 = [5 x i8] c"%ld \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i64 1, i64* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32, i32* %5
store i32 %12, i32* %4
br label %13
13: ; preds = %33, %0
%14 = load i32, i32* %4
%15 = load i32, i32* %6
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %36
17: ; preds = %13
store i64 1, i64* %2
store i32 1, i32* %3
br label %18
18: ; preds = %27, %17
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = icmp sle i32 %19, %20
br i1 %21, label %22, label %30
22: ; preds = %18
%23 = load i64, i64* %2
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = mul nsw i64 %23, %25
store i64 %26, i64* %2
br label %27
27: ; preds = %22
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %18
30: ; preds = %18
%31 = load i64, i64* %2
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 %31)
br label %33
33: ; preds = %30
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %13
36: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Enter the minimum range: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"Enter the maximum range: \00"
@.str.3 = [34 x i8] c"Factorial series in given range: \00"
@.str.4 = [5 x i8] c"%ld \00"
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 ([26 x i8], [26 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* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = icmp sgt i32 %10, %11
br i1 %12, label %70, label %13
13: ; preds = %0
%14 = add i32 %10, 1
br label %15
15: ; preds = %13, %63
%16 = phi i32 [ 0, %13 ], [ %69, %63 ]
%17 = phi i32 [ %10, %13 ], [ %66, %63 ]
%18 = add i32 %14, %16
%19 = zext i32 %18 to i64
%20 = add nsw i64 %19, -1
%21 = icmp slt i32 %17, 1
br i1 %21, label %63, label %22
22: ; preds = %15
%23 = add nsw i64 %19, -2
%24 = and i64 %20, 7
%25 = icmp ult i64 %23, 7
br i1 %25, label %50, label %26
26: ; preds = %22
%27 = and i64 %20, -8
br label %28
28: ; preds = %28, %26
%29 = phi i64 [ 1, %26 ], [ %47, %28 ]
%30 = phi i64 [ 1, %26 ], [ %46, %28 ]
%31 = phi i64 [ 0, %26 ], [ %48, %28 ]
%32 = mul nsw i64 %30, %29
%33 = add nuw nsw i64 %29, 1
%34 = mul nsw i64 %32, %33
%35 = add nuw nsw i64 %29, 2
%36 = mul nsw i64 %34, %35
%37 = add nuw nsw i64 %29, 3
%38 = mul nsw i64 %36, %37
%39 = add nuw nsw i64 %29, 4
%40 = mul nsw i64 %38, %39
%41 = add nuw nsw i64 %29, 5
%42 = mul nsw i64 %40, %41
%43 = add nuw nsw i64 %29, 6
%44 = mul nsw i64 %42, %43
%45 = add nuw nsw i64 %29, 7
%46 = mul nsw i64 %44, %45
%47 = add nuw nsw i64 %29, 8
%48 = add i64 %31, 8
%49 = icmp eq i64 %48, %27
br i1 %49, label %50, label %28
50: ; preds = %28, %22
%51 = phi i64 [ undef, %22 ], [ %46, %28 ]
%52 = phi i64 [ 1, %22 ], [ %47, %28 ]
%53 = phi i64 [ 1, %22 ], [ %46, %28 ]
%54 = icmp eq i64 %24, 0
br i1 %54, label %63, label %55
55: ; preds = %50, %55
%56 = phi i64 [ %60, %55 ], [ %52, %50 ]
%57 = phi i64 [ %59, %55 ], [ %53, %50 ]
%58 = phi i64 [ %61, %55 ], [ 0, %50 ]
%59 = mul nsw i64 %57, %56
%60 = add nuw nsw i64 %56, 1
%61 = add i64 %58, 1
%62 = icmp eq i64 %61, %24
br i1 %62, label %63, label %55
63: ; preds = %50, %55, %15
%64 = phi i64 [ 1, %15 ], [ %51, %50 ], [ %59, %55 ]
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 %64)
%66 = add nsw i32 %17, 1
%67 = load i32, i32* %2
%68 = icmp slt i32 %17, %67
%69 = add i32 %16, 1
br i1 %68, label %15, label %70
70: ; preds = %63, %0
ret i32 0
}