#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 cale(int *month, int *day) {
  int d[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  char *mon[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
                 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
  if (1 <= *month && *month <= 12 && 1 <= *day && *day <= d[*month - 1]) {
    printf("your birthday is %s.%d.\n", mon[*month - 1], *day);
    return 0;
  } else {
    printf("Error : strange data was enterd.\n");
    return -1;
  }
}


x86 assembly (clang, -O0):
<cale>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xec2(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    0x2c6a(%rip),%rsi
mov    $0x60,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rcx
mov    $0x1,%eax
cmp    (%rcx),%eax
jg     11de <cale+0xbe>
mov    -0x10(%rbp),%rax
cmpl   $0xc,(%rax)
jg     11de <cale+0xbe>
mov    -0x18(%rbp),%rcx
mov    $0x1,%eax
cmp    (%rcx),%eax
jg     11de <cale+0xbe>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x50(%rbp,%rcx,4),%eax
jg     11de <cale+0xbe>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
cltq
mov    -0xb0(%rbp,%rax,8),%rsi
ff
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11f3 <cale+0xd3>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cale>:
push   %rbx
mov    (%rdi),%eax
add    $0xffffffff,%eax
cmp    $0xb,%eax
ja     113f <cale+0x1f>
mov    (%rsi),%edx
test   %edx,%edx
jle    113f <cale+0x1f>
mov    %eax,%eax
lea    0xec6(%rip),%rcx
cmp    (%rcx,%rax,4),%edx
jle    1154 <cale+0x34>
lea    0xf63(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
lea    0xf27(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1150 <cale+0x30>

LLVM IR (-O0):
@__const.cale.d = [12 x i32] [i32 31, i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
@.str = [4 x i8] c"Jan\00"
@.str.1 = [4 x i8] c"Feb\00"
@.str.2 = [4 x i8] c"Mar\00"
@.str.3 = [4 x i8] c"Apr\00"
@.str.4 = [4 x i8] c"May\00"
@.str.5 = [4 x i8] c"Jun\00"
@.str.6 = [4 x i8] c"Jul\00"
@.str.7 = [4 x i8] c"Aug\00"
@.str.8 = [4 x i8] c"Sep\00"
@.str.9 = [4 x i8] c"Oct\00"
@.str.10 = [4 x i8] c"Nov\00"
@.str.11 = [4 x i8] c"Dec\00"
@__const.cale.mon = [12 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i32 0, i32 0)]
@.str.12 = [25 x i8] c"your birthday is %s.%d.\0A\00"
@.str.13 = [34 x i8] c"Error : strange data was enterd.\0A\00"
define i32 @cale(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca [12 x i32]
%7 = alloca [12 x i8*]
store i32* %0, i32** %4
store i32* %1, i32** %5
%8 = bitcast [12 x i32]* %6 to i8*
%9 = bitcast [12 x i8*]* %7 to i8*
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = icmp sle i32 1, %11
br i1 %12, label %13, label %41
13: ; preds = %2
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = icmp sle i32 %15, 12
br i1 %16, label %17, label %41
17: ; preds = %13
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = icmp sle i32 1, %19
br i1 %20, label %21, label %41
21: ; preds = %17
%22 = load i32*, i32** %5
%23 = load i32, i32* %22
%24 = load i32*, i32** %4
%25 = load i32, i32* %24
%26 = sub nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = icmp sle i32 %23, %29
br i1 %30, label %31, label %41
31: ; preds = %21
%32 = load i32*, i32** %4
%33 = load i32, i32* %32
%34 = sub nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [12 x i8*], [12 x i8*]* %7, i64 0, i64 %35
%37 = load i8*, i8** %36
%38 = load i32*, i32** %5
%39 = load i32, i32* %38
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), i8* %37, i32 %39)
store i32 0, i32* %3
br label %43
41: ; preds = %21, %17, %13, %2
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0))
store i32 -1, i32* %3
br label %43
43: ; preds = %41, %31
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
@__const.cale.d = [12 x i32] [i32 31, i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
@.str = [4 x i8] c"Jan\00"
@.str.1 = [4 x i8] c"Feb\00"
@.str.2 = [4 x i8] c"Mar\00"
@.str.3 = [4 x i8] c"Apr\00"
@.str.4 = [4 x i8] c"May\00"
@.str.5 = [4 x i8] c"Jun\00"
@.str.6 = [4 x i8] c"Jul\00"
@.str.7 = [4 x i8] c"Aug\00"
@.str.8 = [4 x i8] c"Sep\00"
@.str.9 = [4 x i8] c"Oct\00"
@.str.10 = [4 x i8] c"Nov\00"
@.str.11 = [4 x i8] c"Dec\00"
@reltable.cale = [12 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([12 x i32]* @reltable.cale to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.cale to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([12 x i32]* @reltable.cale to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([12 x i32]* @reltable.cale to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([12 x i32]* @reltable.cale to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.5 to i64), i64 ptrtoint ([12 x i32]* @reltable.cale to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([12 x i32]* @reltable.cale to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.7 to i64), i64 ptrtoint ([12 x i32]* @reltable.cale to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.8 to i64), i64 ptrtoint ([12 x i32]* @reltable.cale to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.9 to i64), i64 ptrtoint ([12 x i32]* @reltable.cale to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([12 x i32]* @reltable.cale to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.11 to i64), i64 ptrtoint ([12 x i32]* @reltable.cale to i64)) to i32)]
@.str.12 = [25 x i8] c"your birthday is %s.%d.\0A\00"
@str = [33 x i8] c"Error : strange data was enterd.\00"
define i32 @cale(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, -1
%5 = icmp ult i32 %4, 12
br i1 %5, label %6, label %18
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = zext i32 %4 to i64
%11 = getelementptr inbounds [12 x i32], [12 x i32]* @__const.cale.d, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = icmp sgt i32 %7, %12
br i1 %13, label %18, label %14
14: ; preds = %9
%15 = shl i64 %10, 2
%16 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.cale to i8*), i64 %15)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), i8* %16, i32 %7)
br label %20
18: ; preds = %9, %6, %2
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
%21 = phi i32 [ 0, %14 ], [ -1, %18 ]
ret i32 %21
}