#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 EACCES;
int EIO;
int ENOENT;
int errno;
int http_error_to_errno(int err) {
  switch (err) {
  case -1:
    return errno;
  case -200:
  case -201:
  case -202:
  case -203:
  case -204:
  case -205:
  case -206:
    return 0;
  case -400:
    return EIO;
  case -401:
    return EACCES;
  case -403:
    return EACCES;
  case -404:
    return ENOENT;
  case -411:
    return EIO;
  case -413:
    return EIO;
  case -505:
    return EIO;
  case -100:
  case -101:
  case -300:
  case -301:
  case -302:
  case -303:
  case -304:
  case -305:
  case -402:
  case -405:
  case -406:
  case -407:
  case -408:
  case -409:
  case -410:
  case -412:
  case -414:
  case -415:
  case -500:
  case -501:
  case -502:
  case -503:
  case -504:
    return EIO;
  default:
    return EIO;
  }
}


x86 assembly (clang, -O0):
<http_error_to_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xfffffe07,%eax
je     12cb <http_error_to_errno+0x1cb>
jmp    111d <http_error_to_errno+0x1d>
mov    -0xc(%rbp),%eax
add    $0x1f8,%eax
sub    $0x5,%eax
jb     12dc <http_error_to_errno+0x1dc>
jmp    1133 <http_error_to_errno+0x33>
mov    -0xc(%rbp),%eax
add    $0x19f,%eax
sub    $0x2,%eax
jb     12dc <http_error_to_errno+0x1dc>
jmp    1149 <http_error_to_errno+0x49>
mov    -0xc(%rbp),%eax
sub    $0xfffffe63,%eax
je     12ba <http_error_to_errno+0x1ba>
jmp    115c <http_error_to_errno+0x5c>
mov    -0xc(%rbp),%eax
sub    $0xfffffe64,%eax
je     12dc <http_error_to_errno+0x1dc>
jmp    116f <http_error_to_errno+0x6f>
mov    -0xc(%rbp),%eax
sub    $0xfffffe65,%eax
je     12a9 <http_error_to_errno+0x1a9>
jmp    1182 <http_error_to_errno+0x82>
mov    -0xc(%rbp),%eax
add    $0x19a,%eax
sub    $0x6,%eax
jb     12dc <http_error_to_errno+0x1dc>
jmp    1198 <http_error_to_errno+0x98>
mov    -0xc(%rbp),%eax
sub    $0xfffffe6c,%eax
je     1298 <http_error_to_errno+0x198>
jmp    11ab <http_error_to_errno+0xab>
mov    -0xc(%rbp),%eax
sub    $0xfffffe6d,%eax
je     1287 <http_error_to_errno+0x187>
jmp    11be <http_error_to_errno+0xbe>
mov    -0xc(%rbp),%eax
sub    $0xfffffe6e,%eax
je     12dc <http_error_to_errno+0x1dc>
jmp    11d1 <http_error_to_errno+0xd1>
mov    -0xc(%rbp),%eax
sub    $0xfffffe6f,%eax
je     1276 <http_error_to_errno+0x176>
jmp    11e4 <http_error_to_errno+0xe4>
mov    -0xc(%rbp),%eax
sub    $0xfffffe70,%eax
je     1265 <http_error_to_errno+0x165>
jmp    11f7 <http_error_to_errno+0xf7>
mov    -0xc(%rbp),%eax
add    $0x131,%eax
sub    $0x6,%eax
jb     12dc <http_error_to_errno+0x1dc>
jmp    120d <http_error_to_errno+0x10d>
mov    -0xc(%rbp),%eax
add    $0xce,%eax
sub    $0x7,%eax
jb     1259 <http_error_to_errno+0x159>
jmp    1223 <http_error_to_errno+0x123>
mov    -0xc(%rbp),%eax
add    $0x65,%eax
sub    $0x2,%eax
jb     12dc <http_error_to_errno+0x1dc>
jmp    1237 <http_error_to_errno+0x137>
mov    -0xc(%rbp),%eax
sub    $0xffffffff,%eax
jne    12ed <http_error_to_errno+0x1ed>
jmp    1248 <http_error_to_errno+0x148>
mov    0x2d81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12f9 <http_error_to_errno+0x1f9>
movl   $0x0,-0x4(%rbp)
jmp    12f9 <http_error_to_errno+0x1f9>
mov    0x2d6c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12f9 <http_error_to_errno+0x1f9>
mov    0x2d6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12f9 <http_error_to_errno+0x1f9>
mov    0x2d5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12f9 <http_error_to_errno+0x1f9>
mov    0x2d21(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12f9 <http_error_to_errno+0x1f9>
mov    0x2d28(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12f9 <http_error_to_errno+0x1f9>
mov    0x2d17(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12f9 <http_error_to_errno+0x1f9>
mov    0x2d06(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12f9 <http_error_to_errno+0x1f9>
mov    0x2cf5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12f9 <http_error_to_errno+0x1f9>
mov    0x2ce4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_error_to_errno>:
lea    0x1f9(%rdi),%ecx
cmp    $0x131,%ecx
ja     112a <http_error_to_errno+0x2a>
xor    %eax,%eax
lea    0xee9(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
ret
lea    0x65(%rdi),%eax
cmp    $0x2,%eax
jb     1120 <http_error_to_errno+0x20>
cmp    $0xffffffff,%edi
jne    1120 <http_error_to_errno+0x20>
mov    0x2e92(%rip),%rax
jmp    1127 <http_error_to_errno+0x27>
mov    0x2ea1(%rip),%rax
jmp    1127 <http_error_to_errno+0x27>
mov    0x2e70(%rip),%rax
jmp    1127 <http_error_to_errno+0x27>

LLVM IR (-O0):
@errno = global i32 0
@EIO = global i32 0
@EACCES = global i32 0
@ENOENT = global i32 0
define i32 @http_error_to_errno(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %24 [
i32 -1, label %5
i32 -200, label %7
i32 -201, label %7
i32 -202, label %7
i32 -203, label %7
i32 -204, label %7
i32 -205, label %7
i32 -206, label %7
i32 -400, label %8
i32 -401, label %10
i32 -403, label %12
i32 -404, label %14
i32 -411, label %16
i32 -413, label %18
i32 -505, label %20
i32 -100, label %22
i32 -101, label %22
i32 -300, label %22
i32 -301, label %22
i32 -302, label %22
i32 -303, label %22
i32 -304, label %22
i32 -305, label %22
i32 -402, label %22
i32 -405, label %22
i32 -406, label %22
i32 -407, label %22
i32 -408, label %22
i32 -409, label %22
i32 -410, label %22
i32 -412, label %22
i32 -414, label %22
i32 -415, label %22
i32 -500, label %22
i32 -501, label %22
i32 -502, label %22
i32 -503, label %22
i32 -504, label %22
]
5: ; preds = %1
%6 = load i32, i32* @errno
store i32 %6, i32* %2
br label %26
7: ; preds = %1, %1, %1, %1, %1, %1, %1
store i32 0, i32* %2
br label %26
8: ; preds = %1
%9 = load i32, i32* @EIO
store i32 %9, i32* %2
br label %26
10: ; preds = %1
%11 = load i32, i32* @EACCES
store i32 %11, i32* %2
br label %26
12: ; preds = %1
%13 = load i32, i32* @EACCES
store i32 %13, i32* %2
br label %26
14: ; preds = %1
%15 = load i32, i32* @ENOENT
store i32 %15, i32* %2
br label %26
16: ; preds = %1
%17 = load i32, i32* @EIO
store i32 %17, i32* %2
br label %26
18: ; preds = %1
%19 = load i32, i32* @EIO
store i32 %19, i32* %2
br label %26
20: ; preds = %1
%21 = load i32, i32* @EIO
store i32 %21, i32* %2
br label %26
22: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
%23 = load i32, i32* @EIO
store i32 %23, i32* %2
br label %26
24: ; preds = %1
%25 = load i32, i32* @EIO
store i32 %25, i32* %2
br label %26
26: ; preds = %24, %22, %20, %18, %16, %14, %12, %10, %8, %7, %5
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@errno = global i32 0
@EIO = global i32 0
@EACCES = global i32 0
@ENOENT = global i32 0
define i32 @http_error_to_errno(i32 %0) {
switch i32 %0, label %20 [
i32 -1, label %2
i32 -200, label %22
i32 -201, label %22
i32 -202, label %22
i32 -203, label %22
i32 -204, label %22
i32 -205, label %22
i32 -206, label %22
i32 -400, label %4
i32 -401, label %6
i32 -403, label %8
i32 -404, label %10
i32 -411, label %12
i32 -413, label %14
i32 -505, label %16
i32 -100, label %18
i32 -101, label %18
i32 -300, label %18
i32 -301, label %18
i32 -302, label %18
i32 -303, label %18
i32 -304, label %18
i32 -305, label %18
i32 -402, label %18
i32 -405, label %18
i32 -406, label %18
i32 -407, label %18
i32 -408, label %18
i32 -409, label %18
i32 -410, label %18
i32 -412, label %18
i32 -414, label %18
i32 -415, label %18
i32 -500, label %18
i32 -501, label %18
i32 -502, label %18
i32 -503, label %18
i32 -504, label %18
]
2: ; preds = %1
%3 = load i32, i32* @errno
br label %22
4: ; preds = %1
%5 = load i32, i32* @EIO
br label %22
6: ; preds = %1
%7 = load i32, i32* @EACCES
br label %22
8: ; preds = %1
%9 = load i32, i32* @EACCES
br label %22
10: ; preds = %1
%11 = load i32, i32* @ENOENT
br label %22
12: ; preds = %1
%13 = load i32, i32* @EIO
br label %22
14: ; preds = %1
%15 = load i32, i32* @EIO
br label %22
16: ; preds = %1
%17 = load i32, i32* @EIO
br label %22
18: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
%19 = load i32, i32* @EIO
br label %22
20: ; preds = %1
%21 = load i32, i32* @EIO
br label %22
22: ; preds = %1, %1, %1, %1, %1, %1, %1, %20, %18, %16, %14, %12, %10, %8, %6, %4, %2
%23 = phi i32 [ %21, %20 ], [ %19, %18 ], [ %17, %16 ], [ %15, %14 ], [ %13, %12 ], [ %11, %10 ], [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ %3, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %23
}