I have a 64-bit Mach-O sample that uses the System V AMD64 ABI calling convention (rdi, rsi, rdx, rcx,...); but IDA thinks all the functions are using cdecl. I'm new to IDA scripting but didn't find any information in the docs. My goal is to convert all the function types to:
type __usercall function<rax>(type name0<rdi>, type name1<rsi>, ...)
Related: is there a way to read the arguments and/or number of arguments from the function definition?