COMP
PROPERTY CS_FIXED_BLOCK_WIDTH 1
PROPERTY CS_FIXED_BLOCK_HEIGHT 1
PROPERTY CS_FIXED_BLOCK_DEPTH 1
DCL BUFFER[0]
DCL BUFFER[1]
DCL BUFFER[2]
DCL CONST[0][0..2]
DCL TEMP[0..5]
IMM[0] UINT32 {0, 31, 2147483647, 4294967295}
IMM[1] UINT32 {1, 2, 4, 8}
IMM[2] UINT32 {16, 32, 64, 128}
IMM[3] UINT32 {1000000, 0, %u, 0}
IMM[4] UINT32 {256, 0, 0, 0}
AND TEMP[5], CONST[0][0].wwww, IMM[2].xxxx
UIF TEMP[5]
UADD TEMP[1].x, CONST[0][1].xxxx, CONST[0][2].xxxx
LOAD TEMP[1].x, BUFFER[0], TEMP[1].xxxx
ISHR TEMP[0].z, TEMP[1].xxxx, IMM[0].yyyy
MOV TEMP[1], TEMP[0].zzzz
NOT TEMP[0].z, TEMP[0].zzzz
UIF TEMP[1]
UADD TEMP[0].x, IMM[0].xxxx, CONST[0][2].xxxx
LOAD TEMP[0].xy, BUFFER[0], TEMP[0].xxxx
ENDIF
ELSE
MOV TEMP[0], IMM[0].xxxx
AND TEMP[4], CONST[0][0].wwww, IMM[1].xxxx
UIF TEMP[4]
LOAD TEMP[0].xyz, BUFFER[1], IMM[0].xxxx
ENDIF
MOV TEMP[1].x, IMM[0].xxxx
BGNLOOP
UIF TEMP[0].zzzz
BRK
ENDIF
USGE TEMP[5], TEMP[1].xxxx, CONST[0][0].zzzz
UIF TEMP[5]
BRK
ENDIF
UMAD TEMP[5].x, TEMP[1].xxxx, CONST[0][0].yyyy, CONST[0][1].xxxx
UADD TEMP[5].x, TEMP[5].xxxx, CONST[0][2].xxxx
LOAD TEMP[5].x, BUFFER[0], TEMP[5].xxxx
ISHR TEMP[0].z, TEMP[5].xxxx, IMM[0].yyyy
NOT TEMP[0].z, TEMP[0].zzzz
UIF TEMP[0].zzzz
BRK
ENDIF
MOV TEMP[1].y, IMM[0].xxxx
BGNLOOP
UMUL TEMP[5].x, TEMP[1].xxxx, CONST[0][0].yyyy
UMAD TEMP[5].x, TEMP[1].yyyy, CONST[0][1].yyyy, TEMP[5].xxxx
UADD TEMP[5].x, TEMP[5].xxxx, CONST[0][2].xxxx
LOAD TEMP[2].xy, BUFFER[0], TEMP[5].xxxx
UADD TEMP[5].y, TEMP[5].xxxx, CONST[0][0].xxxx
LOAD TEMP[3].xy, BUFFER[0], TEMP[5].yyyy
U64ADD TEMP[4].xy, TEMP[3], -TEMP[2]
AND TEMP[5].z, CONST[0][0].wwww, IMM[4].xxxx
UIF TEMP[5].zzzz
UADD TEMP[5].xy, TEMP[5], IMM[1].wwww
LOAD TEMP[2].xy, BUFFER[0], TEMP[5].xxxx
LOAD TEMP[3].xy, BUFFER[0], TEMP[5].yyyy
U64ADD TEMP[3].xy, TEMP[3], -TEMP[2]
U64ADD TEMP[4].xy, TEMP[4], -TEMP[3]
ENDIF
U64ADD TEMP[0].xy, TEMP[0], TEMP[4]
UADD TEMP[1].y, TEMP[1].yyyy, IMM[1].xxxx
USGE TEMP[5], TEMP[1].yyyy, CONST[0][1].zzzz
UIF TEMP[5]
BRK
ENDIF
ENDLOOP
UADD TEMP[1].x, TEMP[1].xxxx, IMM[1].xxxx
ENDLOOP
ENDIF
AND TEMP[4], CONST[0][0].wwww, IMM[1].yyyy
UIF TEMP[4]
STORE BUFFER[2].xyz, CONST[0][1].wwww, TEMP[0]
ELSE
AND TEMP[4], CONST[0][0].wwww, IMM[1].zzzz
UIF TEMP[4]
NOT TEMP[0].z, TEMP[0]
AND TEMP[0].z, TEMP[0].zzzz, IMM[1].xxxx
STORE BUFFER[2].x, CONST[0][1].wwww, TEMP[0].zzzz
AND TEMP[4], CONST[0][0].wwww, IMM[2].zzzz
UIF TEMP[4]
STORE BUFFER[2].y, CONST[0][1].wwww, IMM[0].xxxx
ENDIF
ELSE
NOT TEMP[4], TEMP[0].zzzz
UIF TEMP[4]
AND TEMP[4], CONST[0][0].wwww, IMM[2].yyyy
UIF TEMP[4]
U64MUL TEMP[0].xy, TEMP[0], IMM[3].xyxy
U64DIV TEMP[0].xy, TEMP[0], IMM[3].zwzw
ENDIF
AND TEMP[4], CONST[0][0].wwww, IMM[1].wwww
UIF TEMP[4]
U64SNE TEMP[0].x, TEMP[0].xyxy, IMM[4].zwzw
AND TEMP[0].x, TEMP[0].xxxx, IMM[1].xxxx
MOV TEMP[0].y, IMM[0].xxxx
ENDIF
AND TEMP[4], CONST[0][0].wwww, IMM[2].zzzz
UIF TEMP[4]
STORE BUFFER[2].xy, CONST[0][1].wwww, TEMP[0].xyxy
ELSE
UIF TEMP[0].yyyy
MOV TEMP[0].x, IMM[0].wwww
ENDIF
AND TEMP[4], CONST[0][0].wwww, IMM[2].wwww
UIF TEMP[4]
UMIN TEMP[0].x, TEMP[0].xxxx, IMM[0].zzzz
ENDIF
STORE BUFFER[2].x, CONST[0][1].wwww, TEMP[0].xxxx
ENDIF
ENDIF
ENDIF
ENDIF
END
