#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int mes;
  int estacion;
  printf("Introduzca un mes: ");
  scanf("%d", &mes);
  while (!((mes >= 0) && (mes <= 12))) {
    printf("Introduzca un mes: ");
    scanf("%d", &mes);
  }
  if (mes != 0) {
    switch (mes) {
    case 12:
    case 1:
    case 2:
      estacion = 1;
      break;
    case 3:
    case 4:
    case 5:
      estacion = 2;
      break;
    case 6:
    case 7:
    case 8:
      estacion = 3;
      break;
    case 9:
    case 10:
    case 11:
      estacion = 4;
      break;
    }
    printf("El mes %d pertenece a la estacion %d\n", mes, estacion);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jl     1166 <main+0x46>
cmpl   $0xc,-0x8(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    1178 <main+0x58>
jmp    119b <main+0x7b>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    114d <main+0x2d>
cmpl   $0x0,-0x8(%rbp)
je     120d <main+0xed>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xb,%eax
ja     11f9 <main+0xd9>
mov    -0x18(%rbp),%rax
lea    0xe3b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0xc(%rbp)
jmp    11f9 <main+0xd9>
movl   $0x2,-0xc(%rbp)
jmp    11f9 <main+0xd9>
movl   $0x3,-0xc(%rbp)
jmp    11f9 <main+0xd9>
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xf00(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0xd,%esi
jb     118e <main+0x6e>
lea    0xed8(%rip),%r14
lea    0xee5(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0xc,%esi
ja     1170 <main+0x50>
mov    $0x1,%edx
cmp    $0xb,%esi
ja     11bd <main+0x9d>
mov    %esi,%eax
lea    0xe5f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2,%edx
jmp    11bd <main+0x9d>
mov    $0x4,%edx
jmp    11bd <main+0x9d>
mov    $0x3,%edx
lea    0xe83(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Introduzca un mes: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"El mes %d pertenece a la estacion %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 12
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
%14 = xor i1 %13, true
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %6
18: ; preds = %12
%19 = load i32, i32* %2
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %31
21: ; preds = %18
%22 = load i32, i32* %2
switch i32 %22, label %27 [
i32 12, label %23
i32 1, label %23
i32 2, label %23
i32 3, label %24
i32 4, label %24
i32 5, label %24
i32 6, label %25
i32 7, label %25
i32 8, label %25
i32 9, label %26
i32 10, label %26
i32 11, label %26
]
23: ; preds = %21, %21, %21
store i32 1, i32* %3
br label %27
24: ; preds = %21, %21, %21
store i32 2, i32* %3
br label %27
25: ; preds = %21, %21, %21
store i32 3, i32* %3
br label %27
26: ; preds = %21, %21, %21
store i32 4, i32* %3
br label %27
27: ; preds = %21, %26, %25, %24, %23
%28 = load i32, i32* %2
%29 = load i32, i32* %3
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %28, i32 %29)
br label %31
31: ; preds = %27, %18
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Introduzca un mes: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"El mes %d pertenece a la estacion %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp ugt i32 %5, 12
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp ugt i32 %10, 12
br i1 %11, label %7, label %12
12: ; preds = %7, %0
%13 = phi i32 [ %5, %0 ], [ %10, %7 ]
switch i32 %13, label %17 [
i32 0, label %20
i32 11, label %16
i32 10, label %16
i32 9, label %16
i32 3, label %14
i32 4, label %14
i32 5, label %14
i32 6, label %15
i32 7, label %15
i32 8, label %15
]
14: ; preds = %12, %12, %12
br label %17
15: ; preds = %12, %12, %12
br label %17
16: ; preds = %12, %12, %12
br label %17
17: ; preds = %12, %16, %15, %14
%18 = phi i32 [ 4, %16 ], [ 3, %15 ], [ 2, %14 ], [ 1, %12 ]
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %18)
br label %20
20: ; preds = %12, %17
ret i32 0
}