#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*/ fatal_error(char *);
int op_to_imm_op(int opcode) {
  switch (opcode) {
  case 270:
    return (273);
  case 275:
    return (274);
  case 277:
    return (278);
  case 475:
    return (476);
  case 556:
    return (557);
  case 508:
    return (509);
  case 511:
    return (510);
  case 507:
    return (506);
  case 515:
    return (514);
  case 517:
    return (516);
  default:
    fatal_error("Can't convert op to immediate op\n");
    return (0);
  }
}


x86 assembly (clang, -O0):
<op_to_imm_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x10e,%eax
je     11dc <op_to_imm_op+0xcc>
jmp    1131 <op_to_imm_op+0x21>
mov    -0xc(%rbp),%eax
sub    $0x113,%eax
je     11e8 <op_to_imm_op+0xd8>
jmp    1144 <op_to_imm_op+0x34>
mov    -0xc(%rbp),%eax
sub    $0x115,%eax
je     11f4 <op_to_imm_op+0xe4>
jmp    1157 <op_to_imm_op+0x47>
mov    -0xc(%rbp),%eax
sub    $0x1db,%eax
je     1200 <op_to_imm_op+0xf0>
jmp    116a <op_to_imm_op+0x5a>
mov    -0xc(%rbp),%eax
sub    $0x1fb,%eax
je     1230 <op_to_imm_op+0x120>
jmp    117d <op_to_imm_op+0x6d>
mov    -0xc(%rbp),%eax
sub    $0x1fc,%eax
je     1218 <op_to_imm_op+0x108>
jmp    1190 <op_to_imm_op+0x80>
mov    -0xc(%rbp),%eax
sub    $0x1ff,%eax
je     1224 <op_to_imm_op+0x114>
jmp    11a3 <op_to_imm_op+0x93>
mov    -0xc(%rbp),%eax
sub    $0x203,%eax
je     123c <op_to_imm_op+0x12c>
jmp    11b6 <op_to_imm_op+0xa6>
mov    -0xc(%rbp),%eax
sub    $0x205,%eax
je     1248 <op_to_imm_op+0x138>
jmp    11c9 <op_to_imm_op+0xb9>
mov    -0xc(%rbp),%eax
sub    $0x22c,%eax
je     120c <op_to_imm_op+0xfc>
jmp    1254 <op_to_imm_op+0x144>
movl   $0x111,-0x4(%rbp)
jmp    1267 <op_to_imm_op+0x157>
movl   $0x112,-0x4(%rbp)
jmp    1267 <op_to_imm_op+0x157>
movl   $0x116,-0x4(%rbp)
jmp    1267 <op_to_imm_op+0x157>
movl   $0x1dc,-0x4(%rbp)
jmp    1267 <op_to_imm_op+0x157>
movl   $0x22d,-0x4(%rbp)
jmp    1267 <op_to_imm_op+0x157>
movl   $0x1fd,-0x4(%rbp)
jmp    1267 <op_to_imm_op+0x157>
movl   $0x1fe,-0x4(%rbp)
jmp    1267 <op_to_imm_op+0x157>
movl   $0x1fa,-0x4(%rbp)
jmp    1267 <op_to_imm_op+0x157>
movl   $0x202,-0x4(%rbp)
jmp    1267 <op_to_imm_op+0x157>
movl   $0x204,-0x4(%rbp)
jmp    1267 <op_to_imm_op+0x157>
lea    0xda5(%rip),%rdi
call   1030 <fatal_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_to_imm_op>:
push   %rax
cmp    $0x1da,%edi
jle    113b <op_to_imm_op+0x2b>
lea    -0x1fb(%rdi),%eax
cmp    $0x31,%eax
ja     1168 <op_to_imm_op+0x58>
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1fa,%eax
pop    %rcx
ret
cmp    $0x10e,%edi
je     115a <op_to_imm_op+0x4a>
cmp    $0x113,%edi
je     1161 <op_to_imm_op+0x51>
cmp    $0x115,%edi
jne    1177 <op_to_imm_op+0x67>
mov    $0x116,%eax
pop    %rcx
ret
mov    $0x111,%eax
pop    %rcx
ret
mov    $0x112,%eax
pop    %rcx
ret
cmp    $0x1db,%edi
jne    1177 <op_to_imm_op+0x67>
mov    $0x1dc,%eax
pop    %rcx
ret
lea    0xf4a(%rip),%rdi
call   1030 <fatal_error@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1fd,%eax
pop    %rcx
ret
mov    $0x1fe,%eax
pop    %rcx
ret
mov    $0x202,%eax
pop    %rcx
ret
mov    $0x204,%eax
pop    %rcx
ret
mov    $0x22d,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Can't convert op to immediate op\0A\00"
define i32 @op_to_imm_op(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %15 [
i32 270, label %5
i32 275, label %6
i32 277, label %7
i32 475, label %8
i32 556, label %9
i32 508, label %10
i32 511, label %11
i32 507, label %12
i32 515, label %13
i32 517, label %14
]
5: ; preds = %1
store i32 273, i32* %2
br label %17
6: ; preds = %1
store i32 274, i32* %2
br label %17
7: ; preds = %1
store i32 278, i32* %2
br label %17
8: ; preds = %1
store i32 476, i32* %2
br label %17
9: ; preds = %1
store i32 557, i32* %2
br label %17
10: ; preds = %1
store i32 509, i32* %2
br label %17
11: ; preds = %1
store i32 510, i32* %2
br label %17
12: ; preds = %1
store i32 506, i32* %2
br label %17
13: ; preds = %1
store i32 514, i32* %2
br label %17
14: ; preds = %1
store i32 516, i32* %2
br label %17
15: ; preds = %1
%16 = call i32 @fatal_error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %17
17: ; preds = %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [34 x i8] c"Can't convert op to immediate op\0A\00"
define i32 @op_to_imm_op(i32 %0) {
switch i32 %0, label %11 [
i32 270, label %13
i32 275, label %2
i32 277, label %3
i32 475, label %4
i32 556, label %5
i32 508, label %6
i32 511, label %7
i32 507, label %8
i32 515, label %9
i32 517, label %10
]
2: ; preds = %1
br label %13
3: ; preds = %1
br label %13
4: ; preds = %1
br label %13
5: ; preds = %1
br label %13
6: ; preds = %1
br label %13
7: ; preds = %1
br label %13
8: ; preds = %1
br label %13
9: ; preds = %1
br label %13
10: ; preds = %1
br label %13
11: ; preds = %1
%12 = tail call i32 @fatal_error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %1, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%14 = phi i32 [ 0, %11 ], [ 516, %10 ], [ 514, %9 ], [ 506, %8 ], [ 510, %7 ], [ 509, %6 ], [ 557, %5 ], [ 476, %4 ], [ 278, %3 ], [ 274, %2 ], [ 273, %1 ]
ret i32 %14
}