#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 FIOASYNC;
int FIOCLEX;
int FIONBIO;
int FIONCLEX;
int FIONREAD;
int FIOQSIZE;
int mips_change_request(int request) {
  switch (request) {
  case 0x541B:
    return FIONREAD;
  case 0x5421:
    return FIONBIO;
  case 0x5450:
    return FIONCLEX;
  case 0x5451:
    return FIOCLEX;
  case 0x5452:
    return FIOASYNC;
  case 0x545E:
    return FIOQSIZE;
  }
  return request;
}


x86 assembly (clang, -O0):
<mips_change_request>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x541b,%eax
je     117c <mips_change_request+0x7c>
jmp    111d <mips_change_request+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x5421,%eax
je     118d <mips_change_request+0x8d>
jmp    1130 <mips_change_request+0x30>
mov    -0xc(%rbp),%eax
sub    $0x5450,%eax
je     119e <mips_change_request+0x9e>
jmp    1143 <mips_change_request+0x43>
mov    -0xc(%rbp),%eax
sub    $0x5451,%eax
je     11af <mips_change_request+0xaf>
jmp    1156 <mips_change_request+0x56>
mov    -0xc(%rbp),%eax
sub    $0x5452,%eax
je     11c0 <mips_change_request+0xc0>
jmp    1169 <mips_change_request+0x69>
mov    -0xc(%rbp),%eax
sub    $0x545e,%eax
je     11d1 <mips_change_request+0xd1>
jmp    11e2 <mips_change_request+0xe2>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e8 <mips_change_request+0xe8>
mov    0x2e3c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e8 <mips_change_request+0xe8>
mov    0x2e33(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e8 <mips_change_request+0xe8>
mov    0x2e12(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e8 <mips_change_request+0xe8>
mov    0x2de9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e8 <mips_change_request+0xe8>
mov    0x2de0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e8 <mips_change_request+0xe8>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mips_change_request>:
mov    %edi,%eax
lea    -0x5450(%rax),%ecx
cmp    $0xe,%ecx
ja     1126 <mips_change_request+0x26>
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    0x2eb4(%rip),%rax
jmp    115f <mips_change_request+0x5f>
cmp    $0x5421,%eax
je     1158 <mips_change_request+0x58>
cmp    $0x541b,%eax
jne    1161 <mips_change_request+0x61>
mov    0x2ead(%rip),%rax
jmp    115f <mips_change_request+0x5f>
mov    0x2e84(%rip),%rax
jmp    115f <mips_change_request+0x5f>
mov    0x2e63(%rip),%rax
jmp    115f <mips_change_request+0x5f>
mov    0x2e62(%rip),%rax
jmp    115f <mips_change_request+0x5f>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@FIONREAD = global i32 0
@FIONBIO = global i32 0
@FIONCLEX = global i32 0
@FIOCLEX = global i32 0
@FIOASYNC = global i32 0
@FIOQSIZE = global i32 0
define i32 @mips_change_request(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %17 [
i32 21531, label %5
i32 21537, label %7
i32 21584, label %9
i32 21585, label %11
i32 21586, label %13
i32 21598, label %15
]
5: ; preds = %1
%6 = load i32, i32* @FIONREAD
store i32 %6, i32* %2
br label %19
7: ; preds = %1
%8 = load i32, i32* @FIONBIO
store i32 %8, i32* %2
br label %19
9: ; preds = %1
%10 = load i32, i32* @FIONCLEX
store i32 %10, i32* %2
br label %19
11: ; preds = %1
%12 = load i32, i32* @FIOCLEX
store i32 %12, i32* %2
br label %19
13: ; preds = %1
%14 = load i32, i32* @FIOASYNC
store i32 %14, i32* %2
br label %19
15: ; preds = %1
%16 = load i32, i32* @FIOQSIZE
store i32 %16, i32* %2
br label %19
17: ; preds = %1
%18 = load i32, i32* %3
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %15, %13, %11, %9, %7, %5
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@FIONREAD = global i32 0
@FIONBIO = global i32 0
@FIONCLEX = global i32 0
@FIOCLEX = global i32 0
@FIOASYNC = global i32 0
@FIOQSIZE = global i32 0
define i32 @mips_change_request(i32 %0) {
switch i32 %0, label %14 [
i32 21531, label %2
i32 21537, label %4
i32 21584, label %6
i32 21585, label %8
i32 21586, label %10
i32 21598, label %12
]
2: ; preds = %1
%3 = load i32, i32* @FIONREAD
br label %14
4: ; preds = %1
%5 = load i32, i32* @FIONBIO
br label %14
6: ; preds = %1
%7 = load i32, i32* @FIONCLEX
br label %14
8: ; preds = %1
%9 = load i32, i32* @FIOCLEX
br label %14
10: ; preds = %1
%11 = load i32, i32* @FIOASYNC
br label %14
12: ; preds = %1
%13 = load i32, i32* @FIOQSIZE
br label %14
14: ; preds = %1, %12, %10, %8, %6, %4, %2
%15 = phi i32 [ %13, %12 ], [ %11, %10 ], [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ %3, %2 ], [ %0, %1 ]
ret i32 %15
}