Skip to content

Instantly share code, notes, and snippets.

@Lusamine
Last active January 3, 2023 16:56
Show Gist options
  • Save Lusamine/3dcf938801701d5f32dc2e0187693fdf to your computer and use it in GitHub Desktop.
Save Lusamine/3dcf938801701d5f32dc2e0187693fdf to your computer and use it in GitHub Desktop.
__int64 __fastcall btl_get_capture_value_coefficient(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v6; // x0
__int64 v7; // x0
__int64 v8; // x0
__int64 v9; // x0
__int64 v10; // x0
float v11; // s8
__int64 v12; // x0
__int64 v13; // x0
float v14; // s0
float v15; // s1
unsigned int v17; // w21
v6 = sub_71010F0F80(a1);
if ( sub_710167973C(v6) )
{
v17 = (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a2 + 280LL))(a2);
if ( v17 < (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a3 + 280LL))(a3) )
return 410LL;
}
v7 = sub_71010F0F80(a1);
v8 = sub_7101102144(v7);
if ( sub_7101679734(v8) <= 0.0 )
return 4096LL;
v9 = sub_71010F0F80(a1);
v10 = sub_7101102144(v9);
v11 = sub_7101679734(v10);
v12 = sub_71010F0F80(a1);
v13 = sub_7101102144(v12);
v14 = sub_7101679734(v13) * 4096.0;
v15 = -0.5;
if ( v11 > 0.0 )
v15 = 0.5;
return (unsigned int)(int)(float)(v15 + v14);
}
=====
.text:0000007101679658
.text:0000007101679658 ; =============== S U B R O U T I N E =======================================
.text:0000007101679658
.text:0000007101679658 ; Attributes: bp-based frame
.text:0000007101679658
.text:0000007101679658 ; __int64 __fastcall btl_get_capture_value_coefficient(__int64, __int64, __int64)
.text:0000007101679658 btl_get_capture_value_coefficient ; CODE XREF: sub_7101765648+18C↓p
.text:0000007101679658
.text:0000007101679658 var_8 = -8
.text:0000007101679658 var_s0 = 0
.text:0000007101679658 var_s10 = 0x10
.text:0000007101679658 var_s18 = 0x18
.text:0000007101679658
.text:0000007101679658 STR D8, [SP,#-0x28+var_8]!
.text:000000710167965C STP X29, X30, [SP,#8+var_s0]
.text:0000007101679660 ADD X29, SP, #8
.text:0000007101679664 STR X21, [SP,#8+var_s10]
.text:0000007101679668 STP X20, X19, [SP,#8+var_s18]
.text:000000710167966C MOV X20, X2
.text:0000007101679670 MOV X21, X1
.text:0000007101679674 MOV X19, X0
.text:0000007101679678 BL sub_71010F0F80
.text:000000710167967C BL sub_710167973C
.text:0000007101679680 TBNZ W0, #0, loc_71016796F8
.text:0000007101679684
.text:0000007101679684 loc_7101679684 ; CODE XREF: btl_get_capture_value_coefficient+C8↓j
.text:0000007101679684 MOV X0, X19
.text:0000007101679688 BL sub_71010F0F80
.text:000000710167968C BL sub_7101102144
.text:0000007101679690 BL sub_7101679734
.text:0000007101679694 FCMP S0, #0.0
.text:0000007101679698 B.LE loc_710167972C
.text:000000710167969C MOV X0, X19
.text:00000071016796A0 BL sub_71010F0F80
.text:00000071016796A4 BL sub_7101102144
.text:00000071016796A8 BL sub_7101679734
.text:00000071016796AC MOV X0, X19
.text:00000071016796B0 MOV V8.16B, V0.16B
.text:00000071016796B4 BL sub_71010F0F80
.text:00000071016796B8 BL sub_7101102144
.text:00000071016796BC BL sub_7101679734
.text:00000071016796C0 MOV W8, #0x45800000
.text:00000071016796C4 FMOV S1, W8
.text:00000071016796C8 FMUL S0, S0, S1
.text:00000071016796CC FCMP S8, #0.0
.text:00000071016796D0 FMOV S1, #-0.5
.text:00000071016796D4 FMOV S2, #0.5
.text:00000071016796D8 FCSEL S1, S2, S1, GT
.text:00000071016796DC FADD S0, S1, S0
.text:00000071016796E0 FCVTZS W0, S0
.text:00000071016796E4
.text:00000071016796E4 loc_71016796E4 ; CODE XREF: btl_get_capture_value_coefficient+D0↓j
.text:00000071016796E4 ; btl_get_capture_value_coefficient+D8↓j
.text:00000071016796E4 LDP X20, X19, [SP,#8+var_s18]
.text:00000071016796E8 LDR X21, [SP,#8+var_s10]
.text:00000071016796EC LDP X29, X30, [SP,#8+var_s0]
.text:00000071016796F0 LDR D8, [SP+8+var_8],#0x30
.text:00000071016796F4 RET
.text:00000071016796F8 ; ---------------------------------------------------------------------------
.text:00000071016796F8
.text:00000071016796F8 loc_71016796F8 ; CODE XREF: btl_get_capture_value_coefficient+28↑j
.text:00000071016796F8 LDR X8, [X21]
.text:00000071016796FC MOV X0, X21
.text:0000007101679700 LDR X8, [X8,#0x118]
.text:0000007101679704 BLR X8
.text:0000007101679708 LDR X8, [X20]
.text:000000710167970C AND W21, W0, #0xFF
.text:0000007101679710 MOV X0, X20
.text:0000007101679714 LDR X8, [X8,#0x118]
.text:0000007101679718 BLR X8
.text:000000710167971C CMP W21, W0,UXTB
.text:0000007101679720 B.CS loc_7101679684
.text:0000007101679724 MOV W0, #0x19A
.text:0000007101679728 B loc_71016796E4
.text:000000710167972C ; ---------------------------------------------------------------------------
.text:000000710167972C
.text:000000710167972C loc_710167972C ; CODE XREF: btl_get_capture_value_coefficient+40↑j
.text:000000710167972C MOV W0, #0x1000
.text:0000007101679730 B loc_71016796E4
.text:0000007101679730 ; End of function btl_get_capture_value_coefficient
.text:0000007101679730
=====
// This is populated somewhere else, and fetches a float value for the backstrike and/or Meal Powers
float __fastcall sub_7101679734(__int64 a1)
{
return *(a1 + 1216);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment