#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*/ annee_est_bissextile(int);
int /*<<< orphan*/ printf(char *, int);
int jours_par_mois(int mois, int annee) {
  switch (mois) {
  case 4:
  case 6:
  case 9:
  case 11:
    return 30;
  case 1:
  case 3:
  case 5:
  case 7:
  case 8:
  case 10:
  case 12:
    return 31;
  case 2:
    return annee_est_bissextile(annee) ? 29 : 28;
  default:
    printf("Erreur: je ne connais pas le mois #%d\n", mois);
    return -1;
  }
}


x86 assembly (clang, -O0):
<jours_par_mois>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     11fb <jours_par_mois+0xdb>
jmp    1142 <jours_par_mois+0x22>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1207 <jours_par_mois+0xe7>
jmp    1153 <jours_par_mois+0x33>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     11fb <jours_par_mois+0xdb>
jmp    1164 <jours_par_mois+0x44>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     11ef <jours_par_mois+0xcf>
jmp    1175 <jours_par_mois+0x55>
mov    -0x10(%rbp),%eax
sub    $0x5,%eax
je     11fb <jours_par_mois+0xdb>
jmp    1186 <jours_par_mois+0x66>
mov    -0x10(%rbp),%eax
sub    $0x6,%eax
je     11ef <jours_par_mois+0xcf>
jmp    1197 <jours_par_mois+0x77>
mov    -0x10(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x2,%eax
jb     11fb <jours_par_mois+0xdb>
jmp    11ab <jours_par_mois+0x8b>
mov    -0x10(%rbp),%eax
sub    $0x9,%eax
je     11ef <jours_par_mois+0xcf>
jmp    11bc <jours_par_mois+0x9c>
mov    -0x10(%rbp),%eax
sub    $0xa,%eax
je     11fb <jours_par_mois+0xdb>
jmp    11cd <jours_par_mois+0xad>
mov    -0x10(%rbp),%eax
sub    $0xb,%eax
je     11ef <jours_par_mois+0xcf>
jmp    11de <jours_par_mois+0xbe>
mov    -0x10(%rbp),%eax
sub    $0xc,%eax
je     11fb <jours_par_mois+0xdb>
jmp    1229 <jours_par_mois+0x109>
movl   $0x1e,-0x4(%rbp)
jmp    123f <jours_par_mois+0x11f>
movl   $0x1f,-0x4(%rbp)
jmp    123f <jours_par_mois+0x11f>
mov    -0xc(%rbp),%edi
call   1040 <annee_est_bissextile@plt>
mov    %eax,%edx
mov    $0x1c,%eax
mov    $0x1d,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    123f <jours_par_mois+0x11f>
mov    -0x8(%rbp),%esi
lea    0xdcd(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jours_par_mois>:
push   %rax
mov    %edi,%ecx
cmp    $0xc,%edi
ja     1163 <jours_par_mois+0x43>
mov    $0x15aa,%eax
bt     %ecx,%eax
jae    1139 <jours_par_mois+0x19>
mov    $0x1f,%eax
pop    %rcx
ret
mov    $0x1e,%eax
mov    $0xa50,%edx
bt     %ecx,%edx
jae    114a <jours_par_mois+0x2a>
pop    %rcx
ret
cmp    $0x2,%ecx
jne    1163 <jours_par_mois+0x43>
mov    %esi,%edi
call   1040 <annee_est_bissextile@plt>
cmp    $0x1,%eax
mov    $0x1d,%eax
sbb    $0x0,%eax
pop    %rcx
ret
lea    0xe96(%rip),%rdi
mov    %ecx,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Erreur: je ne connais pas le mois #%d\0A\00"
define i32 @jours_par_mois(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 %15 [
i32 4, label %7
i32 6, label %7
i32 9, label %7
i32 11, 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 2, label %9
]
7: ; preds = %2, %2, %2, %2
store i32 30, i32* %3
br label %18
8: ; preds = %2, %2, %2, %2, %2, %2, %2
store i32 31, i32* %3
br label %18
9: ; preds = %2
%10 = load i32, i32* %5
%11 = call i32 @annee_est_bissextile(i32 %10)
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 29, i32 28
store i32 %14, i32* %3
br label %18
15: ; preds = %2
%16 = load i32, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %16)
store i32 -1, i32* %3
br label %18
18: ; preds = %15, %9, %8, %7
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [39 x i8] c"Erreur: je ne connais pas le mois #%d\0A\00"
define i32 @jours_par_mois(i32 %0, i32 %1) {
switch i32 %0, label %8 [
i32 4, label %10
i32 6, label %10
i32 9, label %10
i32 11, label %10
i32 1, label %3
i32 3, label %3
i32 5, label %3
i32 7, label %3
i32 8, label %3
i32 10, label %3
i32 12, label %3
i32 2, label %4
]
3: ; preds = %2, %2, %2, %2, %2, %2, %2
br label %10
4: ; preds = %2
%5 = tail call i32 @annee_est_bissextile(i32 %1)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 28, i32 29
br label %10
8: ; preds = %2
%9 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %10
10: ; preds = %2, %2, %2, %2, %8, %4, %3
%11 = phi i32 [ -1, %8 ], [ %7, %4 ], [ 31, %3 ], [ 30, %2 ], [ 30, %2 ], [ 30, %2 ], [ 30, %2 ]
ret i32 %11
}