// File: /workspace/github_cpp_makefile_star2_O1/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
subq $0x18, %rsp
movq %rdi, %rbx
testl %edx, %edx
js 0x3c720
movsbl %sil, %eax
cmpl $0x72, %eax
movl %esi, -0x2c(%rbp)
je 0x3c7ed
cmpl $0x6c, %eax
jne 0x3c91f
movslq 0x31e0(%rbx), %r14
cmpl 0x3354(%rbx), %r14d
jle 0x3c91f
leaq 0xc(%rbx), %rax
movq %rax, -0x38(%rbp)
leal (%r14,%rdx), %r15d
decl %r15d
movq %r14, %rax
shlq $0x4, %rax
leaq (%rax,%rbx), %r12
addq $0x31e0, %r12           # imm = 0x31E0
movb %sil, -0x4(%r12)
movl %r15d, %eax
subl 0x31e0(%rbx), %eax
movl %eax, (%r12)
cmpb %sil, -0xc(%r12)
jne 0x3c701
cmpl -0x8(%r12), %eax
jge 0x3c701
movl $0x13, %edx
movq 0x4a984(%rip), %r13     # 0x86ff0
movq %r13, %rdi
leaq 0x3094a(%rip), %rsi     # 0x6cfc0
callq 0x9560
movl $0x1, %edx
movq %r13, %rdi
leaq 0x32b38(%rip), %rsi     # 0x6f1c2
callq 0x9560
movq %r13, %rdi
movl $0x202, %esi            # imm = 0x202
callq 0x9880
movq %rax, %r13
movl $0x3, %edx
movq %rax, %rdi
leaq 0x30dd1(%rip), %rsi     # 0x6d47f
callq 0x9560
movq %r13, %rdi
movq -0x38(%rbp), %rsi
callq 0xea74
movq %rax, %r13
movl $0x1e, %edx
movq %rax, %rdi
leaq 0x30927(%rip), %rsi     # 0x6cff8
callq 0x9560
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r13, %rdi
callq 0x9070
movq %rax, %rdi
callq 0x9330
movl -0x2c(%rbp), %esi
decq %r14
movslq 0x3354(%rbx), %rax
decl %r15d
addq $-0x10, %r12
cmpq %rax, %r14
jg 0x3c638
jmp 0x3c91f
cmpb $0x6c, %sil
jne 0x3c761
movslq 0x31e0(%rbx), %rdx
leal -0x2(%rdx), %ecx
movslq 0x3354(%rbx), %rax
cmpl %eax, %ecx
jl 0x3c761
leaq -0x1(%rdx), %rcx
shlq $0x4, %rdx
addq %rbx, %rdx
addq $0x31cc, %rdx           # imm = 0x31CC
cmpb $0x6c, (%rdx)
je 0x3c755
movb %sil, (%rdx)
decq %rcx
addq $-0x10, %rdx
cmpq %rax, %rcx
jg 0x3c74d
movslq 0x31e0(%rbx), %rax
leal -0x2(%rax), %edx
movslq 0x3354(%rbx), %rcx
cmpl %ecx, %edx
jl 0x3c92b
leaq -0x1(%rax), %rdx
movq %rdx, %rsi
shlq $0x4, %rsi
addq %rbx, %rsi
addq $0x31f0, %rsi           # imm = 0x31F0
leaq -0x2(%rax), %rdi
movq %rax, %r8
shlq $0x4, %r8
addq %rbx, %r8
addq $0x31cc, %r8            # imm = 0x31CC
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl (%rsi), %r11d
leal (%r9,%r11), %r10d
testl %r10d, %r10d
jle 0x3c7be
cmpb $0x72, (%r8)
je 0x3c7d2
jmp 0x3c7d6
movl %edi, %r10d
subl %eax, %r10d
addl %r11d, %r10d
incl %r10d
movb $0x6c, (%r8)
addl $0xb, %r10d
movl %r10d, 0x4(%r8)
decq %rdi
decl %r9d
decq %rdx
addq $-0x10, %r8
cmpq %rcx, %rdx
jg 0x3c7aa
jmp 0x3c92b
movslq 0x31e0(%rbx), %r15
cmpl 0x3354(%rbx), %r15d
jle 0x3c91f
leaq 0xc(%rbx), %rax
movq %rax, -0x38(%rbp)
leal (%r15,%rdx), %r12d
decl %r12d
movq %r15, %rax
shlq $0x4, %rax
leaq (%rax,%rbx), %r14
addq $0x31e0, %r14           # imm = 0x31E0
movb -0xc(%r14), %al
movb %sil, -0x4(%r14)
movl 0x31e0(%rbx), %ecx
movl %r12d, %edx
subl %ecx, %edx
cmpb $0x72, %al
je 0x3c84a
movl %edx, (%r14)
testl %edx, %edx
jg 0x3c84d
movb $0x6c, -0x4(%r14)
movl $0xb, %edx
movl %edx, (%r14)
cmpb %al, -0x4(%r14)
jne 0x3c905
movl (%r14), %eax
cmpl -0x8(%r14), %eax
jge 0x3c905
movl $0x13, %edx
movq 0x4a780(%rip), %r13     # 0x86ff0
movq %r13, %rdi
leaq 0x30746(%rip), %rsi     # 0x6cfc0
callq 0x9560
movl $0x1, %edx
movq %r13, %rdi
leaq 0x32934(%rip), %rsi     # 0x6f1c2
callq 0x9560
movq %r13, %rdi
movl $0x218, %esi            # imm = 0x218
callq 0x9880
movq %rax, %r13
movl $0x3, %edx
movq %rax, %rdi
leaq 0x30bcd(%rip), %rsi     # 0x6d47f
callq 0x9560
movq %r13, %rdi
movq -0x38(%rbp), %rsi
callq 0xea74
movq %rax, %r13
movl $0x1e, %edx
movq %rax, %rdi
leaq 0x30723(%rip), %rsi     # 0x6cff8
callq 0x9560
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r13, %rdi
callq 0x9070
movq %rax, %rdi
callq 0x9330
movl -0x2c(%rbp), %esi
decq %r15
movslq 0x3354(%rbx), %rax
decl %r12d
addq $-0x10, %r14
cmpq %rax, %r15
jg 0x3c822
movl 0x31e0(%rbx), %eax
movl %eax, 0x3354(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq