#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 Falgun(long int day, long int month, long int year) {
  long int date, bangla, leapyear;
  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
    leapyear = 29;
  else
    leapyear = 28;
  if (day <= leapyear && month < 13 && year > 1000) {
    if (day < 13) {
      bangla = year - 594;
      date = day + 18;
      printf("%ld-Magh-%ld\n", date, bangla);
    } else {
      bangla = year - 594;
      date = day - 12;
      printf("%ld-Falgun-%ld\n", date, bangla);
    }
  } else
    printf("Invalid Input.\nPlease Check Your Input..........\n");
  return 0;
}


x86 assembly (clang, -O0):
<Falgun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x4,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1154 <Falgun+0x44>
mov    -0x18(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    116c <Falgun+0x5c>
mov    -0x18(%rbp),%rax
mov    $0x190,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1179 <Falgun+0x69>
movq   $0x1d,-0x30(%rbp)
jmp    1181 <Falgun+0x71>
movq   $0x1c,-0x30(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x30(%rbp),%rax
jg     121d <Falgun+0x10d>
cmpq   $0xd,-0x10(%rbp)
jge    121d <Falgun+0x10d>
cmpq   $0x3e8,-0x18(%rbp)
jle    121d <Falgun+0x10d>
cmpq   $0xd,-0x8(%rbp)
jge    11e8 <Falgun+0xd8>
mov    -0x18(%rbp),%rax
sub    $0x252,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
add    $0x12,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1218 <Falgun+0x108>
mov    -0x18(%rbp),%rax
sub    $0x252,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
sub    $0xc,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122b <Falgun+0x11b>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Falgun>:
push   %rax
mov    %rdi,%r8
test   $0x3,%dl
sete   %r9b
movabs $0x8f5c28f5c28f5c29,%rax
28 5c 8f
imul   %rdx,%rax
movabs $0x51eb851eb851eb8,%rdi
b8 1e 05
add    %rax,%rdi
ror    $0x2,%rdi
movabs $0x28f5c28f5c28f5c,%rcx
5c 8f 02
cmp    %rcx,%rdi
seta   %dil
movabs $0x51eb851eb851eb0,%rcx
b8 1e 05
add    %rax,%rcx
ror    $0x4,%rcx
movabs $0xa3d70a3d70a3d7,%rax
cmp    %rax,%rcx
setb   %al
cmp    $0x3e9,%rdx
jl     11b7 <Falgun+0x97>
cmp    $0xc,%rsi
jg     11b7 <Falgun+0x97>
and    %dil,%r9b
or     %r9b,%al
movzbl %al,%eax
or     $0x1c,%rax
cmp    %r8,%rax
jl     11b7 <Falgun+0x97>
add    $0xfffffffffffffdae,%rdx
cmp    $0xc,%r8
jg     11c5 <Falgun+0xa5>
add    $0x12,%r8
lea    0xe4b(%rip),%rdi
jmp    11d0 <Falgun+0xb0>
lea    0xe60(%rip),%rdi
call   1030 <puts@plt>
jmp    11da <Falgun+0xba>
add    $0xfffffffffffffff4,%r8
lea    0xe3e(%rip),%rdi
mov    %r8,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%ld-Magh-%ld\0A\00"
@.str.1 = [16 x i8] c"%ld-Falgun-%ld\0A\00"
@.str.2 = [50 x i8] c"Invalid Input.\0APlease Check Your Input..........\0A\00"
define i32 @Falgun(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%10 = load i64, i64* %6
%11 = srem i64 %10, 4
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i64, i64* %6
%15 = srem i64 %14, 100
%16 = icmp ne i64 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %13, %3
%18 = load i64, i64* %6
%19 = srem i64 %18, 400
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %17, %13
store i64 29, i64* %9
br label %23
22: ; preds = %17
store i64 28, i64* %9
br label %23
23: ; preds = %22, %21
%24 = load i64, i64* %4
%25 = load i64, i64* %9
%26 = icmp sle i64 %24, %25
br i1 %26, label %27, label %53
27: ; preds = %23
%28 = load i64, i64* %5
%29 = icmp slt i64 %28, 13
br i1 %29, label %30, label %53
30: ; preds = %27
%31 = load i64, i64* %6
%32 = icmp sgt i64 %31, 1000
br i1 %32, label %33, label %53
33: ; preds = %30
%34 = load i64, i64* %4
%35 = icmp slt i64 %34, 13
br i1 %35, label %36, label %44
36: ; preds = %33
%37 = load i64, i64* %6
%38 = sub nsw i64 %37, 594
store i64 %38, i64* %8
%39 = load i64, i64* %4
%40 = add nsw i64 %39, 18
store i64 %40, i64* %7
%41 = load i64, i64* %7
%42 = load i64, i64* %8
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %41, i64 %42)
br label %52
44: ; preds = %33
%45 = load i64, i64* %6
%46 = sub nsw i64 %45, 594
store i64 %46, i64* %8
%47 = load i64, i64* %4
%48 = sub nsw i64 %47, 12
store i64 %48, i64* %7
%49 = load i64, i64* %7
%50 = load i64, i64* %8
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i64 %49, i64 %50)
br label %52
52: ; preds = %44, %36
br label %55
53: ; preds = %30, %27, %23
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
br label %55
55: ; preds = %53, %52
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"%ld-Magh-%ld\0A\00"
@.str.1 = [16 x i8] c"%ld-Falgun-%ld\0A\00"
@str = [49 x i8] c"Invalid Input.\0APlease Check Your Input..........\00"
define i32 @Falgun(i64 %0, i64 %1, i64 %2) {
%4 = and i64 %2, 3
%5 = icmp eq i64 %4, 0
%6 = srem i64 %2, 100
%7 = icmp ne i64 %6, 0
%8 = and i1 %5, %7
%9 = srem i64 %2, 400
%10 = icmp eq i64 %9, 0
%11 = or i1 %10, %8
%12 = select i1 %11, i64 29, i64 28
%13 = icmp sge i64 %12, %0
%14 = icmp slt i64 %1, 13
%15 = and i1 %14, %13
%16 = icmp sgt i64 %2, 1000
%17 = and i1 %16, %15
br i1 %17, label %18, label %27
18: ; preds = %3
%19 = icmp slt i64 %0, 13
%20 = add nsw i64 %2, -594
br i1 %19, label %21, label %24
21: ; preds = %18
%22 = add nsw i64 %0, 18
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %22, i64 %20)
br label %29
24: ; preds = %18
%25 = add nsw i64 %0, -12
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i64 %25, i64 %20)
br label %29
27: ; preds = %3
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
br label %29
29: ; preds = %21, %24, %27
ret i32 0
}