#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) {
    if (mes == 12 || mes == 1 || mes == 2)
      estacion = 1;
    else if (mes == 3 || mes == 4 || mes == 5)
      estacion = 2;
    else if (mes == 6 || mes == 7 || mes == 8)
      estacion = 3;
    else if (mes == 9 || mes == 10 || mes == 11)
      estacion = 4;
    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    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%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    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe87(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    114d <main+0x2d>
cmpl   $0x0,-0x8(%rbp)
je     126b <main+0x14b>
cmpl   $0xc,-0x8(%rbp)
je     11c3 <main+0xa3>
cmpl   $0x1,-0x8(%rbp)
je     11c3 <main+0xa3>
cmpl   $0x2,-0x8(%rbp)
jne    11cf <main+0xaf>
movl   $0x1,-0xc(%rbp)
jmp    1257 <main+0x137>
cmpl   $0x3,-0x8(%rbp)
je     11ed <main+0xcd>
cmpl   $0x4,-0x8(%rbp)
je     11ed <main+0xcd>
cmpl   $0x5,-0x8(%rbp)
jne    11f9 <main+0xd9>
movl   $0x2,-0xc(%rbp)
jmp    1252 <main+0x132>
cmpl   $0x6,-0x8(%rbp)
je     1217 <main+0xf7>
cmpl   $0x7,-0x8(%rbp)
je     1217 <main+0xf7>
cmpl   $0x8,-0x8(%rbp)
jne    1223 <main+0x103>
movl   $0x3,-0xc(%rbp)
jmp    124d <main+0x12d>
cmpl   $0x9,-0x8(%rbp)
je     1241 <main+0x121>
cmpl   $0xa,-0x8(%rbp)
je     1241 <main+0x121>
cmpl   $0xb,-0x8(%rbp)
jne    1248 <main+0x128>
movl   $0x4,-0xc(%rbp)
jmp    124d <main+0x12d>
jmp    1252 <main+0x132>
jmp    1257 <main+0x137>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0xd,%esi
jb     118e <main+0x6e>
lea    0xea8(%rip),%r14
lea    0xeb5(%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
lea    -0x1(%rsi),%eax
cmp    $0x2,%eax
jb     11bf <main+0x9f>
test   %esi,%esi
je     11cd <main+0xad>
cmp    $0xc,%esi
je     11bf <main+0x9f>
lea    -0x3(%rsi),%eax
mov    $0x2,%edx
cmp    $0x3,%eax
jb     11bf <main+0x9f>
lea    -0x6(%rsi),%eax
cmp    $0x3,%eax
mov    $0x4,%edx
sbb    $0x0,%edx
lea    0xe51(%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 %68
21: ; preds = %18
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 12
br i1 %23, label %30, label %24
24: ; preds = %21
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 1
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load i32, i32* %2
%29 = icmp eq i32 %28, 2
br i1 %29, label %30, label %31
30: ; preds = %27, %24, %21
store i32 1, i32* %3
br label %64
31: ; preds = %27
%32 = load i32, i32* %2
%33 = icmp eq i32 %32, 3
br i1 %33, label %40, label %34
34: ; preds = %31
%35 = load i32, i32* %2
%36 = icmp eq i32 %35, 4
br i1 %36, label %40, label %37
37: ; preds = %34
%38 = load i32, i32* %2
%39 = icmp eq i32 %38, 5
br i1 %39, label %40, label %41
40: ; preds = %37, %34, %31
store i32 2, i32* %3
br label %63
41: ; preds = %37
%42 = load i32, i32* %2
%43 = icmp eq i32 %42, 6
br i1 %43, label %50, label %44
44: ; preds = %41
%45 = load i32, i32* %2
%46 = icmp eq i32 %45, 7
br i1 %46, label %50, label %47
47: ; preds = %44
%48 = load i32, i32* %2
%49 = icmp eq i32 %48, 8
br i1 %49, label %50, label %51
50: ; preds = %47, %44, %41
store i32 3, i32* %3
br label %62
51: ; preds = %47
%52 = load i32, i32* %2
%53 = icmp eq i32 %52, 9
br i1 %53, label %60, label %54
54: ; preds = %51
%55 = load i32, i32* %2
%56 = icmp eq i32 %55, 10
br i1 %56, label %60, label %57
57: ; preds = %54
%58 = load i32, i32* %2
%59 = icmp eq i32 %58, 11
br i1 %59, label %60, label %61
60: ; preds = %57, %54, %51
store i32 4, i32* %3
br label %61
61: ; preds = %60, %57
br label %62
62: ; preds = %61, %50
br label %63
63: ; preds = %62, %40
br label %64
64: ; preds = %63, %30
%65 = load i32, i32* %2
%66 = load i32, i32* %3
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %65, i32 %66)
br label %68
68: ; preds = %64, %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 %14 [
i32 0, label %24
i32 12, label %21
i32 2, label %21
i32 1, label %21
]
14: ; preds = %12
%15 = add nsw i32 %13, -3
%16 = icmp ult i32 %15, 3
br i1 %16, label %21, label %17
17: ; preds = %14
%18 = add nsw i32 %13, -6
%19 = icmp ult i32 %18, 3
%20 = select i1 %19, i32 3, i32 4
br label %21
21: ; preds = %17, %12, %12, %12, %14
%22 = phi i32 [ 2, %14 ], [ 1, %12 ], [ 1, %12 ], [ 1, %12 ], [ %20, %17 ]
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %22)
br label %24
24: ; preds = %12, %21
ret i32 0
}