#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ print_insn_mips(unsigned int, unsigned int,
                                   int /*<<< orphan*/ *);
int /*<<< orphan*/ print_insn_mips16(unsigned int, unsigned int, int,
                                     int /*<<< orphan*/ *);
void print_mips(unsigned memaddr, unsigned int opcode, int nbytes, int isa,
                FILE *stream) {
  switch (isa) {
  default:
  case 0:
    print_insn_mips(memaddr, opcode, stream);
    break;
  case 1:
    print_insn_mips16(memaddr, opcode, nbytes, stream);
    break;
  case 2:
    break;
  }
}


x86 assembly (clang, -O0):
<print_mips>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
test   %eax,%eax
je     1172 <print_mips+0x52>
jmp    114b <print_mips+0x2b>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
je     1186 <print_mips+0x66>
jmp    115c <print_mips+0x3c>
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
je     119d <print_mips+0x7d>
jmp    116d <print_mips+0x4d>
jmp    1172 <print_mips+0x52>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <print_insn_mips@plt>
jmp    11a2 <print_mips+0x82>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <print_insn_mips16@plt>
jmp    11a2 <print_mips+0x82>
jmp    11a2 <print_mips+0x82>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mips>:
cmp    $0x1,%ecx
je     112b <print_mips+0xb>
cmp    $0x2,%ecx
jne    1133 <print_mips+0x13>
ret
mov    %r8,%rcx
jmp    1040 <print_insn_mips16@plt>
mov    %r8,%rdx
jmp    1030 <print_insn_mips@plt>

LLVM IR (-O0):
define void @print_mips(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i32, i32* %9
switch i32 %11, label %12 [
i32 0, label %13
i32 1, label %18
i32 2, label %24
]
12: ; preds = %5
br label %13
13: ; preds = %5, %12
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = load i32*, i32** %10
%17 = call i32 @print_insn_mips(i32 %14, i32 %15, i32* %16)
br label %25
18: ; preds = %5
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = load i32*, i32** %10
%23 = call i32 @print_insn_mips16(i32 %19, i32 %20, i32 %21, i32* %22)
br label %25
24: ; preds = %5
br label %25
25: ; preds = %24, %18, %13
ret void
}

LLVM IR (-O2):
define void @print_mips(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
switch i32 %3, label %6 [
i32 2, label %10
i32 1, label %8
]
6: ; preds = %5
%7 = tail call i32 @print_insn_mips(i32 %0, i32 %1, i32* %4)
br label %10
8: ; preds = %5
%9 = tail call i32 @print_insn_mips16(i32 %0, i32 %1, i32 %2, i32* %4)
br label %10
10: ; preds = %5, %8, %6
ret void
}