#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*/ GenPrintInstr2Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int, int);
int GenSelectByteOrWord(int, int);
void GenPostAddSubIndirect(int opSz, int val, int tok) {
  int instr = 0x09;
  if (tok != 'S')
    instr = 0x0A;
  GenPrintInstr2Operands(0x00, 0, 0x04, 0, 0x03, 0);
  GenPrintInstr2Operands(0x00, 0, GenSelectByteOrWord(0x0B, opSz), 0, 0x1A, 0);
  GenExtendRegAIfNeeded(opSz);
  GenPrintInstr2Operands(instr, 0, GenSelectByteOrWord(0x1E, opSz), 0, 0x0D,
                         val);
}


x86 assembly (clang, -O0):
<GenPostAddSubIndirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x9,-0x10(%rbp)
cmpl   $0x53,-0xc(%rbp)
je     1159 <GenPostAddSubIndirect+0x29>
movl   $0xa,-0x10(%rbp)
xor    %r9d,%r9d
mov    $0x4,%edx
mov    $0x3,%r8d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%ecx
call   1040 <GenPrintInstr2Operands@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   1050 <GenExtendRegAIfNeeded@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1e,%edi
call   1030 <GenSelectByteOrWord@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
mov    -0x8(%rbp),%r9d
xor    %ecx,%ecx
mov    $0xd,%r8d
mov    %ecx,%esi
call   1040 <GenPrintInstr2Operands@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenPostAddSubIndirect>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %eax,%eax
cmp    $0x53,%edx
sete   %al
mov    $0xa,%ebx
sub    %eax,%ebx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
xor    %r9d,%r9d
call   1040 <GenPrintInstr2Operands@plt>
mov    $0xb,%edi
mov    %ebp,%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    %ebp,%edi
call   1050 <GenExtendRegAIfNeeded@plt>
mov    $0x1e,%edi
mov    %ebp,%esi
call   1030 <GenSelectByteOrWord@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    %eax,%edx
xor    %ecx,%ecx
mov    $0xd,%r8d
mov    %r14d,%r9d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <GenPrintInstr2Operands@plt>

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

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