#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 == 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)
jle    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   $0xc,-0x8(%rbp)
je     11b9 <main+0x99>
cmpl   $0x1,-0x8(%rbp)
je     11b9 <main+0x99>
cmpl   $0x2,-0x8(%rbp)
jne    11c5 <main+0xa5>
movl   $0x1,-0xc(%rbp)
jmp    124d <main+0x12d>
cmpl   $0x3,-0x8(%rbp)
je     11e3 <main+0xc3>
cmpl   $0x4,-0x8(%rbp)
je     11e3 <main+0xc3>
cmpl   $0x5,-0x8(%rbp)
jne    11ef <main+0xcf>
movl   $0x2,-0xc(%rbp)
jmp    1248 <main+0x128>
cmpl   $0x6,-0x8(%rbp)
je     120d <main+0xed>
cmpl   $0x7,-0x8(%rbp)
je     120d <main+0xed>
cmpl   $0x8,-0x8(%rbp)
jne    1219 <main+0xf9>
movl   $0x3,-0xc(%rbp)
jmp    1243 <main+0x123>
cmpl   $0x9,-0x8(%rbp)
je     1237 <main+0x117>
cmpl   $0xa,-0x8(%rbp)
je     1237 <main+0x117>
cmpl   $0xb,-0x8(%rbp)
jne    123e <main+0x11e>
movl   $0x4,-0xc(%rbp)
jmp    1243 <main+0x123>
jmp    1248 <main+0x128>
jmp    124d <main+0x12d>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xdbd(%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
lea    -0xd(%rsi),%eax
cmp    $0xfffffff3,%eax
ja     1191 <main+0x71>
lea    0xea5(%rip),%r14
lea    0xeb2(%rip),%r15
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
lea    -0xd(%rsi),%eax
cmp    $0xfffffff4,%eax
jb     1170 <main+0x50>
cmp    $0xc,%esi
ja     11bf <main+0x9f>
mov    $0x1,%edx
mov    $0x1006,%eax
bt     %esi,%eax
jae    11bf <main+0x9f>
lea    0xe6b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    -0x3(%rsi),%eax
mov    $0x2,%edx
cmp    $0x3,%eax
jb     11a5 <main+0x85>
lea    -0x6(%rsi),%eax
cmp    $0x3,%eax
mov    $0x4,%edx
sbb    $0x0,%edx
jmp    11a5 <main+0x85>

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 sgt 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 eq i32 %19, 12
br i1 %20, label %27, label %21
21: ; preds = %18
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 1
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %28
27: ; preds = %24, %21, %18
store i32 1, i32* %3
br label %61
28: ; preds = %24
%29 = load i32, i32* %2
%30 = icmp eq i32 %29, 3
br i1 %30, label %37, label %31
31: ; preds = %28
%32 = load i32, i32* %2
%33 = icmp eq i32 %32, 4
br i1 %33, label %37, label %34
34: ; preds = %31
%35 = load i32, i32* %2
%36 = icmp eq i32 %35, 5
br i1 %36, label %37, label %38
37: ; preds = %34, %31, %28
store i32 2, i32* %3
br label %60
38: ; preds = %34
%39 = load i32, i32* %2
%40 = icmp eq i32 %39, 6
br i1 %40, label %47, label %41
41: ; preds = %38
%42 = load i32, i32* %2
%43 = icmp eq i32 %42, 7
br i1 %43, label %47, label %44
44: ; preds = %41
%45 = load i32, i32* %2
%46 = icmp eq i32 %45, 8
br i1 %46, label %47, label %48
47: ; preds = %44, %41, %38
store i32 3, i32* %3
br label %59
48: ; preds = %44
%49 = load i32, i32* %2
%50 = icmp eq i32 %49, 9
br i1 %50, label %57, label %51
51: ; preds = %48
%52 = load i32, i32* %2
%53 = icmp eq i32 %52, 10
br i1 %53, label %57, label %54
54: ; preds = %51
%55 = load i32, i32* %2
%56 = icmp eq i32 %55, 11
br i1 %56, label %57, label %58
57: ; preds = %54, %51, %48
store i32 4, i32* %3
br label %58
58: ; preds = %57, %54
br label %59
59: ; preds = %58, %47
br label %60
60: ; preds = %59, %37
br label %61
61: ; preds = %60, %27
%62 = load i32, i32* %2
%63 = load i32, i32* %3
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %62, i32 %63)
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 = add i32 %5, -13
%7 = icmp ult i32 %6, -12
br i1 %7, label %8, label %14
8: ; preds = %0, %8
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = add i32 %11, -13
%13 = icmp ult i32 %12, -12
br i1 %13, label %8, label %14
14: ; preds = %8, %0
%15 = phi i32 [ %5, %0 ], [ %11, %8 ]
switch i32 %15, label %16 [
i32 12, label %23
i32 2, label %23
i32 1, label %23
]
16: ; preds = %14
%17 = add nsw i32 %15, -3
%18 = icmp ult i32 %17, 3
br i1 %18, label %23, label %19
19: ; preds = %16
%20 = add nsw i32 %15, -6
%21 = icmp ult i32 %20, 3
%22 = select i1 %21, i32 3, i32 4
br label %23
23: ; preds = %19, %16, %14, %14, %14
%24 = phi i32 [ 1, %14 ], [ 1, %14 ], [ 1, %14 ], [ 2, %16 ], [ %22, %19 ]
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %24)
ret i32 0
}