#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 fb_hTimeLeap(int);
int fb_hTimeDaysInMonth(int month, int year) {
  static const int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  ((void)0);
  if (month == 2)
    return days[month - 1] + fb_hTimeLeap(year);
  return days[month - 1];
}


x86 assembly (clang, -O0):
<fb_hTimeDaysInMonth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1155 <fb_hTimeDaysInMonth+0x45>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0xec8(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <fb_hTimeLeap@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <fb_hTimeDaysInMonth+0x5b>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0xe9b(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_hTimeDaysInMonth>:
push   %rax
cmp    $0x2,%edi
jne    1122 <fb_hTimeDaysInMonth+0x12>
mov    %esi,%edi
call   1030 <fb_hTimeLeap@plt>
add    $0x1c,%eax
pop    %rcx
ret
movslq %edi,%rax
lea    0xed4(%rip),%rcx
mov    -0x4(%rcx,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
@fb_hTimeDaysInMonth.days = internal constant [12 x i32] [i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
define i32 @fb_hTimeDaysInMonth(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [12 x i32], [12 x i32]* @fb_hTimeDaysInMonth.days, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %5
%15 = call i32 @fb_hTimeLeap(i32 %14)
%16 = add nsw i32 %13, %15
store i32 %16, i32* %3
br label %23
17: ; preds = %2
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [12 x i32], [12 x i32]* @fb_hTimeDaysInMonth.days, i64 0, i64 %20
%22 = load i32, i32* %21
store i32 %22, i32* %3
br label %23
23: ; preds = %17, %8
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@fb_hTimeDaysInMonth.days = internal unnamed_addr constant [12 x i32] [i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
define i32 @fb_hTimeDaysInMonth(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @fb_hTimeLeap(i32 %1)
%6 = add nsw i32 %5, 28
br label %12
7: ; preds = %2
%8 = add nsw i32 %0, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [12 x i32], [12 x i32]* @fb_hTimeDaysInMonth.days, i64 0, i64 %9
%11 = load i32, i32* %10
br label %12
12: ; preds = %7, %4
%13 = phi i32 [ %6, %4 ], [ %11, %7 ]
ret i32 %13
}