How does this represent a low-pass filter?
This is one tortured piece of code. I strongly recommend to toss it and write whatever you need from scratch.
Arguments

N filter order or some design parameter
fft_size: size of the final vector
low_cut: the actual filter impulse Response padded to FFT size

Code

First loop creates a cosine window of length N and bias it with 0.5
2nd loop zero pads to FFT length
3rd loop calcuates the sum of the amplitudes
4th loop divides by the sum and multiplies with -1.
5th loop seems to time reverse the filter (pointless since it's symmetrical) AND copies towards the end of FFT buffer AND also writes past the end of the FFT buffer in the process.
6th loop shift N samples forward by N/2-1 overwriting what was previously in there

What happens exactly here depends on values of N and fft_size and there is some minor low cut behavior in there, but overall it seems  like and extremely convoluted, imprecise and dangerous way of doing a low cut