Both source code and machine code are treated the same as literary works in the US. With machine code only having an deviation from this in that it is assumed unintelligible for people to understand on its own.
Whelan Assocs. v. Jaslow Dental Lab. (3d Cir. 1986) — extended protection beyond literal code to a program's "structure, sequence and organization
And Computer Associates Int'l v. Altai (2d Cir. 1992) only over rules that with assumption of clean room building, where one person studies the code, writes a spec stripped of those elements, patented ideas, and other assets, then gives that to someone who can reasonably say they that they're implementation of the spec won't be based on those copy written elements
AI produced code is unsettled but I was expressing my opinion on the hypocracy