int main() {
  int mm, dd, count[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  scanf("%d %d", &mm, &dd),
      printf("%s!", (1 <= mm && mm <= 12 && 1 <= dd && dd <= count[mm])
                        ? "OK"
                        : "BAD");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x34,%edx
call   1040 <memcpy@plt>
lea    0xed9(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
xor    %eax,%eax
mov    $0x1,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0x41(%rbp)
jg     11b0 <main+0x80>
xor    %eax,%eax
cmpl   $0xc,-0x8(%rbp)
mov    %al,-0x41(%rbp)
jg     11b0 <main+0x80>
xor    %eax,%eax
mov    $0x1,%ecx
cmp    -0xc(%rbp),%ecx
mov    %al,-0x41(%rbp)
jg     11b0 <main+0x80>
mov    -0xc(%rbp),%eax
movslq -0x8(%rbp),%rcx
cmp    -0x40(%rbp,%rcx,4),%eax
setle  %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%cl
lea    0xe87(%rip),%rsi
lea    0xe7d(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rsi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf0c(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
lea    0xefc(%rip),%rsi
cmp    $0xb,%ecx
ja     116d <main+0x4d>
mov    (%rsp),%ecx
test   %ecx,%ecx
jle    116d <main+0x4d>
lea    0xea8(%rip),%rdx
cmp    (%rdx,%rax,4),%ecx
lea    0xedf(%rip),%rax
lea    0xed5(%rip),%rsi
cmovg  %rax,%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.count = [13 x i32] [i32 0, i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%s!\00"
@.str.2 = [3 x i8] c"OK\00"
@.str.3 = [4 x i8] c"BAD\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [13 x i32]
store i32 0, i32* %1
%5 = bitcast [13 x i32]* %4 to i8*
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = icmp sle i32 1, %7
br i1 %8, label %9, label %22
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 12
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sle i32 1, %13
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [13 x i32], [13 x i32]* %4, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = icmp sle i32 %16, %20
br label %22
22: ; preds = %15, %12, %9, %0
%23 = phi i1 [ false, %12 ], [ false, %9 ], [ false, %0 ], [ %21, %15 ]
%24 = zext i1 %23 to i64
%25 = select i1 %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %25)
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@__const.main.count = [13 x i32] [i32 0, i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%s!\00"
@.str.2 = [3 x i8] c"OK\00"
@.str.3 = [4 x i8] c"BAD\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = add i32 %6, -1
%8 = icmp ult i32 %7, 12
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
%11 = select i1 %8, i1 %10, i1 false
br i1 %11, label %12, label %18
12: ; preds = %0
%13 = zext i32 %6 to i64
%14 = getelementptr inbounds [13 x i32], [13 x i32]* @__const.main.count, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = icmp sgt i32 %9, %15
%17 = select i1 %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
br label %18
18: ; preds = %12, %0
%19 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %0 ], [ %17, %12 ]
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %19)
ret i32 0
}