// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %edx, %edx
js 0x32a68
movsbl %sil, %eax
cmpl $0x72, %eax
je 0x32ab4
cmpl $0x6c, %eax
jne 0x32b99
movslq 0x31e0(%rbx), %r13
leaq 0xc(%rbx), %r14
leal (%rdx,%r13), %r15d
decl %r15d
movq %r13, %rax
shlq $0x4, %rax
leaq (%rbx,%rax), %r12
addq $0x31e0, %r12           # imm = 0x31E0
movslq 0x3354(%rbx), %rax
cmpq %rax, %r13
jle 0x32b99
movb $0x6c, -0x4(%r12)
movl %r15d, %eax
subl 0x31e0(%rbx), %eax
movl %eax, (%r12)
cmpb $0x6c, -0xc(%r12)
jne 0x32a59
cmpl -0x8(%r12), %eax
jge 0x32a59
movq 0x445f0(%rip), %rdi     # 0x76ff0
leaq 0x26569(%rip), %rsi     # 0x58f70
callq 0x94b0
movq %rax, %rdi
leaq 0x2875c(%rip), %rsi     # 0x5b172
callq 0x94b0
movq %rax, %rdi
movl $0x202, %esi            # imm = 0x202
callq 0x9890
movq %rax, %rdi
leaq 0x269ed(%rip), %rsi     # 0x5941f
callq 0x94b0
movq %rax, %rdi
movq %r14, %rsi
callq 0xd465
movq %rax, %rdi
leaq 0x2655c(%rip), %rsi     # 0x58fa8
callq 0x94b0
movq %rax, %rdi
callq 0x99e8
decl %r15d
addq $-0x10, %r12
decq %r13
jmp 0x329c7
movslq 0x31e0(%rbx), %rax
cmpb $0x6c, %sil
jne 0x32bb4
leal -0x2(%rax), %edx
movslq 0x3354(%rbx), %rcx
movslq %edx, %rdx
movq %rdx, %rsi
shlq $0x4, %rsi
addq %rbx, %rsi
addq $0x31ec, %rsi           # imm = 0x31EC
movq %rdx, %rdi
cmpq %rcx, %rdi
jl 0x32bc1
cmpb $0x6c, (%rsi)
je 0x32aab
movb $0x6c, (%rsi)
decq %rdi
addq $-0x10, %rsi
jmp 0x32a9a
movslq 0x31e0(%rbx), %r13
leaq 0xc(%rbx), %r14
leal (%rdx,%r13), %r15d
decl %r15d
movq %r13, %rax
shlq $0x4, %rax
leaq (%rbx,%rax), %r12
addq $0x31e0, %r12           # imm = 0x31E0
movslq 0x3354(%rbx), %rax
cmpq %rax, %r13
jle 0x32b99
movb -0xc(%r12), %al
movb $0x72, -0x4(%r12)
movl 0x31e0(%rbx), %edx
movl %r15d, %ecx
subl %edx, %ecx
cmpb $0x72, %al
jne 0x32b06
movb $0x72, %dl
jmp 0x32b1b
movl %ecx, (%r12)
movb $0x72, %dl
testl %ecx, %ecx
jg 0x32b1f
movb $0x6c, -0x4(%r12)
movb $0x6c, %dl
pushq $0xb
popq %rcx
movl %ecx, (%r12)
cmpb %al, %dl
jne 0x32b8a
cmpl -0x8(%r12), %ecx
jge 0x32b8a
movq 0x444bf(%rip), %rdi     # 0x76ff0
leaq 0x26438(%rip), %rsi     # 0x58f70
callq 0x94b0
movq %rax, %rdi
leaq 0x2862b(%rip), %rsi     # 0x5b172
callq 0x94b0
movq %rax, %rdi
movl $0x218, %esi            # imm = 0x218
callq 0x9890
movq %rax, %rdi
leaq 0x268bc(%rip), %rsi     # 0x5941f
callq 0x94b0
movq %rax, %rdi
movq %r14, %rsi
callq 0xd465
movq %rax, %rdi
leaq 0x2642b(%rip), %rsi     # 0x58fa8
callq 0x94b0
movq %rax, %rdi
callq 0x99e8
decl %r15d
addq $-0x10, %r12
decq %r13
jmp 0x32ad8
movl 0x31e0(%rbx), %eax
movl %eax, 0x3354(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq 0x3354(%rbx), %rcx
leal -0x2(%rax), %edx
movslq %edx, %rdx
movq %rax, %rsi
shlq $0x4, %rsi
addq %rbx, %rsi
addq $0x31e0, %rsi           # imm = 0x31E0
pushq $0x1
popq %rdi
subl %eax, %edi
movq %rdx, %r8
shlq $0x4, %r8
addq %rbx, %r8
addq $0x31ec, %r8            # imm = 0x31EC
cmpq %rcx, %rdx
jl 0x32ba5
movl (%rsi), %r10d
leaq (%rdi,%rdx), %r9
addq %r10, %r9
testl %r9d, %r9d
jle 0x32c04
cmpb $0x72, (%r8)
je 0x32c18
jmp 0x32c1c
movl %edx, %r9d
subl %eax, %r9d
addl %r10d, %r9d
incl %r9d
movb $0x6c, (%r8)
addl $0xb, %r9d
movl %r9d, 0x4(%r8)
decq %rdx
addq $-0x10, %r8
jmp 0x32be8
nop