#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);
  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;
  else
    estacion = 0;
  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>
cmpl   $0xc,-0x8(%rbp)
je     116b <main+0x4b>
cmpl   $0x1,-0x8(%rbp)
je     116b <main+0x4b>
cmpl   $0x2,-0x8(%rbp)
jne    1177 <main+0x57>
movl   $0x1,-0xc(%rbp)
jmp    120b <main+0xeb>
cmpl   $0x3,-0x8(%rbp)
je     1195 <main+0x75>
cmpl   $0x4,-0x8(%rbp)
je     1195 <main+0x75>
cmpl   $0x5,-0x8(%rbp)
jne    11a1 <main+0x81>
movl   $0x2,-0xc(%rbp)
jmp    1206 <main+0xe6>
cmpl   $0x6,-0x8(%rbp)
je     11bf <main+0x9f>
cmpl   $0x7,-0x8(%rbp)
je     11bf <main+0x9f>
cmpl   $0x8,-0x8(%rbp)
jne    11cb <main+0xab>
movl   $0x3,-0xc(%rbp)
jmp    1201 <main+0xe1>
cmpl   $0x9,-0x8(%rbp)
je     11e9 <main+0xc9>
cmpl   $0xa,-0x8(%rbp)
je     11e9 <main+0xc9>
cmpl   $0xb,-0x8(%rbp)
jne    11f5 <main+0xd5>
movl   $0x4,-0xc(%rbp)
jmp    11fc <main+0xdc>
movl   $0x0,-0xc(%rbp)
jmp    1201 <main+0xe1>
jmp    1206 <main+0xe6>
jmp    120b <main+0xeb>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
cmp    $0xc,%esi
ja     116a <main+0x4a>
mov    $0x1,%edx
mov    $0x1006,%eax
bt     %esi,%eax
jae    116a <main+0x4a>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    -0x3(%rsi),%eax
mov    $0x2,%edx
cmp    $0x3,%eax
jb     1158 <main+0x38>
lea    -0x6(%rsi),%eax
mov    $0x3,%edx
cmp    $0x3,%eax
jb     1158 <main+0x38>
lea    -0x9(%rsi),%eax
xor    %edx,%edx
cmp    $0x3,%eax
setb   %dl
shl    $0x2,%edx
jmp    1158 <main+0x38>

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