4 .type __clone, %function
13 # ctid) g = *(r15+168)
16 # tid = syscall(SYS_clone,b,c,e,g,f);
17 # if (!tid) syscall(SYS_exit, a(d));
20 # preserve call-saved register used as syscall arg
23 # create initial stack frame for new thread
29 # save fn and arg to child stack
33 # shuffle args into correct registers and call SYS_clone
41 # restore call-saved register
44 # if error or if we're the parent, return
48 # we're the child. call fn(arg)
53 # call SYS_exit. exit code is already in r2 from fn return value