// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/dec.c
// Function: TransformOne_C
static void TransformOne_C(const int16_t* in, uint8_t* dst) {
  int C[4 * 4], *tmp;
  int i;
  tmp = C;
  for (i = 0; i < 4; ++i) {    // vertical pass
    const int a = in[0] + in[8];    // [-4096, 4094]
    const int b = in[0] - in[8];    // [-4095, 4095]
    const int c = WEBP_TRANSFORM_AC3_MUL2(in[4]) -
                  WEBP_TRANSFORM_AC3_MUL1(in[12]);  // [-3783, 3783]
    const int d = WEBP_TRANSFORM_AC3_MUL1(in[4]) +
                  WEBP_TRANSFORM_AC3_MUL2(in[12]);  // [-3785, 3781]
    tmp[0] = a + d;   // [-7881, 7875]
    tmp[1] = b + c;   // [-7878, 7878]
    tmp[2] = b - c;   // [-7878, 7878]
    tmp[3] = a - d;   // [-7877, 7879]
    tmp += 4;
    in++;
  }
  // Each pass is expanding the dynamic range by ~3.85 (upper bound).
  // The exact value is (2. + (20091 + 35468) / 65536).
  // After the second pass, maximum interval is [-3794, 3794], assuming
  // an input in [-2048, 2047] interval. We then need to add a dst value
  // in the [0, 255] range.
  // In the worst case scenario, the input to clip_8b() can be as large as
  // [-60713, 60968].
  tmp = C;
  for (i = 0; i < 4; ++i) {    // horizontal pass
    const int dc = tmp[0] + 4;
    const int a =  dc +  tmp[8];
    const int b =  dc -  tmp[8];
    const int c =
        WEBP_TRANSFORM_AC3_MUL2(tmp[4]) - WEBP_TRANSFORM_AC3_MUL1(tmp[12]);
    const int d =
        WEBP_TRANSFORM_AC3_MUL1(tmp[4]) + WEBP_TRANSFORM_AC3_MUL2(tmp[12]);
    STORE(0, 0, a + d);
    STORE(1, 0, b + c);
    STORE(2, 0, b - c);
    STORE(3, 0, a - d);
    tmp++;
    dst += BPS;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
cmpl $0x4, -0x5c(%rbp)
jge 0x14c7ef
movq -0x8(%rbp), %rax
movswl (%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x10(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movswl (%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x10(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x64(%rbp)
movq -0x8(%rbp), %rax
movswl 0x8(%rax), %eax
imull $0x8a8c, %eax, %eax     # imm = 0x8A8C
sarl $0x10, %eax
movq -0x8(%rbp), %rcx
movswl 0x18(%rcx), %ecx
imull $0x4e7b, %ecx, %ecx     # imm = 0x4E7B
sarl $0x10, %ecx
movq -0x8(%rbp), %rdx
movswl 0x18(%rdx), %edx
addl %edx, %ecx
subl %ecx, %eax
movl %eax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movswl 0x8(%rax), %eax
imull $0x4e7b, %eax, %eax     # imm = 0x4E7B
sarl $0x10, %eax
movq -0x8(%rbp), %rcx
movswl 0x8(%rcx), %ecx
addl %ecx, %eax
movq -0x8(%rbp), %rcx
movswl 0x18(%rcx), %ecx
imull $0x8a8c, %ecx, %ecx     # imm = 0x8A8C
sarl $0x10, %ecx
addl %ecx, %eax
movl %eax, -0x6c(%rbp)
movl -0x60(%rbp), %ecx
addl -0x6c(%rbp), %ecx
movq -0x58(%rbp), %rax
movl %ecx, (%rax)
movl -0x64(%rbp), %ecx
addl -0x68(%rbp), %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x64(%rbp), %ecx
subl -0x68(%rbp), %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x60(%rbp), %ecx
subl -0x6c(%rbp), %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x58(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x8(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x14c702
leaq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
cmpl $0x4, -0x5c(%rbp)
jge 0x14c926
movq -0x58(%rbp), %rax
movl (%rax), %eax
addl $0x4, %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
movq -0x58(%rbp), %rcx
addl 0x20(%rcx), %eax
movl %eax, -0x74(%rbp)
movl -0x70(%rbp), %eax
movq -0x58(%rbp), %rcx
subl 0x20(%rcx), %eax
movl %eax, -0x78(%rbp)
movq -0x58(%rbp), %rax
imull $0x8a8c, 0x10(%rax), %eax # imm = 0x8A8C
sarl $0x10, %eax
movq -0x58(%rbp), %rcx
imull $0x4e7b, 0x30(%rcx), %ecx # imm = 0x4E7B
sarl $0x10, %ecx
movq -0x58(%rbp), %rdx
addl 0x30(%rdx), %ecx
subl %ecx, %eax
movl %eax, -0x7c(%rbp)
movq -0x58(%rbp), %rax
imull $0x4e7b, 0x10(%rax), %eax # imm = 0x4E7B
sarl $0x10, %eax
movq -0x58(%rbp), %rcx
addl 0x10(%rcx), %eax
movq -0x58(%rbp), %rcx
imull $0x8a8c, 0x30(%rcx), %ecx # imm = 0x8A8C
sarl $0x10, %ecx
addl %ecx, %eax
movl %eax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %edi
movl -0x74(%rbp), %eax
addl -0x80(%rbp), %eax
sarl $0x3, %eax
addl %eax, %edi
callq 0x14c930
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %edi
movl -0x78(%rbp), %eax
addl -0x7c(%rbp), %eax
sarl $0x3, %eax
addl %eax, %edi
callq 0x14c930
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %edi
movl -0x78(%rbp), %eax
subl -0x7c(%rbp), %eax
sarl $0x3, %eax
addl %eax, %edi
callq 0x14c930
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x2(%rax)
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %edi
movl -0x74(%rbp), %eax
subl -0x80(%rbp), %eax
sarl $0x3, %eax
addl %eax, %edi
callq 0x14c930
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x14c7fe
addq $0x80, %rsp
popq %rbp
retq
nop