#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ bound(double *, int /*<<< orphan*/, double);
void adjustStrength(const int aCount, const int bCount, double *aStrength,
                    double *bStrength) {
  if (aCount == bCount) {
    return;
  }
  double adjustment = 0.005 * ((double)aCount - (double)bCount);
  *aStrength -= adjustment / 2.0;
  *bStrength += adjustment / 2.0;
  bound(aStrength, 0, 1.0);
  bound(bStrength, 0, 1.0);
}


x86 assembly (clang, -O0):
<adjustStrength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1137 <adjustStrength+0x27>
jmp    11ba <adjustStrength+0xaa>
cvtsi2sdl -0x4(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
subsd  %xmm0,%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  0xea5(%rip),%xmm0
divsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
movsd  0xe84(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
movsd  0xe5e(%rip),%xmm0
call   1030 <bound@plt>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
movsd  0xe4b(%rip),%xmm0
call   1030 <bound@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjustStrength>:
cmp    %esi,%edi
jne    1115 <adjustStrength+0x5>
ret
push   %rbx
mov    %rcx,%rbx
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xed3(%rip),%xmm0
mulsd  0xed3(%rip),%xmm0
movsd  (%rdx),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx)
addsd  (%rcx),%xmm0
movsd  %xmm0,(%rcx)
movsd  0xebf(%rip),%xmm0
mov    %rdx,%rdi
xor    %esi,%esi
call   1030 <bound@plt>
mov    %rbx,%rdi
xor    %esi,%esi
movsd  0xea8(%rip),%xmm0
pop    %rbx
jmp    1030 <bound@plt>

LLVM IR (-O0):
define void @adjustStrength(i32 %0, i32 %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %4
br label %35
14: ; preds = %4
%15 = load i32, i32* %5
%16 = sitofp i32 %15 to double
%17 = load i32, i32* %6
%18 = sitofp i32 %17 to double
%19 = fsub double %16, %18
%20 = fmul double 5.000000e-03, %19
store double %20, double* %9
%21 = load double, double* %9
%22 = fdiv double %21, 2.000000e+00
%23 = load double*, double** %7
%24 = load double, double* %23
%25 = fsub double %24, %22
store double %25, double* %23
%26 = load double, double* %9
%27 = fdiv double %26, 2.000000e+00
%28 = load double*, double** %8
%29 = load double, double* %28
%30 = fadd double %29, %27
store double %30, double* %28
%31 = load double*, double** %7
%32 = call i32 @bound(double* %31, i32 0, double 1.000000e+00)
%33 = load double*, double** %8
%34 = call i32 @bound(double* %33, i32 0, double 1.000000e+00)
br label %35
35: ; preds = %14, %13
ret void
}

LLVM IR (-O2):
define void @adjustStrength(i32 %0, i32 %1, double* %2, double* %3) {
%5 = icmp eq i32 %0, %1
br i1 %5, label %18, label %6
6: ; preds = %4
%7 = sitofp i32 %0 to double
%8 = sitofp i32 %1 to double
%9 = fsub double %7, %8
%10 = fmul double %9, 5.000000e-03
%11 = fmul double %10, 5.000000e-01
%12 = load double, double* %2
%13 = fsub double %12, %11
store double %13, double* %2
%14 = load double, double* %3
%15 = fadd double %11, %14
store double %15, double* %3
%16 = tail call i32 @bound(double* %2, i32 0, double 1.000000e+00)
%17 = tail call i32 @bound(double* %3, i32 0, double 1.000000e+00)
br label %18
18: ; preds = %4, %6
ret void
}