int pocetDniVMesici(int m, int p) {
  switch (m) {
  case 1:
  case 3:
  case 5:
  case 7:
  case 8:
  case 10:
  case 12:
    return 31;
    break;
  case 4:
  case 6:
  case 9:
  case 11:
    return 30;
    break;
  case 2:
    return p == 0 ? 28 : 29;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<pocetDniVMesici>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     11cb <pocetDniVMesici+0xcb>
jmp    111e <pocetDniVMesici+0x1e>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     11e3 <pocetDniVMesici+0xe3>
jmp    112f <pocetDniVMesici+0x2f>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     11cb <pocetDniVMesici+0xcb>
jmp    1140 <pocetDniVMesici+0x40>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     11d7 <pocetDniVMesici+0xd7>
jmp    1151 <pocetDniVMesici+0x51>
mov    -0x10(%rbp),%eax
sub    $0x5,%eax
je     11cb <pocetDniVMesici+0xcb>
jmp    1162 <pocetDniVMesici+0x62>
mov    -0x10(%rbp),%eax
sub    $0x6,%eax
je     11d7 <pocetDniVMesici+0xd7>
jmp    1173 <pocetDniVMesici+0x73>
mov    -0x10(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x2,%eax
jb     11cb <pocetDniVMesici+0xcb>
jmp    1187 <pocetDniVMesici+0x87>
mov    -0x10(%rbp),%eax
sub    $0x9,%eax
je     11d7 <pocetDniVMesici+0xd7>
jmp    1198 <pocetDniVMesici+0x98>
mov    -0x10(%rbp),%eax
sub    $0xa,%eax
je     11cb <pocetDniVMesici+0xcb>
jmp    11a9 <pocetDniVMesici+0xa9>
mov    -0x10(%rbp),%eax
sub    $0xb,%eax
je     11d7 <pocetDniVMesici+0xd7>
jmp    11ba <pocetDniVMesici+0xba>
mov    -0x10(%rbp),%eax
sub    $0xc,%eax
jne    11fe <pocetDniVMesici+0xfe>
jmp    11cb <pocetDniVMesici+0xcb>
movl   $0x1f,-0x4(%rbp)
jmp    1205 <pocetDniVMesici+0x105>
movl   $0x1e,-0x4(%rbp)
jmp    1205 <pocetDniVMesici+0x105>
mov    -0xc(%rbp),%edx
mov    $0x1d,%eax
mov    $0x1c,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1205 <pocetDniVMesici+0x105>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pocetDniVMesici>:
cmp    $0xc,%edi
ja     1136 <pocetDniVMesici+0x36>
mov    $0x1f,%eax
mov    $0x15aa,%ecx
bt     %edi,%ecx
jae    1115 <pocetDniVMesici+0x15>
ret
mov    $0xa50,%eax
bt     %edi,%eax
jae    1125 <pocetDniVMesici+0x25>
mov    $0x1e,%eax
ret
cmp    $0x2,%edi
jne    1136 <pocetDniVMesici+0x36>
cmp    $0x1,%esi
mov    $0x1d,%eax
sbb    $0x0,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @pocetDniVMesici(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
switch i32 %6, label %14 [
i32 1, label %7
i32 3, label %7
i32 5, label %7
i32 7, label %7
i32 8, label %7
i32 10, label %7
i32 12, label %7
i32 4, label %8
i32 6, label %8
i32 9, label %8
i32 11, label %8
i32 2, label %9
]
7: ; preds = %2, %2, %2, %2, %2, %2, %2
store i32 31, i32* %3
br label %15
8: ; preds = %2, %2, %2, %2
store i32 30, i32* %3
br label %15
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 28, i32 29
store i32 %13, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %9, %8, %7
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @pocetDniVMesici(i32 %0, i32 %1) {
switch i32 %0, label %7 [
i32 1, label %8
i32 3, label %8
i32 5, label %8
i32 7, label %8
i32 8, label %8
i32 10, label %8
i32 12, label %8
i32 4, label %3
i32 6, label %3
i32 9, label %3
i32 11, label %3
i32 2, label %4
]
3: ; preds = %2, %2, %2, %2
br label %8
4: ; preds = %2
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i32 28, i32 29
br label %8
7: ; preds = %2
br label %8
8: ; preds = %2, %2, %2, %2, %2, %2, %2, %7, %4, %3
%9 = phi i32 [ 0, %7 ], [ %6, %4 ], [ 30, %3 ], [ 31, %2 ], [ 31, %2 ], [ 31, %2 ], [ 31, %2 ], [ 31, %2 ], [ 31, %2 ], [ 31, %2 ]
ret i32 %9
}