// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/Observer.cpp
// Function: Observer::AdjustUnum(char, int)
void Observer::AdjustUnum(char side, Unum unum) {
  if (unum >= 0) {
    if (side == 'l') {
      for (int i = mUnknownPlayerCount - 1; i >= mBugInfoRanged; i--) {
        mUnknownPlayersBugInfo[i].mSupSide = side;
        mUnknownPlayersBugInfo[i].mSupNum = unum - (mUnknownPlayerCount - i);

        if (mUnknownPlayersBugInfo[i].mSupSide ==
                mUnknownPlayersBugInfo[i].mSide &&
            mUnknownPlayersBugInfo[i].mSupNum <
                mUnknownPlayersBugInfo[i].mLeastNum) {
          PRINT_ERROR(CurrentTime() << "bug info compute error!!!!!!!!");
        }
      }
    } else if (side == 'r') {
      for (int i = mUnknownPlayerCount - 1; i >= mBugInfoRanged; i--) {
        if (mUnknownPlayersBugInfo[i].mSide == side) {
          mUnknownPlayersBugInfo[i].mSupSide = side;
          mUnknownPlayersBugInfo[i].mSupNum = unum - (mUnknownPlayerCount - i);
        } else {
          mUnknownPlayersBugInfo[i].mSupSide = side;
          mUnknownPlayersBugInfo[i].mSupNum = unum - (mUnknownPlayerCount - i);

          if (unum - (mUnknownPlayerCount - i) <= 0) {
            mUnknownPlayersBugInfo[i].mSupSide = 'l';
            mUnknownPlayersBugInfo[i].mSupNum = TEAMSIZE;
          }
        }

        if (mUnknownPlayersBugInfo[i].mSupSide ==
                mUnknownPlayersBugInfo[i].mSide &&
            mUnknownPlayersBugInfo[i].mSupNum <
                mUnknownPlayersBugInfo[i].mLeastNum) {
          PRINT_ERROR(CurrentTime() << "bug info compute error!!!!!!!!");
        }
      }
    }
    mBugInfoRanged = mUnknownPlayerCount;
  } else {
    if (side == 'l') {
      for (int i = mUnknownPlayerCount - 2; i >= mBugInfoRanged; i--) {
        if (mUnknownPlayersBugInfo[i].mSupSide != side) {
          mUnknownPlayersBugInfo[i].mSupSide = side;
        }
      }
    }

    for (int i = mUnknownPlayerCount - 2; i >= mBugInfoRanged; i--) {
      Unum num = mUnknownPlayersBugInfo[mUnknownPlayerCount - 1].mSupNum -
                 (mUnknownPlayerCount - 1 - i);
      if (num > 0) {
        if (mUnknownPlayersBugInfo[i].mSupSide == 'r') {
          mUnknownPlayersBugInfo[i].mSupNum = num;
        }
      } else {
        mUnknownPlayersBugInfo[i].mSupSide = 'l';
        mUnknownPlayersBugInfo[i].mSupNum = TEAMSIZE + num;
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf8(%rbp)
cmpl $0x0, -0x10(%rbp)
jl 0x6c027
movsbl -0x9(%rbp), %eax
cmpl $0x6c, %eax
jne 0x6bcef
movq -0xf8(%rbp), %rax
movl 0x31e0(%rax), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
movq -0xf8(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x3354(%rcx), %eax
jl 0x6bcea
movq -0xf8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, -0x105(%rbp)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x14(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x20(%rbp), %rsi
callq 0x6e470
movb -0x105(%rbp), %cl
movq -0xf8(%rbp), %rdi
movb %cl, 0x8(%rax)
movl -0x10(%rbp), %eax
movl 0x31e0(%rdi), %ecx
subl -0x14(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x104(%rbp)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x14(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x28(%rbp), %rsi
callq 0x6e470
movl -0x104(%rbp), %ecx
movq -0xf8(%rbp), %rdi
movl %ecx, 0xc(%rax)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x14(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rsi
callq 0x6e470
movq -0xf8(%rbp), %rdi
movsbl 0x8(%rax), %eax
movl %eax, -0x100(%rbp)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x14(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x38(%rbp), %rsi
callq 0x6e470
movl -0x100(%rbp), %ecx
movsbl (%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0xf9(%rbp)
jne 0x6bc49
movq -0xf8(%rbp), %rdi
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x14(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x40(%rbp), %rsi
callq 0x6e470
movq -0xf8(%rbp), %rdi
movl 0xc(%rax), %eax
movl %eax, -0x10c(%rbp)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x14(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rsi
callq 0x6e470
movq %rax, %rcx
movl -0x10c(%rbp), %eax
cmpl 0x4(%rcx), %eax
setl %al
movb %al, -0xf9(%rbp)
movb -0xf9(%rbp), %al
testb $0x1, %al
jne 0x6bc58
jmp 0x6bcda
jmp 0x6bc5a
movq 0x9238f(%rip), %rdi     # 0xfdff0
leaq 0x57280(%rip), %rsi     # 0xc2ee8
callq 0xa5a0
movq %rax, %rdi
leaq 0x595da(%rip), %rsi     # 0xc5251
callq 0xa5a0
movq %rax, %rdi
movl $0x202, %esi            # imm = 0x202
callq 0xaa40
movq %rax, %rdi
leaq 0x578cc(%rip), %rsi     # 0xc355f
callq 0xa5a0
movq -0xf8(%rbp), %rdi
movq %rax, -0x118(%rbp)
callq 0x11a70
movq -0x118(%rbp), %rdi
movq %rax, %rsi
callq 0x11d40
movq %rax, %rdi
leaq 0x5725c(%rip), %rsi     # 0xc2f20
callq 0xa5a0
movq %rax, %rdi
movq 0x922dd(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x6bcda
jmp 0x6bcdc
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6bb0d
jmp 0x6c00f
movsbl -0x9(%rbp), %eax
cmpl $0x72, %eax
jne 0x6c00d
movq -0xf8(%rbp), %rax
movl 0x31e0(%rax), %eax
subl $0x1, %eax
movl %eax, -0x4c(%rbp)
movq -0xf8(%rbp), %rcx
movl -0x4c(%rbp), %eax
cmpl 0x3354(%rcx), %eax
jl 0x6c00b
movq -0xf8(%rbp), %rdi
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x4c(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x58(%rbp), %rsi
callq 0x6e470
movsbl (%rax), %eax
movsbl -0x9(%rbp), %ecx
cmpl %ecx, %eax
jne 0x6bdc1
movq -0xf8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, -0x11d(%rbp)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x4c(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x60(%rbp), %rsi
callq 0x6e470
movb -0x11d(%rbp), %cl
movq -0xf8(%rbp), %rdi
movb %cl, 0x8(%rax)
movl -0x10(%rbp), %eax
movl 0x31e0(%rdi), %ecx
subl -0x4c(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x11c(%rbp)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x4c(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x68(%rbp), %rsi
callq 0x6e470
movl -0x11c(%rbp), %ecx
movl %ecx, 0xc(%rax)
jmp 0x6be99
movq -0xf8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, -0x125(%rbp)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x4c(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x70(%rbp), %rsi
callq 0x6e470
movb -0x125(%rbp), %cl
movq -0xf8(%rbp), %rdi
movb %cl, 0x8(%rax)
movl -0x10(%rbp), %eax
movl 0x31e0(%rdi), %ecx
subl -0x4c(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x124(%rbp)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x4c(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x78(%rbp), %rsi
callq 0x6e470
movl -0x124(%rbp), %edx
movq -0xf8(%rbp), %rcx
movl %edx, 0xc(%rax)
movl -0x10(%rbp), %eax
movl 0x31e0(%rcx), %ecx
subl -0x4c(%rbp), %ecx
subl %ecx, %eax
cmpl $0x0, %eax
jg 0x6be97
movq -0xf8(%rbp), %rdi
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x4c(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x80(%rbp), %rsi
callq 0x6e470
movq -0xf8(%rbp), %rdi
movb $0x6c, 0x8(%rax)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x4c(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x88(%rbp), %rsi
callq 0x6e470
movl $0xb, 0xc(%rax)
jmp 0x6be99
movq -0xf8(%rbp), %rdi
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x4c(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x90(%rbp), %rsi
callq 0x6e470
movq -0xf8(%rbp), %rdi
movsbl 0x8(%rax), %eax
movl %eax, -0x12c(%rbp)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x4c(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x98(%rbp), %rsi
callq 0x6e470
movl -0x12c(%rbp), %ecx
movsbl (%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x126(%rbp)
jne 0x6bf6a
movq -0xf8(%rbp), %rdi
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x4c(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0xa0(%rbp), %rsi
callq 0x6e470
movq -0xf8(%rbp), %rdi
movl 0xc(%rax), %eax
movl %eax, -0x130(%rbp)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0x4c(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0xa8(%rbp), %rsi
callq 0x6e470
movq %rax, %rcx
movl -0x130(%rbp), %eax
cmpl 0x4(%rcx), %eax
setl %al
movb %al, -0x126(%rbp)
movb -0x126(%rbp), %al
testb $0x1, %al
jne 0x6bf79
jmp 0x6bffb
jmp 0x6bf7b
movq 0x9206e(%rip), %rdi     # 0xfdff0
leaq 0x56f5f(%rip), %rsi     # 0xc2ee8
callq 0xa5a0
movq %rax, %rdi
leaq 0x592b9(%rip), %rsi     # 0xc5251
callq 0xa5a0
movq %rax, %rdi
movl $0x218, %esi            # imm = 0x218
callq 0xaa40
movq %rax, %rdi
leaq 0x575ab(%rip), %rsi     # 0xc355f
callq 0xa5a0
movq -0xf8(%rbp), %rdi
movq %rax, -0x138(%rbp)
callq 0x11a70
movq -0x138(%rbp), %rdi
movq %rax, %rsi
callq 0x11d40
movq %rax, %rdi
leaq 0x56f3b(%rip), %rsi     # 0xc2f20
callq 0xa5a0
movq %rax, %rdi
movq 0x91fbc(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x6bffb
jmp 0x6bffd
movl -0x4c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x6bd0f
jmp 0x6c00d
jmp 0x6c00f
movq -0xf8(%rbp), %rax
movl 0x31e0(%rax), %ecx
movl %ecx, 0x3354(%rax)
jmp 0x6c265
movsbl -0x9(%rbp), %eax
cmpl $0x6c, %eax
jne 0x6c0e9
movq -0xf8(%rbp), %rax
movl 0x31e0(%rax), %eax
subl $0x2, %eax
movl %eax, -0xac(%rbp)
movq -0xf8(%rbp), %rcx
movl -0xac(%rbp), %eax
cmpl 0x3354(%rcx), %eax
jl 0x6c0e7
movq -0xf8(%rbp), %rdi
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0xac(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0xb8(%rbp), %rsi
callq 0x6e470
movsbl 0x8(%rax), %eax
movsbl -0x9(%rbp), %ecx
cmpl %ecx, %eax
je 0x6c0d1
movq -0xf8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, -0x139(%rbp)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0xac(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xc0(%rbp), %rsi
callq 0x6e470
movb -0x139(%rbp), %cl
movb %cl, 0x8(%rax)
jmp 0x6c0d3
movl -0xac(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xac(%rbp)
jmp 0x6c04a
jmp 0x6c0e9
movq -0xf8(%rbp), %rax
movl 0x31e0(%rax), %eax
subl $0x2, %eax
movl %eax, -0xc4(%rbp)
movq -0xf8(%rbp), %rcx
movl -0xc4(%rbp), %eax
cmpl 0x3354(%rcx), %eax
jl 0x6c263
movq -0xf8(%rbp), %rax
movq %rax, %rdi
addq $0x31e4, %rdi           # imm = 0x31E4
movl 0x31e0(%rax), %eax
subl $0x1, %eax
cltq
movq %rax, -0xd0(%rbp)
leaq -0xd0(%rbp), %rsi
callq 0x6e470
movq -0xf8(%rbp), %rcx
movl 0xc(%rax), %eax
movl 0x31e0(%rcx), %ecx
subl $0x1, %ecx
subl -0xc4(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0xc8(%rbp)
cmpl $0x0, -0xc8(%rbp)
jle 0x6c1e1
movq -0xf8(%rbp), %rdi
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0xc4(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0xd8(%rbp), %rsi
callq 0x6e470
movsbl 0x8(%rax), %eax
cmpl $0x72, %eax
jne 0x6c1df
movq -0xf8(%rbp), %rdi
movl -0xc8(%rbp), %eax
movl %eax, -0x140(%rbp)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0xc4(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0xe0(%rbp), %rsi
callq 0x6e470
movl -0x140(%rbp), %ecx
movl %ecx, 0xc(%rax)
jmp 0x6c24d
movq -0xf8(%rbp), %rdi
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0xc4(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0xe8(%rbp), %rsi
callq 0x6e470
movq -0xf8(%rbp), %rdi
movb $0x6c, 0x8(%rax)
movl -0xc8(%rbp), %eax
addl $0xb, %eax
movl %eax, -0x144(%rbp)
addq $0x31e4, %rdi           # imm = 0x31E4
movslq -0xc4(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0xf0(%rbp), %rsi
callq 0x6e470
movl -0x144(%rbp), %ecx
movl %ecx, 0xc(%rax)
jmp 0x6c24f
movl -0xc4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x6c0ff
jmp 0x6c265
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nop