user: Please show me the C implementation that matches the assembly code listed below:

```asm
<BattleThree>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %esi,%r12d
  mov    %rcx,%rbp
  lea    (%rsi,%rsi,1),%eax
  cmp    %edi,%eax
  jl     L12
  mov    %rdx,%r13
  cmp    %edi,%esi
  jl     L33
  lea    (%rdi,%rdi,1),%eax
  cmp    %esi,%eax
  jle    L24
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x10fef011,%rdx,%rdx
  sar    $0x24,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0xf1,%edx,%edx
  sub    %edx,%eax
  add    $0xa,%eax
  imul   %ebx,%eax
  movslq %eax,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  sar    $0x25,%rdx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %r12d,%eax
  mov    %eax,0x0(%rbp)
  cmp    $0x5,%ebx
  setg   %dl
  test   %eax,%eax
  setle  %al
  movzbl %al,%eax
  and    %edx,%eax
L48:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L12:
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x2e8ba2e9,%rdx,%rdx
  sar    $0x21,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,4),%ecx
  lea    (%rdx,%rcx,2),%edx
  sub    %edx,%eax
  imul   %ebx,%eax
  movslq %eax,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  sar    $0x25,%rdx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %r12d,%eax
  mov    %eax,0x0(%rbp)
  mov    $0x1,%eax
  jmp    L48
L33:
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x10fef011,%rdx,%rdx
  sar    $0x24,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0xf1,%edx,%edx
  sub    %edx,%eax
  lea    0xa(%rax),%edx
  imul   %r12d,%edx
  movslq %edx,%rax
  imul   $0x51eb851f,%rax,%rax
  sar    $0x25,%rax
  sar    $0x1f,%edx
  sub    %eax,%edx
  add    %ebx,%edx
  mov    %edx,0x0(%r13)
  cmp    $0x5,%r12d
  setg   %al
  test   %edx,%edx
  setle  %dl
  and    %edx,%eax
  xor    $0x1,%eax
  movzbl %al,%eax
  jmp    L48
L24:
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x2e8ba2e9,%rdx,%rdx
  sar    $0x21,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,4),%ecx
  lea    (%rdx,%rcx,2),%edx
  sub    %edx,%eax
  imul   %r12d,%eax
  movslq %eax,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  sar    $0x25,%rdx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ebx,%eax
  mov    %eax,0x0(%r13)
  mov    $0x0,%eax
  jmp    L48
```

assistant: ```c
int BattleThree(int atkForce, int defForce, int *atkSurvivors, int *defSurvivors) {
  if (atkForce > 2 * defForce) {
    *defSurvivors = defForce - (atkForce * (rand() % 11)) / 100;
    return 1;
  } else if (atkForce > defForce) {
    *atkSurvivors = atkForce - (defForce * (10 + rand() % 241)) / 100;
    if ((*atkSurvivors <= 0) && (defForce > 5)) {
      defForce = 5;
      return 0;
    } else
      return 1;
  } else if (defForce >= 2 * atkForce) {
    *atkSurvivors = atkForce - (defForce * (rand() % 11)) / 100;
    return 0;
  } else {
    *defSurvivors = defForce - (atkForce * (10 + rand() % 241)) / 100;
    if ((*defSurvivors <= 0) && (atkForce > 5)) {
      atkForce = 5;
      return 1;
    } else
      return 0;
  }
}
```