#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 uint32_t;

/* Variables and functions */
int handle_dsform(int, unsigned long *, unsigned long *);
bool extended_62(uint32_t insn, unsigned long *gprs, unsigned long *addr,
                 unsigned long *size) {
  int subopc = (((insn) >> (32 - (30) - (2))) & ((1 << (2)) - 1));
  switch (subopc) {
  case 0:
  case 1:
    *size = 8;
    return handle_dsform(insn, gprs, addr);
  case 2:
    *size = 16;
    return handle_dsform(insn, gprs, addr);
  }
  return false;
}


x86 assembly (clang, -O0):
<extended_62>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x2,%eax
jb     1155 <extended_62+0x45>
jmp    1144 <extended_62+0x34>
mov    -0x28(%rbp),%eax
sub    $0x2,%eax
je     1178 <extended_62+0x68>
jmp    119b <extended_62+0x8b>
mov    -0x20(%rbp),%rax
movq   $0x8,(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <handle_dsform@plt>
mov    %eax,-0x4(%rbp)
jmp    11a2 <extended_62+0x92>
mov    -0x20(%rbp),%rax
movq   $0x10,(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <handle_dsform@plt>
mov    %eax,-0x4(%rbp)
jmp    11a2 <extended_62+0x92>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extended_62>:
mov    %edi,%eax
and    $0x3,%eax
cmp    $0x3,%eax
jne    111d <extended_62+0xd>
xor    %eax,%eax
ret
mov    %eax,%r8d
lea    0xed9(%rip),%rax
mov    (%rax,%r8,8),%rax
mov    %rax,(%rcx)
jmp    1030 <handle_dsform@plt>

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

LLVM IR (-O2):
@switch.table.extended_62 = [3 x i64] [i64 8, i64 8, i64 16]
define i32 @extended_62(i32 %0, i64* %1, i64* %2, i64* nocapture writeonly %3) {
%5 = and i32 %0, 3
%6 = icmp eq i32 %5, 3
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = zext i32 %5 to i64
%9 = getelementptr inbounds [3 x i64], [3 x i64]* @switch.table.extended_62, i64 0, i64 %8
%10 = load i64, i64* %9
store i64 %10, i64* %3
%11 = tail call i32 @handle_dsform(i32 %0, i64* %1, i64* %2)
br label %12
12: ; preds = %4, %7
%13 = phi i32 [ 0, %4 ], [ %11, %7 ]
ret i32 %13
}