#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 */
scalar_t__ check_season(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int season;
  printf("Input a season number: ");
  scanf("%d", &season);
  if (check_season(season) == 0) {
    printf("The season is: ");
    switch (season) {
    case 1:
    case 2:
    case 3:
      printf("Spring");
      break;
    case 4:
    case 5:
    case 6:
      printf("Summer");
      break;
    case 7:
    case 8:
    case 9:
      printf("Autumn");
      break;
    case 10:
    case 11:
    case 12:
      printf("Winter");
      break;
    }
  } else {
    printf("Input Error: Input should be an Integer between 1 and 12.");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <check_season@plt>
cmp    $0x0,%rax
jne    11e6 <main+0xb6>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xb,%eax
ja     11e1 <main+0xb1>
mov    -0x10(%rbp),%rax
lea    0xe67(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    11e1 <main+0xb1>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    11e1 <main+0xb1>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    11e1 <main+0xb1>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
jmp    11f2 <main+0xc2>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <check_season@plt>
test   %rax,%rax
je     1165 <main+0x35>
lea    0xee4(%rip),%rdi
jmp    118d <main+0x5d>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0xb,%eax
ja     1192 <main+0x62>
cltq
lea    0xefe(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Input a season number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"The season is: \00"
@.str.3 = [7 x i8] c"Spring\00"
@.str.4 = [7 x i8] c"Summer\00"
@.str.5 = [7 x i8] c"Autumn\00"
@.str.6 = [7 x i8] c"Winter\00"
@.str.7 = [58 x i8] c"Input Error: Input should be an Integer between 1 and 12.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 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* %2)
%5 = load i32, i32* %2
%6 = call i64 @check_season(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* %2
switch i32 %10, label %19 [
i32 1, label %11
i32 2, label %11
i32 3, label %11
i32 4, label %13
i32 5, label %13
i32 6, label %13
i32 7, label %15
i32 8, label %15
i32 9, label %15
i32 10, label %17
i32 11, label %17
i32 12, label %17
]
11: ; preds = %8, %8, %8
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %19
13: ; preds = %8, %8, %8
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %19
15: ; preds = %8, %8, %8
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %19
17: ; preds = %8, %8, %8
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %19
19: ; preds = %8, %17, %15, %13, %11
br label %22
20: ; preds = %0
%21 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0))
br label %22
22: ; preds = %20, %19
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Input a season number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"The season is: \00"
@.str.3 = [7 x i8] c"Spring\00"
@.str.4 = [7 x i8] c"Summer\00"
@.str.5 = [7 x i8] c"Autumn\00"
@.str.6 = [7 x i8] c"Winter\00"
@.str.7 = [58 x i8] c"Input Error: Input should be an Integer between 1 and 12.\00"
@reltable.main = [12 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.3 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.3 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.3 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.4 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.4 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.4 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.5 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.5 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.5 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.6 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.6 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.6 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 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 = call i64 @check_season(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %0
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* %1
%11 = add i32 %10, -1
%12 = icmp ult i32 %11, 12
br i1 %12, label %13, label %20
13: ; preds = %8
%14 = sext i32 %11 to i64
%15 = shl i64 %14, 2
%16 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.main to i8*), i64 %15)
br label %17
17: ; preds = %13, %0
%18 = phi i8* [ getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0), %0 ], [ %16, %13 ]
%19 = call i32 @printf(i8* dereferenceable(1) %18)
br label %20
20: ; preds = %8, %17
ret i32 0
}