#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*/ GenExtendRegAIfNeeded(int);
int /*<<< orphan*/ GenPrintInstr1Operand(int, int /*<<< orphan*/, int,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ GenPrintInstr2Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int,
                                          int /*<<< orphan*/);
int GenSelectByteOrWord(int, int);
void GenIncDecIndirect(int opSz, int tok) {
  int instr = 0x07;
  if (tok != 12)
    instr = 0x08;
  GenPrintInstr2Operands(0x00, 0, 0x04, 0, 0x03, 0);
  GenPrintInstr1Operand(instr, 0, GenSelectByteOrWord(0x1E, opSz), 0);
  GenPrintInstr2Operands(0x00, 0, GenSelectByteOrWord(0x0B, opSz), 0, 0x1A, 0);
  GenExtendRegAIfNeeded(opSz);
}


x86 assembly (clang, -O0):
<GenIncDecIndirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
cmpl   $0xc,-0x8(%rbp)
je     1166 <GenIncDecIndirect+0x26>
movl   $0x8,-0xc(%rbp)
xor    %r9d,%r9d
mov    $0x4,%edx
mov    $0x3,%r8d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%ecx
call   1040 <GenPrintInstr2Operands@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1e,%edi
call   1030 <GenSelectByteOrWord@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%edx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1050 <GenPrintInstr1Operand@plt>
mov    -0x4(%rbp),%esi
mov    $0xb,%edi
call   1030 <GenSelectByteOrWord@plt>
mov    %eax,%edx
xor    %r9d,%r9d
mov    $0x1a,%r8d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%ecx
call   1040 <GenPrintInstr2Operands@plt>
mov    -0x4(%rbp),%edi
call   1060 <GenExtendRegAIfNeeded@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenIncDecIndirect>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
cmp    $0xc,%esi
sete   %al
mov    $0x8,%ebp
sub    %eax,%ebp
xor    %edi,%edi
xor    %esi,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
xor    %r9d,%r9d
call   1040 <GenPrintInstr2Operands@plt>
mov    $0x1e,%edi
mov    %ebx,%esi
call   1030 <GenSelectByteOrWord@plt>
mov    %ebp,%edi
xor    %esi,%esi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <GenPrintInstr1Operand@plt>
mov    $0xb,%edi
mov    %ebx,%esi
call   1030 <GenSelectByteOrWord@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %eax,%edx
xor    %ecx,%ecx
mov    $0x1a,%r8d
xor    %r9d,%r9d
call   1040 <GenPrintInstr2Operands@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <GenExtendRegAIfNeeded@plt>

LLVM IR (-O0):
define void @GenIncDecIndirect(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 7, i32* %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 12
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 8, i32* %5
br label %9
9: ; preds = %8, %2
%10 = call i32 @GenPrintInstr2Operands(i32 0, i32 0, i32 4, i32 0, i32 3, i32 0)
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = call i32 @GenSelectByteOrWord(i32 30, i32 %12)
%14 = call i32 @GenPrintInstr1Operand(i32 %11, i32 0, i32 %13, i32 0)
%15 = load i32, i32* %3
%16 = call i32 @GenSelectByteOrWord(i32 11, i32 %15)
%17 = call i32 @GenPrintInstr2Operands(i32 0, i32 0, i32 %16, i32 0, i32 26, i32 0)
%18 = load i32, i32* %3
%19 = call i32 @GenExtendRegAIfNeeded(i32 %18)
ret void
}

LLVM IR (-O2):
define void @GenIncDecIndirect(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 12
%4 = select i1 %3, i32 7, i32 8
%5 = tail call i32 @GenPrintInstr2Operands(i32 0, i32 0, i32 4, i32 0, i32 3, i32 0)
%6 = tail call i32 @GenSelectByteOrWord(i32 30, i32 %0)
%7 = tail call i32 @GenPrintInstr1Operand(i32 %4, i32 0, i32 %6, i32 0)
%8 = tail call i32 @GenSelectByteOrWord(i32 11, i32 %0)
%9 = tail call i32 @GenPrintInstr2Operands(i32 0, i32 0, i32 %8, i32 0, i32 26, i32 0)
%10 = tail call i32 @GenExtendRegAIfNeeded(i32 %0)
ret void
}