#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
unsigned int LowPassMul(unsigned short, unsigned int, int *);
int /*<<< orphan*/ deNoiseSpacial(unsigned char *, unsigned char *,
                                  unsigned int *, int, int, int, int, int *,
                                  int *);
int /*<<< orphan*/ deNoiseTemporal(unsigned char *, unsigned char *,
                                   unsigned short *, int, int, int, int, int *);
scalar_t__ malloc(int);
void deNoise(unsigned char *Frame, unsigned char *FrameDest,
             unsigned int *LineAnt, unsigned short **FrameAntPtr, int W, int H,
             int sStride, int dStride, int *Horizontal, int *Vertical,
             int *Temporal) {
  long X, Y;
  long sLineOffs = 0, dLineOffs = 0;
  unsigned int PixelAnt;
  unsigned int PixelDst;
  unsigned short *FrameAnt = (*FrameAntPtr);
  if (!FrameAnt) {
    (*FrameAntPtr) = FrameAnt =
        (unsigned short *)malloc(W * H * sizeof(unsigned short));
    for (Y = 0; Y < H; Y++) {
      unsigned short *dst = &FrameAnt[Y * W];
      unsigned char *src = Frame + Y * sStride;
      for (X = 0; X < W; X++)
        dst[X] = src[X] << 8;
    }
  }
  if (!Horizontal[0] && !Vertical[0]) {
    deNoiseTemporal(Frame, FrameDest, FrameAnt, W, H, sStride, dStride,
                    Temporal);
    return;
  }
  if (!Temporal[0]) {
    deNoiseSpacial(Frame, FrameDest, LineAnt, W, H, sStride, dStride,
                   Horizontal, Vertical);
    return;
  }
  LineAnt[0] = PixelAnt = Frame[0] << 16;
  PixelDst = LowPassMul(FrameAnt[0] << 8, PixelAnt, Temporal);
  FrameAnt[0] = ((PixelDst + 0x1000007F) >> 8);
  FrameDest[0] = ((PixelDst + 0x10007FFF) >> 16);
  for (X = 1; X < W; X++) {
    LineAnt[X] = PixelAnt = LowPassMul(PixelAnt, Frame[X] << 16, Horizontal);
    PixelDst = LowPassMul(FrameAnt[X] << 8, PixelAnt, Temporal);
    FrameAnt[X] = ((PixelDst + 0x1000007F) >> 8);
    FrameDest[X] = ((PixelDst + 0x10007FFF) >> 16);
  }
  for (Y = 1; Y < H; Y++) {
    unsigned int PixelAnt;
    unsigned short *LinePrev = &FrameAnt[Y * W];
    sLineOffs += sStride, dLineOffs += dStride;
    PixelAnt = Frame[sLineOffs] << 16;
    LineAnt[0] = LowPassMul(LineAnt[0], PixelAnt, Vertical);
    PixelDst = LowPassMul(LinePrev[0] << 8, LineAnt[0], Temporal);
    LinePrev[0] = ((PixelDst + 0x1000007F) >> 8);
    FrameDest[dLineOffs] = ((PixelDst + 0x10007FFF) >> 16);
    for (X = 1; X < W; X++) {
      unsigned int PixelDst;
      PixelAnt = LowPassMul(PixelAnt, Frame[sLineOffs + X] << 16, Horizontal);
      LineAnt[X] = LowPassMul(LineAnt[X], PixelAnt, Vertical);
      PixelDst = LowPassMul(LinePrev[X] << 8, LineAnt[X], Temporal);
      LinePrev[X] = ((PixelDst + 0x1000007F) >> 8);
      FrameDest[dLineOffs + X] = ((PixelDst + 0x10007FFF) >> 16);
    }
  }
}


x86 assembly (clang, -O0):
<deNoise>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    126b <deNoise+0x12b>
mov    -0x24(%rbp),%eax
imul   -0x28(%rbp),%eax
cltq
shl    $0x1,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%rcx
mov    %rcx,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
cmp    %rcx,%rax
jge    1266 <deNoise+0x126>
mov    -0x58(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq -0x24(%rbp),%rdx
imul   %rdx,%rcx
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq 0x10(%rbp),%rdx
imul   %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmp    %rcx,%rax
jge    1250 <deNoise+0x110>
mov    -0x68(%rbp),%rax
mov    -0x30(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
mov    %ax,%dx
mov    -0x60(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1210 <deNoise+0xd0>
jmp    1255 <deNoise+0x115>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11c5 <deNoise+0x85>
jmp    126b <deNoise+0x12b>
mov    0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jne    12b7 <deNoise+0x177>
mov    0x28(%rbp),%rax
cmpl   $0x0,(%rax)
jne    12b7 <deNoise+0x177>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    0x10(%rbp),%r9d
mov    0x18(%rbp),%r10d
mov    0x30(%rbp),%rax
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <deNoiseTemporal@plt>
jmp    15b3 <deNoise+0x473>
mov    0x30(%rbp),%rax
cmpl   $0x0,(%rax)
jne    12ff <deNoise+0x1bf>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    0x10(%rbp),%r9d
mov    0x18(%rbp),%r11d
mov    0x20(%rbp),%r10
mov    0x28(%rbp),%rax
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1060 <deNoiseSpacial@plt>
jmp    15b3 <deNoise+0x473>
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
shl    $0x10,%ecx
mov    %ecx,-0x4c(%rbp)
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x58(%rbp),%rax
movzwl (%rax),%eax
shl    $0x8,%eax
mov    -0x4c(%rbp),%esi
mov    0x30(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
add    $0x1000007f,%eax
shr    $0x8,%eax
mov    %ax,%cx
mov    -0x58(%rbp),%rax
mov    %cx,(%rax)
mov    -0x50(%rbp),%eax
add    $0x10007fff,%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movq   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmp    %rcx,%rax
jge    1401 <deNoise+0x2c1>
mov    -0x4c(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0x30(%rbp),%rdx
movzbl (%rcx,%rdx,1),%esi
shl    $0x10,%esi
mov    0x20(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,%edx
mov    %edx,-0x4c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x58(%rbp),%rax
mov    -0x30(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
shl    $0x8,%eax
mov    -0x4c(%rbp),%esi
mov    0x30(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
add    $0x1000007f,%eax
shr    $0x8,%eax
mov    %ax,%dx
mov    -0x58(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x50(%rbp),%eax
add    $0x10007fff,%eax
shr    $0x10,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    135e <deNoise+0x21e>
movq   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
cmp    %rcx,%rax
jge    15b3 <deNoise+0x473>
mov    -0x58(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq -0x24(%rbp),%rdx
imul   %rdx,%rcx
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
movslq 0x10(%rbp),%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
movslq 0x18(%rbp),%rax
add    -0x48(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x10,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x6c(%rbp),%esi
mov    0x28(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x78(%rbp),%rax
movzwl (%rax),%eax
shl    $0x8,%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%esi
mov    0x30(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
add    $0x1000007f,%eax
shr    $0x8,%eax
mov    %ax,%cx
mov    -0x78(%rbp),%rax
mov    %cx,(%rax)
mov    -0x50(%rbp),%eax
add    $0x10007fff,%eax
shr    $0x10,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movq   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmp    %rcx,%rax
jge    159d <deNoise+0x45d>
mov    -0x6c(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0x40(%rbp),%rdx
add    -0x30(%rbp),%rdx
movzbl (%rcx,%rdx,1),%esi
shl    $0x10,%esi
mov    0x20(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x6c(%rbp),%esi
mov    0x28(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x78(%rbp),%rax
mov    -0x30(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
shl    $0x8,%eax
mov    -0x18(%rbp),%rcx
mov    -0x30(%rbp),%rdx
mov    (%rcx,%rdx,4),%esi
mov    0x30(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
add    $0x1000007f,%eax
shr    $0x8,%eax
mov    %ax,%dx
mov    -0x78(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x7c(%rbp),%eax
add    $0x10007fff,%eax
shr    $0x10,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x48(%rbp),%rcx
add    -0x30(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    14d0 <deNoise+0x390>
jmp    15a2 <deNoise+0x462>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1409 <deNoise+0x2c9>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deNoise>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9d,%r15d
mov    %rdi,%r10
mov    0xc0(%rsp),%r12
mov    0xb0(%rsp),%ebp
mov    (%rcx),%rax
test   %rax,%rax
mov    %r8d,0x24(%rsp)
mov    %rdx,0x30(%rsp)
mov    %rdi,0x28(%rsp)
jne    142d <deNoise+0x2ed>
mov    %rcx,%rbx
mov    %rsi,%r14
mov    %r8d,%edi
imul   %r15d,%edi
add    %edi,%edi
mov    %r8d,%r13d
call   1050 <malloc@plt>
mov    %rax,(%rbx)
test   %r15d,%r15d
jle    141d <deNoise+0x2dd>
mov    %r14,0x50(%rsp)
mov    %r15d,0x8(%rsp)
movslq %r15d,%r9
mov    %r13d,%r8d
movslq %r13d,%r14
movslq %ebp,%r13
lea    -0x10(%r14),%rcx
mov    %rcx,0x60(%rsp)
mov    %rcx,%rdx
shr    $0x4,%rdx
add    $0x1,%rdx
mov    %r14,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rcx,0x48(%rsp)
mov    %rdx,%rcx
mov    %rdx,0x58(%rsp)
and    $0xfffffffffffffffe,%rdx
mov    %rdx,0x40(%rsp)
mov    %r8d,%ecx
and    $0x3,%ecx
mov    %rcx,0x38(%rsp)
mov    0x28(%rsp),%r10
lea    0x18(%r10),%rdi
lea    0x30(%rax),%rbx
lea    (%r14,%r14,1),%r12
xor    %r15d,%r15d
mov    %rax,%rdx
mov    %r10,%rax
mov    %rdx,0x10(%rsp)
mov    %r9,0x18(%rsp)
jmp    1239 <deNoise+0xf9>
nopl   0x0(%rax)
add    $0x1,%r15
add    %r13,%rdi
add    %r12,%rbx
add    %r12,%rdx
add    %r13,%rax
cmp    %r9,%r15
je     13f8 <deNoise+0x2b8>
test   %r8d,%r8d
jle    1220 <deNoise+0xe0>
cmp    $0x10,%r8d
jae    1250 <deNoise+0x110>
xor    %r11d,%r11d
jmp    1360 <deNoise+0x220>
nopl   0x0(%rax)
mov    %r15,%rsi
imul   %r14,%rsi
mov    %r15,%rbp
imul   %r13,%rbp
lea    (%r10,%rbp,1),%r9
add    %r14,%rbp
add    %r10,%rbp
mov    0x10(%rsp),%rcx
lea    (%rcx,%rsi,2),%r11
cmp    %r11,%rbp
jbe    128f <deNoise+0x14f>
add    %r14,%rsi
lea    (%rcx,%rsi,2),%rsi
cmp    %rsi,%r9
jae    128f <deNoise+0x14f>
xor    %r11d,%r11d
mov    0x18(%rsp),%r9
jmp    1360 <deNoise+0x220>
cmpq   $0x10,0x60(%rsp)
jae    129b <deNoise+0x15b>
xor    %ebp,%ebp
jmp    1308 <deNoise+0x1c8>
mov    0x40(%rsp),%r10
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movq   -0x18(%rdi,%rbp,1),%xmm0
movq   -0x10(%rdi,%rbp,1),%xmm1
pxor   %xmm2,%xmm2
punpcklbw %xmm0,%xmm2
pxor   %xmm0,%xmm0
punpcklbw %xmm1,%xmm0
movdqu %xmm2,-0x30(%rbx,%rbp,2)
movdqu %xmm0,-0x20(%rbx,%rbp,2)
movq   -0x8(%rdi,%rbp,1),%xmm0
movq   (%rdi,%rbp,1),%xmm1
pxor   %xmm2,%xmm2
punpcklbw %xmm0,%xmm2
pxor   %xmm0,%xmm0
punpcklbw %xmm1,%xmm0
movdqu %xmm2,-0x10(%rbx,%rbp,2)
movdqu %xmm0,(%rbx,%rbp,2)
add    $0x20,%rbp
add    $0xfffffffffffffffe,%r10
jne    12b0 <deNoise+0x170>
testb  $0x1,0x58(%rsp)
je     1339 <deNoise+0x1f9>
movq   (%r9,%rbp,1),%xmm0
movq   0x8(%r9,%rbp,1),%xmm1
pxor   %xmm2,%xmm2
punpcklbw %xmm0,%xmm2
pxor   %xmm0,%xmm0
punpcklbw %xmm1,%xmm0
movdqu %xmm2,(%r11,%rbp,2)
movdqu %xmm0,0x10(%r11,%rbp,2)
mov    0x48(%rsp),%rcx
mov    %rcx,%r11
cmp    %r14,%rcx
mov    0x24(%rsp),%r8d
mov    0x28(%rsp),%r10
mov    0x18(%rsp),%r9
je     1220 <deNoise+0xe0>
nopl   0x0(%rax)
mov    %r11,%rbp
not    %rbp
add    %r14,%rbp
mov    0x38(%rsp),%rsi
test   %rsi,%rsi
je     1397 <deNoise+0x257>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax,%r11,1),%ecx
shl    $0x8,%ecx
mov    %cx,(%rdx,%r11,2)
add    $0x1,%r11
add    $0xffffffffffffffff,%rsi
jne    1380 <deNoise+0x240>
cmp    $0x3,%rbp
jb     1220 <deNoise+0xe0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rax,%r11,1),%ecx
shl    $0x8,%ecx
mov    %cx,(%rdx,%r11,2)
movzbl 0x1(%rax,%r11,1),%ecx
shl    $0x8,%ecx
mov    %cx,0x2(%rdx,%r11,2)
movzbl 0x2(%rax,%r11,1),%ecx
shl    $0x8,%ecx
mov    %cx,0x4(%rdx,%r11,2)
movzbl 0x3(%rax,%r11,1),%ecx
shl    $0x8,%ecx
mov    %cx,0x6(%rdx,%r11,2)
add    $0x4,%r11
cmp    %r11,%r14
jne    13b0 <deNoise+0x270>
jmp    1220 <deNoise+0xe0>
mov    0xc0(%rsp),%r12
mov    0x50(%rsp),%rsi
mov    0x30(%rsp),%rdx
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%r15d
mov    0xb0(%rsp),%ebp
jmp    142d <deNoise+0x2ed>
mov    %r13d,%r8d
mov    0x28(%rsp),%r10
mov    %r14,%rsi
mov    0x30(%rsp),%rdx
mov    0xd0(%rsp),%r14
mov    0xc8(%rsp),%rbx
mov    0xb8(%rsp),%r11d
cmpl   $0x0,(%r12)
jne    1455 <deNoise+0x315>
cmpl   $0x0,(%rbx)
je     170b <deNoise+0x5cb>
cmpl   $0x0,(%r14)
je     16e8 <deNoise+0x5a8>
mov    %r15d,0x8(%rsp)
movzbl (%r10),%ebx
shl    $0x10,%ebx
mov    %ebx,(%rdx)
mov    %rax,%r12
movzwl (%rax),%eax
shl    $0x8,%eax
movzwl %ax,%edi
mov    %rsi,%r15
mov    %ebx,%esi
mov    %r14,%rdx
mov    %r8d,%ebp
mov    %r10,%r14
call   1030 <LowPassMul@plt>
mov    %r15,%rsi
lea    0x7f(%rax),%ecx
shr    $0x8,%ecx
mov    %cx,(%r12)
add    $0x7fff,%eax
shr    $0x10,%eax
mov    %al,(%r15)
movslq %ebp,%r13
cmp    $0x2,%ebp
jl     151f <deNoise+0x3df>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbp,1),%esi
shl    $0x10,%esi
movzwl %bx,%edi
mov    0xc0(%rsp),%rdx
call   1030 <LowPassMul@plt>
mov    %eax,%ebx
mov    0x30(%rsp),%rax
mov    %ebx,(%rax,%rbp,4)
movzwl (%r12,%rbp,2),%eax
shl    $0x8,%eax
movzwl %ax,%edi
mov    %ebx,%esi
mov    0xd0(%rsp),%rdx
call   1030 <LowPassMul@plt>
mov    %r15,%rsi
lea    0x7f(%rax),%ecx
shr    $0x8,%ecx
mov    %cx,(%r12,%rbp,2)
add    $0x7fff,%eax
shr    $0x10,%eax
mov    %al,(%r15,%rbp,1)
add    $0x1,%rbp
cmp    %rbp,%r13
jne    14c0 <deNoise+0x380>
mov    %r12,0x10(%rsp)
mov    0x8(%rsp),%ecx
cmp    $0x2,%ecx
jl     16e2 <deNoise+0x5a2>
mov    %r14,%r8
movslq %ecx,%rcx
mov    %rcx,0x48(%rsp)
movslq 0xb0(%rsp),%rdi
mov    0xb8(%rsp),%eax
movslq %eax,%rbx
lea    (%rsi,%rbx,1),%r14
mov    0x10(%rsp),%rcx
lea    (%rcx,%r13,2),%r15
lea    0x0(%r13,%r13,1),%rcx
mov    %rcx,0x68(%rsp)
lea    (%r8,%rdi,1),%rdx
mov    $0x1,%ebp
xor    %eax,%eax
xor    %ecx,%ecx
mov    %rcx,0x8(%rsp)
mov    %rsi,0x50(%rsp)
mov    %rdi,0x40(%rsp)
mov    %rbx,0x70(%rsp)
mov    %r13,0x18(%rsp)
jmp    15d0 <deNoise+0x490>
nopl   (%rax)
mov    0x60(%rsp),%rbp
add    $0x1,%rbp
mov    0x70(%rsp),%rbx
add    %rbx,%r14
add    0x68(%rsp),%r15
mov    0x40(%rsp),%rdi
mov    0x38(%rsp),%rax
add    %rdi,%rax
cmp    0x48(%rsp),%rbp
mov    0x28(%rsp),%r8
mov    0x18(%rsp),%r13
mov    %rax,%rdx
mov    0x58(%rsp),%rax
je     16e2 <deNoise+0x5a2>
mov    %rdx,0x38(%rsp)
mov    %rbp,0x60(%rsp)
imul   %r13,%rbp
add    %rdi,%rax
mov    0x8(%rsp),%r13
add    %rbx,%r13
mov    %rax,0x58(%rsp)
movzbl (%r8,%rax,1),%r12d
shl    $0x10,%r12d
mov    0x30(%rsp),%rbx
movzwl (%rbx),%edi
mov    %r12d,%esi
mov    0xc8(%rsp),%rdx
call   1030 <LowPassMul@plt>
mov    %eax,(%rbx)
mov    0x10(%rsp),%rcx
movzwl (%rcx,%rbp,2),%ecx
shl    $0x8,%ecx
movzwl %cx,%edi
mov    %eax,%esi
mov    0xd0(%rsp),%rdx
call   1030 <LowPassMul@plt>
lea    0x7f(%rax),%ecx
shr    $0x8,%ecx
add    $0x7fff,%eax
shr    $0x10,%eax
mov    0x10(%rsp),%rdx
mov    %cx,(%rdx,%rbp,2)
mov    %r13,0x8(%rsp)
mov    0x50(%rsp),%rcx
mov    %al,(%rcx,%r13,1)
cmpl   $0x2,0x24(%rsp)
mov    0xc0(%rsp),%r13
jl     1590 <deNoise+0x450>
mov    $0x1,%ebp
nopl   0x0(%rax)
mov    0x38(%rsp),%rax
movzbl (%rax,%rbp,1),%esi
shl    $0x10,%esi
movzwl %r12w,%edi
mov    %r13,%rdx
call   1030 <LowPassMul@plt>
mov    %eax,%r12d
movzwl (%rbx,%rbp,4),%edi
mov    %eax,%esi
mov    0xc8(%rsp),%rdx
call   1030 <LowPassMul@plt>
mov    %eax,(%rbx,%rbp,4)
movzwl (%r15,%rbp,2),%ecx
shl    $0x8,%ecx
movzwl %cx,%edi
mov    %eax,%esi
mov    0xd0(%rsp),%rdx
call   1030 <LowPassMul@plt>
lea    0x7f(%rax),%ecx
shr    $0x8,%ecx
mov    %cx,(%r15,%rbp,2)
add    $0x7fff,%eax
shr    $0x10,%eax
mov    %al,(%r14,%rbp,1)
add    $0x1,%rbp
cmp    %rbp,0x18(%rsp)
jne    1670 <deNoise+0x530>
jmp    1590 <deNoise+0x450>
add    $0x78,%rsp
jmp    172a <deNoise+0x5ea>
sub    $0x8,%rsp
mov    %r10,%rdi
mov    %r8d,%ecx
mov    %r15d,%r8d
mov    %ebp,%r9d
push   %rbx
push   %r12
push   %r11
call   1060 <deNoiseSpacial@plt>
add    $0x98,%rsp
jmp    172a <deNoise+0x5ea>
mov    %r10,%rdi
mov    %rax,%rdx
mov    %r8d,%ecx
mov    %r15d,%r8d
mov    %ebp,%r9d
push   %r14
push   %r11
call   1040 <deNoiseTemporal@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @deNoise(i8* %0, i8* %1, i32* %2, i16** %3, i32 %4, i32 %5, i32 %6, i32 %7, i32* %8, i32* %9, i32* %10) {
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32*
%15 = alloca i16**
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32*
%21 = alloca i32*
%22 = alloca i32*
%23 = alloca i64
%24 = alloca i64
%25 = alloca i64
%26 = alloca i64
%27 = alloca i32
%28 = alloca i32
%29 = alloca i16*
%30 = alloca i16*
%31 = alloca i8*
%32 = alloca i32
%33 = alloca i16*
%34 = alloca i32
store i8* %0, i8** %12
store i8* %1, i8** %13
store i32* %2, i32** %14
store i16** %3, i16*** %15
store i32 %4, i32* %16
store i32 %5, i32* %17
store i32 %6, i32* %18
store i32 %7, i32* %19
store i32* %8, i32** %20
store i32* %9, i32** %21
store i32* %10, i32** %22
store i64 0, i64* %25
store i64 0, i64* %26
%35 = load i16**, i16*** %15
%36 = load i16*, i16** %35
store i16* %36, i16** %29
%37 = load i16*, i16** %29
%38 = icmp ne i16* %37, null
br i1 %38, label %91, label %39
39: ; preds = %11
%40 = load i32, i32* %16
%41 = load i32, i32* %17
%42 = mul nsw i32 %40, %41
%43 = sext i32 %42 to i64
%44 = mul i64 %43, 2
%45 = trunc i64 %44 to i32
%46 = call i64 @malloc(i32 %45)
%47 = inttoptr i64 %46 to i16*
store i16* %47, i16** %29
%48 = load i16**, i16*** %15
store i16* %47, i16** %48
store i64 0, i64* %24
br label %49
49: ; preds = %87, %39
%50 = load i64, i64* %24
%51 = load i32, i32* %17
%52 = sext i32 %51 to i64
%53 = icmp slt i64 %50, %52
br i1 %53, label %54, label %90
54: ; preds = %49
%55 = load i16*, i16** %29
%56 = load i64, i64* %24
%57 = load i32, i32* %16
%58 = sext i32 %57 to i64
%59 = mul nsw i64 %56, %58
%60 = getelementptr inbounds i16, i16* %55, i64 %59
store i16* %60, i16** %30
%61 = load i8*, i8** %12
%62 = load i64, i64* %24
%63 = load i32, i32* %18
%64 = sext i32 %63 to i64
%65 = mul nsw i64 %62, %64
%66 = getelementptr inbounds i8, i8* %61, i64 %65
store i8* %66, i8** %31
store i64 0, i64* %23
br label %67
67: ; preds = %83, %54
%68 = load i64, i64* %23
%69 = load i32, i32* %16
%70 = sext i32 %69 to i64
%71 = icmp slt i64 %68, %70
br i1 %71, label %72, label %86
72: ; preds = %67
%73 = load i8*, i8** %31
%74 = load i64, i64* %23
%75 = getelementptr inbounds i8, i8* %73, i64 %74
%76 = load i8, i8* %75
%77 = zext i8 %76 to i32
%78 = shl i32 %77, 8
%79 = trunc i32 %78 to i16
%80 = load i16*, i16** %30
%81 = load i64, i64* %23
%82 = getelementptr inbounds i16, i16* %80, i64 %81
store i16 %79, i16* %82
br label %83
83: ; preds = %72
%84 = load i64, i64* %23
%85 = add nsw i64 %84, 1
store i64 %85, i64* %23
br label %67
86: ; preds = %67
br label %87
87: ; preds = %86
%88 = load i64, i64* %24
%89 = add nsw i64 %88, 1
store i64 %89, i64* %24
br label %49
90: ; preds = %49
br label %91
91: ; preds = %90, %11
%92 = load i32*, i32** %20
%93 = getelementptr inbounds i32, i32* %92, i64 0
%94 = load i32, i32* %93
%95 = icmp ne i32 %94, 0
br i1 %95, label %111, label %96
96: ; preds = %91
%97 = load i32*, i32** %21
%98 = getelementptr inbounds i32, i32* %97, i64 0
%99 = load i32, i32* %98
%100 = icmp ne i32 %99, 0
br i1 %100, label %111, label %101
101: ; preds = %96
%102 = load i8*, i8** %12
%103 = load i8*, i8** %13
%104 = load i16*, i16** %29
%105 = load i32, i32* %16
%106 = load i32, i32* %17
%107 = load i32, i32* %18
%108 = load i32, i32* %19
%109 = load i32*, i32** %22
%110 = call i32 @deNoiseTemporal(i8* %102, i8* %103, i16* %104, i32 %105, i32 %106, i32 %107, i32 %108, i32* %109)
br label %327
111: ; preds = %96, %91
%112 = load i32*, i32** %22
%113 = getelementptr inbounds i32, i32* %112, i64 0
%114 = load i32, i32* %113
%115 = icmp ne i32 %114, 0
br i1 %115, label %127, label %116
116: ; preds = %111
%117 = load i8*, i8** %12
%118 = load i8*, i8** %13
%119 = load i32*, i32** %14
%120 = load i32, i32* %16
%121 = load i32, i32* %17
%122 = load i32, i32* %18
%123 = load i32, i32* %19
%124 = load i32*, i32** %20
%125 = load i32*, i32** %21
%126 = call i32 @deNoiseSpacial(i8* %117, i8* %118, i32* %119, i32 %120, i32 %121, i32 %122, i32 %123, i32* %124, i32* %125)
br label %327
127: ; preds = %111
%128 = load i8*, i8** %12
%129 = getelementptr inbounds i8, i8* %128, i64 0
%130 = load i8, i8* %129
%131 = zext i8 %130 to i32
%132 = shl i32 %131, 16
store i32 %132, i32* %27
%133 = load i32*, i32** %14
%134 = getelementptr inbounds i32, i32* %133, i64 0
store i32 %132, i32* %134
%135 = load i16*, i16** %29
%136 = getelementptr inbounds i16, i16* %135, i64 0
%137 = load i16, i16* %136
%138 = zext i16 %137 to i32
%139 = shl i32 %138, 8
%140 = trunc i32 %139 to i16
%141 = load i32, i32* %27
%142 = load i32*, i32** %22
%143 = call i32 @LowPassMul(i16 zeroext %140, i32 %141, i32* %142)
store i32 %143, i32* %28
%144 = load i32, i32* %28
%145 = add i32 %144, 268435583
%146 = lshr i32 %145, 8
%147 = trunc i32 %146 to i16
%148 = load i16*, i16** %29
%149 = getelementptr inbounds i16, i16* %148, i64 0
store i16 %147, i16* %149
%150 = load i32, i32* %28
%151 = add i32 %150, 268468223
%152 = lshr i32 %151, 16
%153 = trunc i32 %152 to i8
%154 = load i8*, i8** %13
%155 = getelementptr inbounds i8, i8* %154, i64 0
store i8 %153, i8* %155
store i64 1, i64* %23
br label %156
156: ; preds = %199, %127
%157 = load i64, i64* %23
%158 = load i32, i32* %16
%159 = sext i32 %158 to i64
%160 = icmp slt i64 %157, %159
br i1 %160, label %161, label %202
161: ; preds = %156
%162 = load i32, i32* %27
%163 = trunc i32 %162 to i16
%164 = load i8*, i8** %12
%165 = load i64, i64* %23
%166 = getelementptr inbounds i8, i8* %164, i64 %165
%167 = load i8, i8* %166
%168 = zext i8 %167 to i32
%169 = shl i32 %168, 16
%170 = load i32*, i32** %20
%171 = call i32 @LowPassMul(i16 zeroext %163, i32 %169, i32* %170)
store i32 %171, i32* %27
%172 = load i32*, i32** %14
%173 = load i64, i64* %23
%174 = getelementptr inbounds i32, i32* %172, i64 %173
store i32 %171, i32* %174
%175 = load i16*, i16** %29
%176 = load i64, i64* %23
%177 = getelementptr inbounds i16, i16* %175, i64 %176
%178 = load i16, i16* %177
%179 = zext i16 %178 to i32
%180 = shl i32 %179, 8
%181 = trunc i32 %180 to i16
%182 = load i32, i32* %27
%183 = load i32*, i32** %22
%184 = call i32 @LowPassMul(i16 zeroext %181, i32 %182, i32* %183)
store i32 %184, i32* %28
%185 = load i32, i32* %28
%186 = add i32 %185, 268435583
%187 = lshr i32 %186, 8
%188 = trunc i32 %187 to i16
%189 = load i16*, i16** %29
%190 = load i64, i64* %23
%191 = getelementptr inbounds i16, i16* %189, i64 %190
store i16 %188, i16* %191
%192 = load i32, i32* %28
%193 = add i32 %192, 268468223
%194 = lshr i32 %193, 16
%195 = trunc i32 %194 to i8
%196 = load i8*, i8** %13
%197 = load i64, i64* %23
%198 = getelementptr inbounds i8, i8* %196, i64 %197
store i8 %195, i8* %198
br label %199
199: ; preds = %161
%200 = load i64, i64* %23
%201 = add nsw i64 %200, 1
store i64 %201, i64* %23
br label %156
202: ; preds = %156
store i64 1, i64* %24
br label %203
203: ; preds = %324, %202
%204 = load i64, i64* %24
%205 = load i32, i32* %17
%206 = sext i32 %205 to i64
%207 = icmp slt i64 %204, %206
br i1 %207, label %208, label %327
208: ; preds = %203
%209 = load i16*, i16** %29
%210 = load i64, i64* %24
%211 = load i32, i32* %16
%212 = sext i32 %211 to i64
%213 = mul nsw i64 %210, %212
%214 = getelementptr inbounds i16, i16* %209, i64 %213
store i16* %214, i16** %33
%215 = load i32, i32* %18
%216 = sext i32 %215 to i64
%217 = load i64, i64* %25
%218 = add nsw i64 %217, %216
store i64 %218, i64* %25
%219 = load i32, i32* %19
%220 = sext i32 %219 to i64
%221 = load i64, i64* %26
%222 = add nsw i64 %221, %220
store i64 %222, i64* %26
%223 = load i8*, i8** %12
%224 = load i64, i64* %25
%225 = getelementptr inbounds i8, i8* %223, i64 %224
%226 = load i8, i8* %225
%227 = zext i8 %226 to i32
%228 = shl i32 %227, 16
store i32 %228, i32* %32
%229 = load i32*, i32** %14
%230 = getelementptr inbounds i32, i32* %229, i64 0
%231 = load i32, i32* %230
%232 = trunc i32 %231 to i16
%233 = load i32, i32* %32
%234 = load i32*, i32** %21
%235 = call i32 @LowPassMul(i16 zeroext %232, i32 %233, i32* %234)
%236 = load i32*, i32** %14
%237 = getelementptr inbounds i32, i32* %236, i64 0
store i32 %235, i32* %237
%238 = load i16*, i16** %33
%239 = getelementptr inbounds i16, i16* %238, i64 0
%240 = load i16, i16* %239
%241 = zext i16 %240 to i32
%242 = shl i32 %241, 8
%243 = trunc i32 %242 to i16
%244 = load i32*, i32** %14
%245 = getelementptr inbounds i32, i32* %244, i64 0
%246 = load i32, i32* %245
%247 = load i32*, i32** %22
%248 = call i32 @LowPassMul(i16 zeroext %243, i32 %246, i32* %247)
store i32 %248, i32* %28
%249 = load i32, i32* %28
%250 = add i32 %249, 268435583
%251 = lshr i32 %250, 8
%252 = trunc i32 %251 to i16
%253 = load i16*, i16** %33
%254 = getelementptr inbounds i16, i16* %253, i64 0
store i16 %252, i16* %254
%255 = load i32, i32* %28
%256 = add i32 %255, 268468223
%257 = lshr i32 %256, 16
%258 = trunc i32 %257 to i8
%259 = load i8*, i8** %13
%260 = load i64, i64* %26
%261 = getelementptr inbounds i8, i8* %259, i64 %260
store i8 %258, i8* %261
store i64 1, i64* %23
br label %262
262: ; preds = %320, %208
%263 = load i64, i64* %23
%264 = load i32, i32* %16
%265 = sext i32 %264 to i64
%266 = icmp slt i64 %263, %265
br i1 %266, label %267, label %323
267: ; preds = %262
%268 = load i32, i32* %32
%269 = trunc i32 %268 to i16
%270 = load i8*, i8** %12
%271 = load i64, i64* %25
%272 = load i64, i64* %23
%273 = add nsw i64 %271, %272
%274 = getelementptr inbounds i8, i8* %270, i64 %273
%275 = load i8, i8* %274
%276 = zext i8 %275 to i32
%277 = shl i32 %276, 16
%278 = load i32*, i32** %20
%279 = call i32 @LowPassMul(i16 zeroext %269, i32 %277, i32* %278)
store i32 %279, i32* %32
%280 = load i32*, i32** %14
%281 = load i64, i64* %23
%282 = getelementptr inbounds i32, i32* %280, i64 %281
%283 = load i32, i32* %282
%284 = trunc i32 %283 to i16
%285 = load i32, i32* %32
%286 = load i32*, i32** %21
%287 = call i32 @LowPassMul(i16 zeroext %284, i32 %285, i32* %286)
%288 = load i32*, i32** %14
%289 = load i64, i64* %23
%290 = getelementptr inbounds i32, i32* %288, i64 %289
store i32 %287, i32* %290
%291 = load i16*, i16** %33
%292 = load i64, i64* %23
%293 = getelementptr inbounds i16, i16* %291, i64 %292
%294 = load i16, i16* %293
%295 = zext i16 %294 to i32
%296 = shl i32 %295, 8
%297 = trunc i32 %296 to i16
%298 = load i32*, i32** %14
%299 = load i64, i64* %23
%300 = getelementptr inbounds i32, i32* %298, i64 %299
%301 = load i32, i32* %300
%302 = load i32*, i32** %22
%303 = call i32 @LowPassMul(i16 zeroext %297, i32 %301, i32* %302)
store i32 %303, i32* %34
%304 = load i32, i32* %34
%305 = add i32 %304, 268435583
%306 = lshr i32 %305, 8
%307 = trunc i32 %306 to i16
%308 = load i16*, i16** %33
%309 = load i64, i64* %23
%310 = getelementptr inbounds i16, i16* %308, i64 %309
store i16 %307, i16* %310
%311 = load i32, i32* %34
%312 = add i32 %311, 268468223
%313 = lshr i32 %312, 16
%314 = trunc i32 %313 to i8
%315 = load i8*, i8** %13
%316 = load i64, i64* %26
%317 = load i64, i64* %23
%318 = add nsw i64 %316, %317
%319 = getelementptr inbounds i8, i8* %315, i64 %318
store i8 %314, i8* %319
br label %320
320: ; preds = %267
%321 = load i64, i64* %23
%322 = add nsw i64 %321, 1
store i64 %322, i64* %23
br label %262
323: ; preds = %262
br label %324
324: ; preds = %323
%325 = load i64, i64* %24
%326 = add nsw i64 %325, 1
store i64 %326, i64* %24
br label %203
327: ; preds = %101, %116, %203
ret void
}

LLVM IR (-O2):
define void @deNoise(i8* %0, i8* %1, i32* %2, i16** nocapture %3, i32 %4, i32 %5, i32 %6, i32 %7, i32* %8, i32* %9, i32* %10) {
%12 = load i16*, i16** %3
%13 = icmp eq i16* %12, null
br i1 %13, label %14, label %160
14: ; preds = %11
%15 = shl i32 %4, 1
%16 = mul i32 %15, %5
%17 = tail call i64 @malloc(i32 %16)
%18 = inttoptr i64 %17 to i16*
store i16* %18, i16** %3
%19 = sext i32 %5 to i64
%20 = icmp sgt i32 %5, 0
br i1 %20, label %21, label %160
21: ; preds = %14
%22 = sext i32 %4 to i64
%23 = sext i32 %6 to i64
%24 = icmp sgt i32 %4, 0
%25 = add nsw i64 %22, -16
%26 = lshr i64 %25, 4
%27 = add nuw nsw i64 %26, 1
%28 = icmp ult i32 %4, 16
%29 = and i64 %22, -16
%30 = and i64 %27, 1
%31 = icmp ult i64 %25, 16
%32 = and i64 %27, 2305843009213693950
%33 = icmp eq i64 %30, 0
%34 = icmp eq i64 %29, %22
%35 = and i64 %22, 3
%36 = icmp eq i64 %35, 0
br label %37
37: ; preds = %21, %157
%38 = phi i64 [ 0, %21 ], [ %158, %157 ]
%39 = mul i64 %38, %22
%40 = getelementptr i16, i16* %18, i64 %39
%41 = bitcast i16* %40 to i8*
%42 = add i64 %39, %22
%43 = getelementptr i16, i16* %18, i64 %42
%44 = bitcast i16* %43 to i8*
%45 = mul i64 %38, %23
%46 = getelementptr i8, i8* %0, i64 %45
%47 = add i64 %45, %22
%48 = getelementptr i8, i8* %0, i64 %47
%49 = mul nsw i64 %38, %22
%50 = getelementptr inbounds i16, i16* %18, i64 %49
%51 = mul nsw i64 %38, %23
%52 = getelementptr inbounds i8, i8* %0, i64 %51
br i1 %24, label %53, label %157
53: ; preds = %37
br i1 %28, label %112, label %54
54: ; preds = %53
%55 = icmp ugt i8* %48, %41
%56 = icmp ult i8* %46, %44
%57 = and i1 %55, %56
br i1 %57, label %112, label %58
58: ; preds = %54
br i1 %31, label %94, label %59
59: ; preds = %58, %59
%60 = phi i64 [ %91, %59 ], [ 0, %58 ]
%61 = phi i64 [ %92, %59 ], [ 0, %58 ]
%62 = getelementptr inbounds i8, i8* %52, i64 %60
%63 = bitcast i8* %62 to <8 x i8>*
%64 = load <8 x i8>, <8 x i8>* %63
%65 = getelementptr inbounds i8, i8* %62, i64 8
%66 = bitcast i8* %65 to <8 x i8>*
%67 = load <8 x i8>, <8 x i8>* %66
%68 = zext <8 x i8> %64 to <8 x i16>
%69 = zext <8 x i8> %67 to <8 x i16>
%70 = shl nuw <8 x i16> %68, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%71 = shl nuw <8 x i16> %69, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%72 = getelementptr inbounds i16, i16* %50, i64 %60
%73 = bitcast i16* %72 to <8 x i16>*
store <8 x i16> %70, <8 x i16>* %73
%74 = getelementptr inbounds i16, i16* %72, i64 8
%75 = bitcast i16* %74 to <8 x i16>*
store <8 x i16> %71, <8 x i16>* %75
%76 = or i64 %60, 16
%77 = getelementptr inbounds i8, i8* %52, i64 %76
%78 = bitcast i8* %77 to <8 x i8>*
%79 = load <8 x i8>, <8 x i8>* %78
%80 = getelementptr inbounds i8, i8* %77, i64 8
%81 = bitcast i8* %80 to <8 x i8>*
%82 = load <8 x i8>, <8 x i8>* %81
%83 = zext <8 x i8> %79 to <8 x i16>
%84 = zext <8 x i8> %82 to <8 x i16>
%85 = shl nuw <8 x i16> %83, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%86 = shl nuw <8 x i16> %84, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%87 = getelementptr inbounds i16, i16* %50, i64 %76
%88 = bitcast i16* %87 to <8 x i16>*
store <8 x i16> %85, <8 x i16>* %88
%89 = getelementptr inbounds i16, i16* %87, i64 8
%90 = bitcast i16* %89 to <8 x i16>*
store <8 x i16> %86, <8 x i16>* %90
%91 = add nuw i64 %60, 32
%92 = add i64 %61, 2
%93 = icmp eq i64 %92, %32
br i1 %93, label %94, label %59
94: ; preds = %59, %58
%95 = phi i64 [ 0, %58 ], [ %91, %59 ]
br i1 %33, label %111, label %96
96: ; preds = %94
%97 = getelementptr inbounds i8, i8* %52, i64 %95
%98 = bitcast i8* %97 to <8 x i8>*
%99 = load <8 x i8>, <8 x i8>* %98
%100 = getelementptr inbounds i8, i8* %97, i64 8
%101 = bitcast i8* %100 to <8 x i8>*
%102 = load <8 x i8>, <8 x i8>* %101
%103 = zext <8 x i8> %99 to <8 x i16>
%104 = zext <8 x i8> %102 to <8 x i16>
%105 = shl nuw <8 x i16> %103, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%106 = shl nuw <8 x i16> %104, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%107 = getelementptr inbounds i16, i16* %50, i64 %95
%108 = bitcast i16* %107 to <8 x i16>*
store <8 x i16> %105, <8 x i16>* %108
%109 = getelementptr inbounds i16, i16* %107, i64 8
%110 = bitcast i16* %109 to <8 x i16>*
store <8 x i16> %106, <8 x i16>* %110
br label %111
111: ; preds = %94, %96
br i1 %34, label %157, label %112
112: ; preds = %54, %53, %111
%113 = phi i64 [ 0, %54 ], [ 0, %53 ], [ %29, %111 ]
%114 = xor i64 %113, -1
%115 = add nsw i64 %114, %22
br i1 %36, label %127, label %116
116: ; preds = %112, %116
%117 = phi i64 [ %124, %116 ], [ %113, %112 ]
%118 = phi i64 [ %125, %116 ], [ 0, %112 ]
%119 = getelementptr inbounds i8, i8* %52, i64 %117
%120 = load i8, i8* %119
%121 = zext i8 %120 to i16
%122 = shl nuw i16 %121, 8
%123 = getelementptr inbounds i16, i16* %50, i64 %117
store i16 %122, i16* %123
%124 = add nuw nsw i64 %117, 1
%125 = add i64 %118, 1
%126 = icmp eq i64 %125, %35
br i1 %126, label %127, label %116
127: ; preds = %116, %112
%128 = phi i64 [ %113, %112 ], [ %124, %116 ]
%129 = icmp ult i64 %115, 3
br i1 %129, label %157, label %130
130: ; preds = %127, %130
%131 = phi i64 [ %155, %130 ], [ %128, %127 ]
%132 = getelementptr inbounds i8, i8* %52, i64 %131
%133 = load i8, i8* %132
%134 = zext i8 %133 to i16
%135 = shl nuw i16 %134, 8
%136 = getelementptr inbounds i16, i16* %50, i64 %131
store i16 %135, i16* %136
%137 = add nuw nsw i64 %131, 1
%138 = getelementptr inbounds i8, i8* %52, i64 %137
%139 = load i8, i8* %138
%140 = zext i8 %139 to i16
%141 = shl nuw i16 %140, 8
%142 = getelementptr inbounds i16, i16* %50, i64 %137
store i16 %141, i16* %142
%143 = add nuw nsw i64 %131, 2
%144 = getelementptr inbounds i8, i8* %52, i64 %143
%145 = load i8, i8* %144
%146 = zext i8 %145 to i16
%147 = shl nuw i16 %146, 8
%148 = getelementptr inbounds i16, i16* %50, i64 %143
store i16 %147, i16* %148
%149 = add nuw nsw i64 %131, 3
%150 = getelementptr inbounds i8, i8* %52, i64 %149
%151 = load i8, i8* %150
%152 = zext i8 %151 to i16
%153 = shl nuw i16 %152, 8
%154 = getelementptr inbounds i16, i16* %50, i64 %149
store i16 %153, i16* %154
%155 = add nuw nsw i64 %131, 4
%156 = icmp eq i64 %155, %22
br i1 %156, label %157, label %130
157: ; preds = %127, %130, %111, %37
%158 = add nuw nsw i64 %38, 1
%159 = icmp eq i64 %158, %19
br i1 %159, label %160, label %37
160: ; preds = %157, %14, %11
%161 = phi i16* [ %12, %11 ], [ %18, %14 ], [ %18, %157 ]
%162 = load i32, i32* %8
%163 = icmp eq i32 %162, 0
br i1 %163, label %164, label %169
164: ; preds = %160
%165 = load i32, i32* %9
%166 = icmp eq i32 %165, 0
br i1 %166, label %167, label %169
167: ; preds = %164
%168 = tail call i32 @deNoiseTemporal(i8* %0, i8* %1, i16* %161, i32 %4, i32 %5, i32 %6, i32 %7, i32* %10)
br label %274
169: ; preds = %164, %160
%170 = load i32, i32* %10
%171 = icmp eq i32 %170, 0
br i1 %171, label %172, label %174
172: ; preds = %169
%173 = tail call i32 @deNoiseSpacial(i8* %0, i8* %1, i32* %2, i32 %4, i32 %5, i32 %6, i32 %7, i32* %8, i32* %9)
br label %274
174: ; preds = %169
%175 = load i8, i8* %0
%176 = zext i8 %175 to i32
%177 = shl nuw nsw i32 %176, 16
store i32 %177, i32* %2
%178 = load i16, i16* %161
%179 = shl i16 %178, 8
%180 = tail call i32 @LowPassMul(i16 zeroext %179, i32 %177, i32* %10)
%181 = add i32 %180, 127
%182 = lshr i32 %181, 8
%183 = trunc i32 %182 to i16
store i16 %183, i16* %161
%184 = add i32 %180, 32767
%185 = lshr i32 %184, 16
%186 = trunc i32 %185 to i8
store i8 %186, i8* %1
%187 = sext i32 %4 to i64
%188 = icmp sgt i32 %4, 1
br i1 %188, label %195, label %189
189: ; preds = %195, %174
%190 = sext i32 %5 to i64
%191 = icmp sgt i32 %5, 1
br i1 %191, label %192, label %274
192: ; preds = %189
%193 = sext i32 %6 to i64
%194 = sext i32 %7 to i64
br label %218
195: ; preds = %174, %195
%196 = phi i64 [ %216, %195 ], [ 1, %174 ]
%197 = phi i32 [ %203, %195 ], [ %177, %174 ]
%198 = trunc i32 %197 to i16
%199 = getelementptr inbounds i8, i8* %0, i64 %196
%200 = load i8, i8* %199
%201 = zext i8 %200 to i32
%202 = shl nuw nsw i32 %201, 16
%203 = tail call i32 @LowPassMul(i16 zeroext %198, i32 %202, i32* %8)
%204 = getelementptr inbounds i32, i32* %2, i64 %196
store i32 %203, i32* %204
%205 = getelementptr inbounds i16, i16* %161, i64 %196
%206 = load i16, i16* %205
%207 = shl i16 %206, 8
%208 = tail call i32 @LowPassMul(i16 zeroext %207, i32 %203, i32* %10)
%209 = add i32 %208, 127
%210 = lshr i32 %209, 8
%211 = trunc i32 %210 to i16
store i16 %211, i16* %205
%212 = add i32 %208, 32767
%213 = lshr i32 %212, 16
%214 = trunc i32 %213 to i8
%215 = getelementptr inbounds i8, i8* %1, i64 %196
store i8 %214, i8* %215
%216 = add nuw nsw i64 %196, 1
%217 = icmp eq i64 %216, %187
br i1 %217, label %189, label %195
218: ; preds = %192, %271
%219 = phi i64 [ 1, %192 ], [ %272, %271 ]
%220 = phi i64 [ 0, %192 ], [ %224, %271 ]
%221 = phi i64 [ 0, %192 ], [ %225, %271 ]
%222 = mul nsw i64 %219, %187
%223 = getelementptr inbounds i16, i16* %161, i64 %222
%224 = add nsw i64 %220, %193
%225 = add nsw i64 %221, %194
%226 = getelementptr inbounds i8, i8* %0, i64 %224
%227 = load i8, i8* %226
%228 = zext i8 %227 to i32
%229 = shl nuw nsw i32 %228, 16
%230 = load i32, i32* %2
%231 = trunc i32 %230 to i16
%232 = tail call i32 @LowPassMul(i16 zeroext %231, i32 %229, i32* %9)
store i32 %232, i32* %2
%233 = load i16, i16* %223
%234 = shl i16 %233, 8
%235 = tail call i32 @LowPassMul(i16 zeroext %234, i32 %232, i32* %10)
%236 = add i32 %235, 127
%237 = lshr i32 %236, 8
%238 = trunc i32 %237 to i16
store i16 %238, i16* %223
%239 = add i32 %235, 32767
%240 = lshr i32 %239, 16
%241 = trunc i32 %240 to i8
%242 = getelementptr inbounds i8, i8* %1, i64 %225
store i8 %241, i8* %242
br i1 %188, label %243, label %271
243: ; preds = %218, %243
%244 = phi i64 [ %269, %243 ], [ 1, %218 ]
%245 = phi i32 [ %252, %243 ], [ %229, %218 ]
%246 = trunc i32 %245 to i16
%247 = add nsw i64 %244, %224
%248 = getelementptr inbounds i8, i8* %0, i64 %247
%249 = load i8, i8* %248
%250 = zext i8 %249 to i32
%251 = shl nuw nsw i32 %250, 16
%252 = tail call i32 @LowPassMul(i16 zeroext %246, i32 %251, i32* %8)
%253 = getelementptr inbounds i32, i32* %2, i64 %244
%254 = load i32, i32* %253
%255 = trunc i32 %254 to i16
%256 = tail call i32 @LowPassMul(i16 zeroext %255, i32 %252, i32* %9)
store i32 %256, i32* %253
%257 = getelementptr inbounds i16, i16* %223, i64 %244
%258 = load i16, i16* %257
%259 = shl i16 %258, 8
%260 = tail call i32 @LowPassMul(i16 zeroext %259, i32 %256, i32* %10)
%261 = add i32 %260, 127
%262 = lshr i32 %261, 8
%263 = trunc i32 %262 to i16
store i16 %263, i16* %257
%264 = add i32 %260, 32767
%265 = lshr i32 %264, 16
%266 = trunc i32 %265 to i8
%267 = add nsw i64 %244, %225
%268 = getelementptr inbounds i8, i8* %1, i64 %267
store i8 %266, i8* %268
%269 = add nuw nsw i64 %244, 1
%270 = icmp eq i64 %269, %187
br i1 %270, label %271, label %243
271: ; preds = %243, %218
%272 = add nuw nsw i64 %219, 1
%273 = icmp eq i64 %272, %190
br i1 %273, label %274, label %218
274: ; preds = %271, %189, %172, %167
ret void
}