#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 argc, char const *argv[]) {
  int a = 0;
  printf("a=");
  scanf("%d", &a);
  if (a < 4) {
    printf("Error: \"a\" must be >= 4\n");
  } else {
    int t = 1;
    for (int i = a; i > a - 4; i--) {
      t *= i;
    }
    printf("%d\n", t);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x4,-0x14(%rbp)
jge    1178 <main+0x58>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bf <main+0x9f>
movl   $0x1,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x4,%ecx
cmp    %ecx,%eax
jle    11ae <main+0x8e>
mov    -0x1c(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1185 <main+0x65>
mov    -0x18(%rbp),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xf60(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf55(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x4,%eax
jge    1172 <main+0x42>
lea    0xf42(%rip),%rdi
call   1030 <puts@plt>
jmp    133a <main+0x20a>
lea    -0x3(%rax),%ecx
cmp    %ecx,%eax
mov    %ecx,%edx
cmovl  %eax,%edx
neg    %edx
add    %eax,%edx
add    $0x1,%edx
mov    $0x1,%esi
cmp    $0x8,%edx
jb     1320 <main+0x1f0>
mov    %edx,%edi
and    $0xfffffff8,%edi
movd   %eax,%xmm0
sub    %edi,%eax
pshufd $0x0,%xmm0,%xmm4
paddd  0xe57(%rip),%xmm4
movdqa 0xe5f(%rip),%xmm6
movdqa 0xe76(%rip),%xmm9
movdqa 0xe7d(%rip),%xmm10
movdqa 0xe84(%rip),%xmm11
movdqa 0xe8b(%rip),%xmm12
movdqa 0xe92(%rip),%xmm13
movdqa 0xe99(%rip),%xmm14
movdqa 0xea0(%rip),%xmm15
mov    %edi,%esi
movdqa %xmm6,%xmm3
cs nopw 0x0(%rax,%rax,1)
movdqa %xmm4,%xmm0
paddd  0xe14(%rip),%xmm0
pshufd $0xf5,%xmm6,%xmm5
pshufd $0xf5,%xmm4,%xmm7
pmuludq %xmm5,%xmm7
pmuludq %xmm4,%xmm6
pshufd $0xf5,%xmm3,%xmm5
pshufd $0xf5,%xmm0,%xmm1
pmuludq %xmm5,%xmm1
pmuludq %xmm3,%xmm0
movdqa %xmm4,%xmm3
paddd  %xmm9,%xmm3
movdqa %xmm4,%xmm5
paddd  %xmm10,%xmm5
pmuludq %xmm3,%xmm6
pshufd $0xf5,%xmm3,%xmm3
pmuludq %xmm7,%xmm3
pmuludq %xmm5,%xmm0
pshufd $0xf5,%xmm5,%xmm5
pmuludq %xmm1,%xmm5
movdqa %xmm4,%xmm1
paddd  %xmm11,%xmm1
movdqa %xmm4,%xmm7
paddd  %xmm12,%xmm7
pshufd $0xf5,%xmm1,%xmm2
pmuludq %xmm3,%xmm2
pmuludq %xmm6,%xmm1
pshufd $0xf5,%xmm7,%xmm8
pmuludq %xmm5,%xmm8
pmuludq %xmm0,%xmm7
movdqa %xmm4,%xmm0
paddd  %xmm13,%xmm0
movdqa %xmm4,%xmm5
paddd  %xmm14,%xmm5
pmuludq %xmm0,%xmm1
pshufd $0xe8,%xmm1,%xmm6
pshufd $0xf5,%xmm0,%xmm0
pmuludq %xmm2,%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm6
pmuludq %xmm5,%xmm7
pshufd $0xe8,%xmm7,%xmm3
pshufd $0xf5,%xmm5,%xmm0
pmuludq %xmm8,%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm3
paddd  %xmm15,%xmm4
add    $0xffffffe0,%esi
jne    1200 <main+0xd0>
pshufd $0xf5,%xmm6,%xmm0
pshufd $0xf5,%xmm3,%xmm1
pmuludq %xmm0,%xmm1
pmuludq %xmm6,%xmm3
pshufd $0xee,%xmm3,%xmm0
pmuludq %xmm3,%xmm0
pshufd $0xaa,%xmm1,%xmm2
pmuludq %xmm1,%xmm2
pmuludq %xmm0,%xmm2
movd   %xmm2,%esi
cmp    %edi,%edx
je     132c <main+0x1fc>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %eax,%esi
lea    -0x1(%rax),%edx
cmp    %ecx,%eax
mov    %edx,%eax
jg     1320 <main+0x1f0>
lea    0xd73(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"a=\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Error: \22a\22 must be >= 4\0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, 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 = load i32, i32* %6
%12 = icmp slt i32 %11, 4
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %32
15: ; preds = %2
store i32 1, i32* %7
%16 = load i32, i32* %6
store i32 %16, i32* %8
br label %17
17: ; preds = %26, %15
%18 = load i32, i32* %8
%19 = load i32, i32* %6
%20 = sub nsw i32 %19, 4
%21 = icmp sgt i32 %18, %20
br i1 %21, label %22, label %29
22: ; preds = %17
%23 = load i32, i32* %8
%24 = load i32, i32* %7
%25 = mul nsw i32 %24, %23
store i32 %25, i32* %7
br label %26
26: ; preds = %22
%27 = load i32, i32* %8
%28 = add nsw i32 %27, -1
store i32 %28, i32* %8
br label %17
29: ; preds = %17
%30 = load i32, i32* %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %29, %13
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"a=\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@str = [24 x i8] c"Error: \22a\22 must be >= 4\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 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* %3)
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 4
br i1 %8, label %51, label %9
9: ; preds = %2
%10 = add i32 %7, -3
%11 = add i32 %7, 1
%12 = call i32 @llvm.smin.i32(i32 %7, i32 %10)
%13 = sub i32 %11, %12
%14 = icmp ult i32 %13, 8
br i1 %14, label %48, label %15
15: ; preds = %9
%16 = and i32 %13, -8
%17 = sub i32 %7, %16
%18 = insertelement <4 x i32> poison, i32 %7, i64 0
%19 = shufflevector <4 x i32> %18, <4 x i32> poison, <4 x i32> zeroinitializer
%20 = add <4 x i32> %19, <i32 0, i32 -1, i32 -2, i32 -3>
br label %21
21: ; preds = %21, %15
%22 = phi i32 [ 0, %15 ], [ %41, %21 ]
%23 = phi <4 x i32> [ %20, %15 ], [ %42, %21 ]
%24 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %15 ], [ %39, %21 ]
%25 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %15 ], [ %40, %21 ]
%26 = add <4 x i32> %23, <i32 -4, i32 -4, i32 -4, i32 -4>
%27 = mul <4 x i32> %23, %24
%28 = mul <4 x i32> %26, %25
%29 = add <4 x i32> %23, <i32 -8, i32 -8, i32 -8, i32 -8>
%30 = add <4 x i32> %23, <i32 -12, i32 -12, i32 -12, i32 -12>
%31 = mul <4 x i32> %29, %27
%32 = mul <4 x i32> %30, %28
%33 = add <4 x i32> %23, <i32 -16, i32 -16, i32 -16, i32 -16>
%34 = add <4 x i32> %23, <i32 -20, i32 -20, i32 -20, i32 -20>
%35 = mul <4 x i32> %33, %31
%36 = mul <4 x i32> %34, %32
%37 = add <4 x i32> %23, <i32 -24, i32 -24, i32 -24, i32 -24>
%38 = add <4 x i32> %23, <i32 -28, i32 -28, i32 -28, i32 -28>
%39 = mul <4 x i32> %37, %35
%40 = mul <4 x i32> %38, %36
%41 = add nuw i32 %22, 32
%42 = add <4 x i32> %23, <i32 -32, i32 -32, i32 -32, i32 -32>
%43 = icmp eq i32 %41, %16
br i1 %43, label %44, label %21
44: ; preds = %21
%45 = mul <4 x i32> %40, %39
%46 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %45)
%47 = icmp eq i32 %13, %16
br i1 %47, label %53, label %48
48: ; preds = %9, %44
%49 = phi i32 [ %7, %9 ], [ %17, %44 ]
%50 = phi i32 [ 1, %9 ], [ %46, %44 ]
br label %56
51: ; preds = %2
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %62
53: ; preds = %56, %44
%54 = phi i32 [ %46, %44 ], [ %59, %56 ]
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %54)
br label %62
56: ; preds = %48, %56
%57 = phi i32 [ %60, %56 ], [ %49, %48 ]
%58 = phi i32 [ %59, %56 ], [ %50, %48 ]
%59 = mul nsw i32 %57, %58
%60 = add nsw i32 %57, -1
%61 = icmp sgt i32 %57, %10
br i1 %61, label %56, label %53
62: ; preds = %53, %51
ret i32 0
}