#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*/ input_error(char *, int *);
int sp_ienv(int ispec) {
  int i;
  switch (ispec) {
  case 1:
    return (20);
  case 2:
    return (10);
  case 3:
    return (200);
  case 4:
    return (200);
  case 5:
    return (100);
  case 6:
    return (30);
  case 7:
    return (10);
  }
  i = 1;
  input_error("sp_ienv", &i);
  return 0;
}


x86 assembly (clang, -O0):
<sp_ienv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x6,%eax
ja     1198 <sp_ienv+0x88>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x14,-0x4(%rbp)
jmp    11b6 <sp_ienv+0xa6>
movl   $0xa,-0x4(%rbp)
jmp    11b6 <sp_ienv+0xa6>
movl   $0xc8,-0x4(%rbp)
jmp    11b6 <sp_ienv+0xa6>
movl   $0xc8,-0x4(%rbp)
jmp    11b6 <sp_ienv+0xa6>
movl   $0x64,-0x4(%rbp)
jmp    11b6 <sp_ienv+0xa6>
movl   $0x1e,-0x4(%rbp)
jmp    11b6 <sp_ienv+0xa6>
movl   $0xa,-0x4(%rbp)
jmp    11b6 <sp_ienv+0xa6>
movl   $0x1,-0xc(%rbp)
lea    0xe76(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <input_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_ienv>:
push   %rax
add    $0xffffffff,%edi
cmp    $0x7,%edi
jae    1128 <sp_ienv+0x18>
movslq %edi,%rax
lea    0xee5(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
movl   $0x1,0x4(%rsp)
lea    0xec9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <input_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"sp_ienv\00"
define i32 @sp_ienv(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
switch i32 %5, label %13 [
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
]
6: ; preds = %1
store i32 20, i32* %2
br label %15
7: ; preds = %1
store i32 10, i32* %2
br label %15
8: ; preds = %1
store i32 200, i32* %2
br label %15
9: ; preds = %1
store i32 200, i32* %2
br label %15
10: ; preds = %1
store i32 100, i32* %2
br label %15
11: ; preds = %1
store i32 30, i32* %2
br label %15
12: ; preds = %1
store i32 10, i32* %2
br label %15
13: ; preds = %1
store i32 1, i32* %4
%14 = call i32 @input_error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 0, i32* %2
br label %15
15: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [8 x i8] c"sp_ienv\00"
@switch.table.sp_ienv = [7 x i32] [i32 20, i32 10, i32 200, i32 200, i32 100, i32 30, i32 10]
define i32 @sp_ienv(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = add i32 %0, -1
%5 = icmp ult i32 %4, 7
br i1 %5, label %8, label %6
6: ; preds = %1
store i32 1, i32* %2
%7 = call i32 @input_error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %12
8: ; preds = %1
%9 = sext i32 %4 to i64
%10 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.sp_ienv, i64 0, i64 %9
%11 = load i32, i32* %10
br label %12
12: ; preds = %8, %6
%13 = phi i32 [ 0, %6 ], [ %11, %8 ]
ret i32 %13
}