// File: /workspace/github_cpp_makefile_star2_O3/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 0x3b735
movsbl %sil, %eax
cmpl $0x72, %eax
je 0x3b78a
cmpl $0x6c, %eax
jne 0x3b8c6
movslq 0x31e0(%rbx), %r13
movl 0x3354(%rbx), %eax
cmpl %eax, %r13d
jle 0x3b8c6
leaq 0xc(%rbx), %rcx
movq %rcx, -0x30(%rbp)
leal (%rdx,%r13), %r14d
decl %r14d
movq %r13, %rcx
shlq $0x4, %rcx
leaq (%rcx,%rbx), %r15
addq $0x31e0, %r15           # imm = 0x31E0
movb $0x6c, -0x4(%r15)
movl %r14d, %ecx
subl 0x31e0(%rbx), %ecx
movl %ecx, (%r15)
cmpb $0x6c, -0xc(%r15)
jne 0x3b71a
cmpl -0x8(%r15), %ecx
jge 0x3b71a
movl $0x13, %edx
movq 0x4896e(%rip), %r12     # 0x83ff0
movq %r12, %rdi
leaq 0x2f924(%rip), %rsi     # 0x6afb0
callq 0x9560
movl $0x1, %edx
movq %r12, %rdi
leaq 0x31af2(%rip), %rsi     # 0x6d192
callq 0x9560
movq %r12, %rdi
movl $0x202, %esi            # imm = 0x202
callq 0x9880
movq %rax, %r12
movl $0x3, %edx
movq %rax, %rdi
leaq 0x2fd93(%rip), %rsi     # 0x6b457
callq 0x9560
movq %r12, %rdi
movq -0x30(%rbp), %rsi
callq 0xe974
movq %rax, %r12
movl $0x1e, %edx
movq %rax, %rdi
leaq 0x2f901(%rip), %rsi     # 0x6afe8
callq 0x9560
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r12, %rdi
callq 0x9070
movq %rax, %rdi
callq 0x9330
movl 0x3354(%rbx), %eax
decq %r13
movslq %eax, %rcx
decl %r14d
addq $-0x10, %r15
cmpq %rcx, %r13
jg 0x3b650
jmp 0x3b8c6
movslq 0x31e0(%rbx), %rax
cmpb $0x6c, %sil
jne 0x3b8d4
leal -0x2(%rax), %ecx
movl 0x3354(%rbx), %esi
cmpl %esi, %ecx
jl 0x3b8dd
movslq %esi, %rdx
leaq -0x1(%rax), %rdi
movq %rax, %r8
shlq $0x4, %r8
addq %rbx, %r8
addq $0x31cc, %r8            # imm = 0x31CC
cmpb $0x6c, (%r8)
je 0x3b779
movb $0x6c, (%r8)
decq %rdi
addq $-0x10, %r8
cmpq %rdx, %rdi
jg 0x3b76f
jmp 0x3b8dd
movslq 0x31e0(%rbx), %r13
movl 0x3354(%rbx), %eax
cmpl %eax, %r13d
jle 0x3b8c6
leaq 0xc(%rbx), %rcx
movq %rcx, -0x30(%rbp)
leal (%rdx,%r13), %r14d
decl %r14d
movq %r13, %rcx
shlq $0x4, %rcx
leaq (%rcx,%rbx), %r15
addq $0x31e0, %r15           # imm = 0x31E0
movb -0xc(%r15), %cl
movb $0x72, -0x4(%r15)
movl 0x31e0(%rbx), %esi
movl %r14d, %edx
subl %esi, %edx
cmpb $0x72, %cl
jne 0x3b7df
movb $0x72, %sil
jmp 0x3b7f6
movl %edx, (%r15)
movb $0x72, %sil
testl %edx, %edx
jg 0x3b7f9
movb $0x6c, -0x4(%r15)
movb $0x6c, %sil
movl $0xb, %edx
movl %edx, (%r15)
cmpb %cl, %sil
jne 0x3b8b0
cmpl -0x8(%r15), %edx
jge 0x3b8b0
movl $0x13, %edx
movq 0x487d8(%rip), %r12     # 0x83ff0
movq %r12, %rdi
leaq 0x2f78e(%rip), %rsi     # 0x6afb0
callq 0x9560
movl $0x1, %edx
movq %r12, %rdi
leaq 0x3195c(%rip), %rsi     # 0x6d192
callq 0x9560
movq %r12, %rdi
movl $0x218, %esi            # imm = 0x218
callq 0x9880
movq %rax, %r12
movl $0x3, %edx
movq %rax, %rdi
leaq 0x2fbfd(%rip), %rsi     # 0x6b457
callq 0x9560
movq %r12, %rdi
movq -0x30(%rbp), %rsi
callq 0xe974
movq %rax, %r12
movl $0x1e, %edx
movq %rax, %rdi
leaq 0x2f76b(%rip), %rsi     # 0x6afe8
callq 0x9560
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r12, %rdi
callq 0x9070
movq %rax, %rdi
callq 0x9330
movl 0x3354(%rbx), %eax
decq %r13
movslq %eax, %rcx
decl %r14d
addq $-0x10, %r15
cmpq %rcx, %r13
jg 0x3b7c1
movl 0x31e0(%rbx), %eax
movl %eax, 0x3354(%rbx)
jmp 0x3b94c
movl 0x3354(%rbx), %esi
leal -0x2(%rax), %ecx
cmpl %esi, %ecx
jl 0x3b94c
movq %rax, %r8
shlq $0x4, %r8
leaq (%r8,%rbx), %rcx
addq $0x31e0, %rcx           # imm = 0x31E0
leaq -0x2(%rax), %rdx
movslq %esi, %rsi
leaq -0x1(%rax), %rdi
addq %rbx, %r8
addq $0x31cc, %r8            # imm = 0x31CC
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl (%rcx), %r11d
leal (%r9,%r11), %r10d
testl %r10d, %r10d
jle 0x3b922
cmpb $0x72, (%r8)
je 0x3b936
jmp 0x3b93a
movl %edx, %r10d
subl %eax, %r10d
addl %r11d, %r10d
incl %r10d
movb $0x6c, (%r8)
addl $0xb, %r10d
movl %r10d, 0x4(%r8)
decq %rdx
decl %r9d
decq %rdi
addq $-0x10, %r8
cmpq %rsi, %rdi
jg 0x3b90e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop