#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 *);
unsigned short *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 sLineOffs = 0, dLineOffs = 0;
  unsigned int PixelAnt;
  unsigned int PixelDst;
  unsigned short *FrameAnt = (*FrameAntPtr);
  if (!FrameAnt) {
    (*FrameAntPtr) = FrameAnt = malloc(W * H * sizeof(unsigned short));
    for (long Y = 0; Y < H; Y++) {
      unsigned short *dst = &FrameAnt[Y * W];
      unsigned char *src = Frame + Y * sStride;
      for (long 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 (long 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 (long 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 (long 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    $0xb0,%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,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%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,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x28(%rbp),%rcx
cmp    %rcx,%rax
jge    1266 <deNoise+0x126>
mov    -0x48(%rbp),%rax
mov    -0x50(%rbp),%rcx
movslq -0x24(%rbp),%rdx
imul   %rdx,%rcx
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x50(%rbp),%rcx
movslq 0x10(%rbp),%rdx
imul   %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmp    %rcx,%rax
jge    1250 <deNoise+0x110>
mov    -0x60(%rbp),%rax
mov    -0x68(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
mov    %ax,%dx
mov    -0x58(%rbp),%rax
mov    -0x68(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x68(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x68(%rbp)
jmp    1210 <deNoise+0xd0>
jmp    1255 <deNoise+0x115>
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%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    -0x48(%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    15ec <deNoise+0x4ac>
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    15ec <deNoise+0x4ac>
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
shl    $0x10,%ecx
mov    %ecx,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x48(%rbp),%rax
movzwl (%rax),%eax
shl    $0x8,%eax
mov    -0x3c(%rbp),%esi
mov    0x30(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1000007f,%eax
shr    $0x8,%eax
mov    %ax,%cx
mov    -0x48(%rbp),%rax
mov    %cx,(%rax)
mov    -0x40(%rbp),%eax
add    $0x10007fff,%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movq   $0x1,-0x70(%rbp)
mov    -0x70(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmp    %rcx,%rax
jge    1401 <deNoise+0x2c1>
mov    -0x3c(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0x70(%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,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x70(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x48(%rbp),%rax
mov    -0x70(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
shl    $0x8,%eax
mov    -0x3c(%rbp),%esi
mov    0x30(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1000007f,%eax
shr    $0x8,%eax
mov    %ax,%dx
mov    -0x48(%rbp),%rax
mov    -0x70(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x40(%rbp),%eax
add    $0x10007fff,%eax
shr    $0x10,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x70(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x70(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x70(%rbp)
jmp    135e <deNoise+0x21e>
movq   $0x1,-0x78(%rbp)
mov    -0x78(%rbp),%rax
movslq -0x28(%rbp),%rcx
cmp    %rcx,%rax
jge    15ec <deNoise+0x4ac>
mov    -0x48(%rbp),%rax
mov    -0x78(%rbp),%rcx
movslq -0x24(%rbp),%rdx
imul   %rdx,%rcx
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x88(%rbp)
movslq 0x10(%rbp),%rax
add    -0x30(%rbp),%rax
mov    %rax,-0x30(%rbp)
movslq 0x18(%rbp),%rax
add    -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x10,%eax
mov    %eax,-0x7c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x7c(%rbp),%esi
mov    0x28(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x88(%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,-0x40(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1000007f,%eax
shr    $0x8,%eax
mov    %ax,%cx
mov    -0x88(%rbp),%rax
mov    %cx,(%rax)
mov    -0x40(%rbp),%eax
add    $0x10007fff,%eax
shr    $0x10,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movq   $0x1,-0x90(%rbp)
mov    -0x90(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmp    %rcx,%rax
jge    15d6 <deNoise+0x496>
mov    -0x7c(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0x30(%rbp),%rdx
add    -0x90(%rbp),%rdx
movzbl (%rcx,%rdx,1),%esi
shl    $0x10,%esi
mov    0x20(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,-0x7c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x90(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x7c(%rbp),%esi
mov    0x28(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    -0x90(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x88(%rbp),%rax
mov    -0x90(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
shl    $0x8,%eax
mov    -0x18(%rbp),%rcx
mov    -0x90(%rbp),%rdx
mov    (%rcx,%rdx,4),%esi
mov    0x30(%rbp),%rdx
movzwl %ax,%edi
call   1030 <LowPassMul@plt>
mov    %eax,-0x94(%rbp)
mov    -0x94(%rbp),%eax
add    $0x1000007f,%eax
shr    $0x8,%eax
mov    %ax,%dx
mov    -0x88(%rbp),%rax
mov    -0x90(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x94(%rbp),%eax
add    $0x10007fff,%eax
shr    $0x10,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
add    -0x90(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x90(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x90(%rbp)
jmp    14dc <deNoise+0x39c>
jmp    15db <deNoise+0x49b>
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
jmp    1409 <deNoise+0x2c9>
add    $0xb0,%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,%r14d
mov    %rsi,%r13
mov    %rdi,%rbp
mov    0xc0(%rsp),%r12
mov    0xb0(%rsp),%r15d
mov    (%rcx),%rax
test   %rax,%rax
mov    %r8d,0x24(%rsp)
mov    %rdx,0x30(%rsp)
mov    %rdi,0x18(%rsp)
jne    1379 <deNoise+0x239>
mov    %rcx,%rbx
mov    %r8d,%edi
imul   %r14d,%edi
add    %edi,%edi
mov    %r8d,%ebp
call   1050 <malloc@plt>
mov    %rax,(%rbx)
test   %r14d,%r14d
jle    1364 <deNoise+0x224>
mov    %r13,0x28(%rsp)
mov    %r14d,0x10(%rsp)
movslq %r14d,%r14
movslq %ebp,%rcx
movslq %r15d,%r15
lea    -0x10(%rcx),%r9
mov    %r9,%r10
shr    $0x4,%r10
add    $0x1,%r10
mov    %rcx,%r11
and    $0xfffffffffffffff0,%r11
mov    %r10,%rdx
and    $0xfffffffffffffffe,%rdx
mov    %rdx,0x40(%rsp)
mov    0x18(%rsp),%rdx
lea    0x18(%rdx),%rsi
lea    0x30(%rax),%rdi
lea    (%rcx,%rcx,1),%r12
xor    %r13d,%r13d
mov    %rax,0x8(%rsp)
mov    %rax,%rbx
mov    %ebp,%r8d
mov    %r14,0x38(%rsp)
jmp    1219 <deNoise+0xd9>
nopl   (%rax)
add    $0x1,%r13
add    %r15,%rsi
add    %r12,%rdi
add    %r12,%rbx
add    %r15,%rdx
cmp    %r14,%r13
je     1339 <deNoise+0x1f9>
test   %r8d,%r8d
jle    1200 <deNoise+0xc0>
cmp    $0x10,%r8d
jae    1230 <deNoise+0xf0>
xor    %eax,%eax
jmp    1320 <deNoise+0x1e0>
nopl   0x0(%rax,%rax,1)
cmp    $0x10,%r9
jae    123a <deNoise+0xfa>
xor    %eax,%eax
jmp    12a8 <deNoise+0x168>
mov    0x40(%rsp),%rbp
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movq   -0x18(%rsi,%rax,1),%xmm0
movq   -0x10(%rsi,%rax,1),%xmm1
pxor   %xmm2,%xmm2
punpcklbw %xmm0,%xmm2
pxor   %xmm0,%xmm0
punpcklbw %xmm1,%xmm0
movdqu %xmm2,-0x30(%rdi,%rax,2)
movdqu %xmm0,-0x20(%rdi,%rax,2)
movq   -0x8(%rsi,%rax,1),%xmm0
movq   (%rsi,%rax,1),%xmm1
pxor   %xmm2,%xmm2
punpcklbw %xmm0,%xmm2
pxor   %xmm0,%xmm0
punpcklbw %xmm1,%xmm0
movdqu %xmm2,-0x10(%rdi,%rax,2)
movdqu %xmm0,(%rdi,%rax,2)
add    $0x20,%rax
add    $0xfffffffffffffffe,%rbp
jne    1250 <deNoise+0x110>
test   $0x1,%r10b
je     1310 <deNoise+0x1d0>
mov    %r13,%r8
imul   %rcx,%r8
mov    %r11,%r14
mov    %r10,%r11
mov    %r9,%r10
mov    %r13,%r9
imul   %r15,%r9
add    0x18(%rsp),%r9
mov    0x8(%rsp),%rbp
lea    0x0(%rbp,%r8,2),%rbp
movq   (%r9,%rax,1),%xmm0
movq   0x8(%r9,%rax,1),%xmm1
mov    %r10,%r9
mov    %r11,%r10
mov    %r14,%r11
mov    0x38(%rsp),%r14
mov    0x24(%rsp),%r8d
pxor   %xmm2,%xmm2
punpcklbw %xmm0,%xmm2
pxor   %xmm0,%xmm0
punpcklbw %xmm1,%xmm0
movdqu %xmm2,0x0(%rbp,%rax,2)
movdqu %xmm0,0x10(%rbp,%rax,2)
mov    %r11,%rax
cmp    %rcx,%r11
je     1200 <deNoise+0xc0>
nopl   0x0(%rax)
movzbl (%rdx,%rax,1),%ebp
shl    $0x8,%ebp
mov    %bp,(%rbx,%rax,2)
add    $0x1,%rax
cmp    %rax,%rcx
jne    1320 <deNoise+0x1e0>
jmp    1200 <deNoise+0xc0>
mov    0xc0(%rsp),%r12
mov    0x28(%rsp),%r13
mov    0x30(%rsp),%rdx
mov    0x18(%rsp),%rbp
mov    0x8(%rsp),%rax
mov    0x10(%rsp),%r14d
mov    0xb0(%rsp),%r15d
jmp    1379 <deNoise+0x239>
mov    %ebp,%r8d
mov    0xc0(%rsp),%r12
mov    0x18(%rsp),%rbp
mov    0x30(%rsp),%rdx
mov    0xd0(%rsp),%r11
mov    0xc8(%rsp),%r10
mov    0xb8(%rsp),%ebx
cmpl   $0x0,(%r12)
jne    13a1 <deNoise+0x261>
cmpl   $0x0,(%r10)
je     1683 <deNoise+0x543>
cmpl   $0x0,(%r11)
je     165d <deNoise+0x51d>
mov    %r14d,0x10(%rsp)
movzbl 0x0(%rbp),%r15d
shl    $0x10,%r15d
mov    %r15d,(%rdx)
mov    %rax,%rbx
movzwl (%rax),%eax
shl    $0x8,%eax
movzwl %ax,%edi
mov    %r15d,%esi
mov    %r11,%rdx
mov    %r8d,%r14d
call   1030 <LowPassMul@plt>
mov    %rbx,%rdx
lea    0x7f(%rax),%ecx
shr    $0x8,%ecx
mov    %cx,(%rbx)
add    $0x7fff,%eax
shr    $0x10,%eax
mov    %al,0x0(%r13)
movslq %r14d,%rcx
cmp    $0x2,%r14d
jl     147b <deNoise+0x33b>
mov    $0x1,%ebx
movzbl 0x0(%rbp,%rbx,1),%esi
shl    $0x10,%esi
movzwl %r15w,%edi
mov    %rbp,%r14
mov    %rdx,%rbp
mov    %r12,%rdx
mov    %r13,%r12
mov    %rcx,%r13
call   1030 <LowPassMul@plt>
mov    %eax,%r15d
mov    0x30(%rsp),%rax
mov    %r15d,(%rax,%rbx,4)
movzwl 0x0(%rbp,%rbx,2),%eax
shl    $0x8,%eax
movzwl %ax,%edi
mov    %r15d,%esi
mov    0xd0(%rsp),%rdx
call   1030 <LowPassMul@plt>
mov    %rbp,%rdx
mov    %r14,%rbp
lea    0x7f(%rax),%ecx
shr    $0x8,%ecx
mov    %cx,(%rdx,%rbx,2)
mov    %r13,%rcx
mov    %r12,%r13
mov    0xc0(%rsp),%r12
add    $0x7fff,%eax
shr    $0x10,%eax
mov    %al,0x0(%r13,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%rcx
jne    1400 <deNoise+0x2c0>
mov    %rdx,0x8(%rsp)
mov    %r13,0x28(%rsp)
mov    0x10(%rsp),%eax
cmp    $0x2,%eax
mov    0xb8(%rsp),%esi
jl     1657 <deNoise+0x517>
cltq
mov    %rax,0x60(%rsp)
movslq 0xb0(%rsp),%rdx
movslq %esi,%rsi
mov    0x28(%rsp),%rax
lea    (%rax,%rsi,1),%rdi
mov    0x8(%rsp),%rax
lea    (%rax,%rcx,2),%r12
lea    (%rcx,%rcx,1),%rax
mov    %rax,0x48(%rsp)
lea    (%rdx,%rbp,1),%r14
mov    $0x1,%r13d
xor    %eax,%eax
xor    %ebx,%ebx
mov    %rdx,0x58(%rsp)
mov    %rsi,0x50(%rsp)
mov    %rcx,0x38(%rsp)
jmp    1535 <deNoise+0x3f5>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x40(%rsp),%r13
add    $0x1,%r13
mov    0x50(%rsp),%rsi
mov    0x10(%rsp),%rax
add    %rsi,%rax
add    0x48(%rsp),%r12
mov    0x58(%rsp),%rdx
add    %rdx,%r14
cmp    0x60(%rsp),%r13
mov    0x18(%rsp),%rbp
mov    0x38(%rsp),%rcx
mov    %rax,%rdi
mov    0x70(%rsp),%rax
mov    0x68(%rsp),%rbx
je     1657 <deNoise+0x517>
mov    %rdi,0x10(%rsp)
mov    %r13,0x40(%rsp)
imul   %rcx,%r13
add    %rdx,%rax
add    %rsi,%rbx
mov    %rax,0x70(%rsp)
movzbl 0x0(%rbp,%rax,1),%r15d
shl    $0x10,%r15d
mov    0x30(%rsp),%rbp
movzwl 0x0(%rbp),%edi
mov    %r15d,%esi
mov    0xc8(%rsp),%rdx
call   1030 <LowPassMul@plt>
mov    %eax,0x0(%rbp)
mov    0x8(%rsp),%rcx
movzwl (%rcx,%r13,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    0x8(%rsp),%rdx
mov    %cx,(%rdx,%r13,2)
mov    0x28(%rsp),%rcx
mov    %rbx,0x68(%rsp)
mov    %al,(%rcx,%rbx,1)
cmpl   $0x2,0x24(%rsp)
mov    0xc0(%rsp),%rbx
jl     14f0 <deNoise+0x3b0>
mov    $0x1,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%r13,1),%esi
shl    $0x10,%esi
movzwl %r15w,%edi
mov    %rbx,%rdx
call   1030 <LowPassMul@plt>
mov    %eax,%r15d
movzwl 0x0(%rbp,%r13,4),%edi
mov    %eax,%esi
mov    0xc8(%rsp),%rdx
call   1030 <LowPassMul@plt>
mov    %eax,0x0(%rbp,%r13,4)
movzwl (%r12,%r13,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,(%r12,%r13,2)
add    $0x7fff,%eax
shr    $0x10,%eax
mov    0x10(%rsp),%rcx
mov    %al,(%rcx,%r13,1)
add    $0x1,%r13
cmp    %r13,0x38(%rsp)
jne    15e0 <deNoise+0x4a0>
jmp    14f0 <deNoise+0x3b0>
add    $0x78,%rsp
jmp    16a4 <deNoise+0x564>
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r8d,%ecx
mov    %r14d,%r8d
mov    %r15d,%r9d
push   %r10
push   %r12
push   %rbx
call   1060 <deNoiseSpacial@plt>
add    $0x98,%rsp
jmp    16a4 <deNoise+0x564>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %rax,%rdx
mov    %r8d,%ecx
mov    %r14d,%r8d
mov    %r15d,%r9d
push   %r11
push   %rbx
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 i32
%26 = alloca i32
%27 = alloca i16*
%28 = alloca i64
%29 = alloca i16*
%30 = alloca i8*
%31 = alloca i64
%32 = alloca i64
%33 = alloca i64
%34 = alloca i32
%35 = alloca i16*
%36 = alloca i64
%37 = 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* %23
store i64 0, i64* %24
%38 = load i16**, i16*** %15
%39 = load i16*, i16** %38
store i16* %39, i16** %27
%40 = load i16*, i16** %27
%41 = icmp ne i16* %40, null
br i1 %41, label %93, label %42
42: ; preds = %11
%43 = load i32, i32* %16
%44 = load i32, i32* %17
%45 = mul nsw i32 %43, %44
%46 = sext i32 %45 to i64
%47 = mul i64 %46, 2
%48 = trunc i64 %47 to i32
%49 = call i16* @malloc(i32 %48)
store i16* %49, i16** %27
%50 = load i16**, i16*** %15
store i16* %49, i16** %50
store i64 0, i64* %28
br label %51
51: ; preds = %89, %42
%52 = load i64, i64* %28
%53 = load i32, i32* %17
%54 = sext i32 %53 to i64
%55 = icmp slt i64 %52, %54
br i1 %55, label %56, label %92
56: ; preds = %51
%57 = load i16*, i16** %27
%58 = load i64, i64* %28
%59 = load i32, i32* %16
%60 = sext i32 %59 to i64
%61 = mul nsw i64 %58, %60
%62 = getelementptr inbounds i16, i16* %57, i64 %61
store i16* %62, i16** %29
%63 = load i8*, i8** %12
%64 = load i64, i64* %28
%65 = load i32, i32* %18
%66 = sext i32 %65 to i64
%67 = mul nsw i64 %64, %66
%68 = getelementptr inbounds i8, i8* %63, i64 %67
store i8* %68, i8** %30
store i64 0, i64* %31
br label %69
69: ; preds = %85, %56
%70 = load i64, i64* %31
%71 = load i32, i32* %16
%72 = sext i32 %71 to i64
%73 = icmp slt i64 %70, %72
br i1 %73, label %74, label %88
74: ; preds = %69
%75 = load i8*, i8** %30
%76 = load i64, i64* %31
%77 = getelementptr inbounds i8, i8* %75, i64 %76
%78 = load i8, i8* %77
%79 = zext i8 %78 to i32
%80 = shl i32 %79, 8
%81 = trunc i32 %80 to i16
%82 = load i16*, i16** %29
%83 = load i64, i64* %31
%84 = getelementptr inbounds i16, i16* %82, i64 %83
store i16 %81, i16* %84
br label %85
85: ; preds = %74
%86 = load i64, i64* %31
%87 = add nsw i64 %86, 1
store i64 %87, i64* %31
br label %69
88: ; preds = %69
br label %89
89: ; preds = %88
%90 = load i64, i64* %28
%91 = add nsw i64 %90, 1
store i64 %91, i64* %28
br label %51
92: ; preds = %51
br label %93
93: ; preds = %92, %11
%94 = load i32*, i32** %20
%95 = getelementptr inbounds i32, i32* %94, i64 0
%96 = load i32, i32* %95
%97 = icmp ne i32 %96, 0
br i1 %97, label %113, label %98
98: ; preds = %93
%99 = load i32*, i32** %21
%100 = getelementptr inbounds i32, i32* %99, i64 0
%101 = load i32, i32* %100
%102 = icmp ne i32 %101, 0
br i1 %102, label %113, label %103
103: ; preds = %98
%104 = load i8*, i8** %12
%105 = load i8*, i8** %13
%106 = load i16*, i16** %27
%107 = load i32, i32* %16
%108 = load i32, i32* %17
%109 = load i32, i32* %18
%110 = load i32, i32* %19
%111 = load i32*, i32** %22
%112 = call i32 @deNoiseTemporal(i8* %104, i8* %105, i16* %106, i32 %107, i32 %108, i32 %109, i32 %110, i32* %111)
br label %329
113: ; preds = %98, %93
%114 = load i32*, i32** %22
%115 = getelementptr inbounds i32, i32* %114, i64 0
%116 = load i32, i32* %115
%117 = icmp ne i32 %116, 0
br i1 %117, label %129, label %118
118: ; preds = %113
%119 = load i8*, i8** %12
%120 = load i8*, i8** %13
%121 = load i32*, i32** %14
%122 = load i32, i32* %16
%123 = load i32, i32* %17
%124 = load i32, i32* %18
%125 = load i32, i32* %19
%126 = load i32*, i32** %20
%127 = load i32*, i32** %21
%128 = call i32 @deNoiseSpacial(i8* %119, i8* %120, i32* %121, i32 %122, i32 %123, i32 %124, i32 %125, i32* %126, i32* %127)
br label %329
129: ; preds = %113
%130 = load i8*, i8** %12
%131 = getelementptr inbounds i8, i8* %130, i64 0
%132 = load i8, i8* %131
%133 = zext i8 %132 to i32
%134 = shl i32 %133, 16
store i32 %134, i32* %25
%135 = load i32*, i32** %14
%136 = getelementptr inbounds i32, i32* %135, i64 0
store i32 %134, i32* %136
%137 = load i16*, i16** %27
%138 = getelementptr inbounds i16, i16* %137, i64 0
%139 = load i16, i16* %138
%140 = zext i16 %139 to i32
%141 = shl i32 %140, 8
%142 = trunc i32 %141 to i16
%143 = load i32, i32* %25
%144 = load i32*, i32** %22
%145 = call i32 @LowPassMul(i16 zeroext %142, i32 %143, i32* %144)
store i32 %145, i32* %26
%146 = load i32, i32* %26
%147 = add i32 %146, 268435583
%148 = lshr i32 %147, 8
%149 = trunc i32 %148 to i16
%150 = load i16*, i16** %27
%151 = getelementptr inbounds i16, i16* %150, i64 0
store i16 %149, i16* %151
%152 = load i32, i32* %26
%153 = add i32 %152, 268468223
%154 = lshr i32 %153, 16
%155 = trunc i32 %154 to i8
%156 = load i8*, i8** %13
%157 = getelementptr inbounds i8, i8* %156, i64 0
store i8 %155, i8* %157
store i64 1, i64* %32
br label %158
158: ; preds = %201, %129
%159 = load i64, i64* %32
%160 = load i32, i32* %16
%161 = sext i32 %160 to i64
%162 = icmp slt i64 %159, %161
br i1 %162, label %163, label %204
163: ; preds = %158
%164 = load i32, i32* %25
%165 = trunc i32 %164 to i16
%166 = load i8*, i8** %12
%167 = load i64, i64* %32
%168 = getelementptr inbounds i8, i8* %166, i64 %167
%169 = load i8, i8* %168
%170 = zext i8 %169 to i32
%171 = shl i32 %170, 16
%172 = load i32*, i32** %20
%173 = call i32 @LowPassMul(i16 zeroext %165, i32 %171, i32* %172)
store i32 %173, i32* %25
%174 = load i32*, i32** %14
%175 = load i64, i64* %32
%176 = getelementptr inbounds i32, i32* %174, i64 %175
store i32 %173, i32* %176
%177 = load i16*, i16** %27
%178 = load i64, i64* %32
%179 = getelementptr inbounds i16, i16* %177, i64 %178
%180 = load i16, i16* %179
%181 = zext i16 %180 to i32
%182 = shl i32 %181, 8
%183 = trunc i32 %182 to i16
%184 = load i32, i32* %25
%185 = load i32*, i32** %22
%186 = call i32 @LowPassMul(i16 zeroext %183, i32 %184, i32* %185)
store i32 %186, i32* %26
%187 = load i32, i32* %26
%188 = add i32 %187, 268435583
%189 = lshr i32 %188, 8
%190 = trunc i32 %189 to i16
%191 = load i16*, i16** %27
%192 = load i64, i64* %32
%193 = getelementptr inbounds i16, i16* %191, i64 %192
store i16 %190, i16* %193
%194 = load i32, i32* %26
%195 = add i32 %194, 268468223
%196 = lshr i32 %195, 16
%197 = trunc i32 %196 to i8
%198 = load i8*, i8** %13
%199 = load i64, i64* %32
%200 = getelementptr inbounds i8, i8* %198, i64 %199
store i8 %197, i8* %200
br label %201
201: ; preds = %163
%202 = load i64, i64* %32
%203 = add nsw i64 %202, 1
store i64 %203, i64* %32
br label %158
204: ; preds = %158
store i64 1, i64* %33
br label %205
205: ; preds = %326, %204
%206 = load i64, i64* %33
%207 = load i32, i32* %17
%208 = sext i32 %207 to i64
%209 = icmp slt i64 %206, %208
br i1 %209, label %210, label %329
210: ; preds = %205
%211 = load i16*, i16** %27
%212 = load i64, i64* %33
%213 = load i32, i32* %16
%214 = sext i32 %213 to i64
%215 = mul nsw i64 %212, %214
%216 = getelementptr inbounds i16, i16* %211, i64 %215
store i16* %216, i16** %35
%217 = load i32, i32* %18
%218 = sext i32 %217 to i64
%219 = load i64, i64* %23
%220 = add nsw i64 %219, %218
store i64 %220, i64* %23
%221 = load i32, i32* %19
%222 = sext i32 %221 to i64
%223 = load i64, i64* %24
%224 = add nsw i64 %223, %222
store i64 %224, i64* %24
%225 = load i8*, i8** %12
%226 = load i64, i64* %23
%227 = getelementptr inbounds i8, i8* %225, i64 %226
%228 = load i8, i8* %227
%229 = zext i8 %228 to i32
%230 = shl i32 %229, 16
store i32 %230, i32* %34
%231 = load i32*, i32** %14
%232 = getelementptr inbounds i32, i32* %231, i64 0
%233 = load i32, i32* %232
%234 = trunc i32 %233 to i16
%235 = load i32, i32* %34
%236 = load i32*, i32** %21
%237 = call i32 @LowPassMul(i16 zeroext %234, i32 %235, i32* %236)
%238 = load i32*, i32** %14
%239 = getelementptr inbounds i32, i32* %238, i64 0
store i32 %237, i32* %239
%240 = load i16*, i16** %35
%241 = getelementptr inbounds i16, i16* %240, i64 0
%242 = load i16, i16* %241
%243 = zext i16 %242 to i32
%244 = shl i32 %243, 8
%245 = trunc i32 %244 to i16
%246 = load i32*, i32** %14
%247 = getelementptr inbounds i32, i32* %246, i64 0
%248 = load i32, i32* %247
%249 = load i32*, i32** %22
%250 = call i32 @LowPassMul(i16 zeroext %245, i32 %248, i32* %249)
store i32 %250, i32* %26
%251 = load i32, i32* %26
%252 = add i32 %251, 268435583
%253 = lshr i32 %252, 8
%254 = trunc i32 %253 to i16
%255 = load i16*, i16** %35
%256 = getelementptr inbounds i16, i16* %255, i64 0
store i16 %254, i16* %256
%257 = load i32, i32* %26
%258 = add i32 %257, 268468223
%259 = lshr i32 %258, 16
%260 = trunc i32 %259 to i8
%261 = load i8*, i8** %13
%262 = load i64, i64* %24
%263 = getelementptr inbounds i8, i8* %261, i64 %262
store i8 %260, i8* %263
store i64 1, i64* %36
br label %264
264: ; preds = %322, %210
%265 = load i64, i64* %36
%266 = load i32, i32* %16
%267 = sext i32 %266 to i64
%268 = icmp slt i64 %265, %267
br i1 %268, label %269, label %325
269: ; preds = %264
%270 = load i32, i32* %34
%271 = trunc i32 %270 to i16
%272 = load i8*, i8** %12
%273 = load i64, i64* %23
%274 = load i64, i64* %36
%275 = add nsw i64 %273, %274
%276 = getelementptr inbounds i8, i8* %272, i64 %275
%277 = load i8, i8* %276
%278 = zext i8 %277 to i32
%279 = shl i32 %278, 16
%280 = load i32*, i32** %20
%281 = call i32 @LowPassMul(i16 zeroext %271, i32 %279, i32* %280)
store i32 %281, i32* %34
%282 = load i32*, i32** %14
%283 = load i64, i64* %36
%284 = getelementptr inbounds i32, i32* %282, i64 %283
%285 = load i32, i32* %284
%286 = trunc i32 %285 to i16
%287 = load i32, i32* %34
%288 = load i32*, i32** %21
%289 = call i32 @LowPassMul(i16 zeroext %286, i32 %287, i32* %288)
%290 = load i32*, i32** %14
%291 = load i64, i64* %36
%292 = getelementptr inbounds i32, i32* %290, i64 %291
store i32 %289, i32* %292
%293 = load i16*, i16** %35
%294 = load i64, i64* %36
%295 = getelementptr inbounds i16, i16* %293, i64 %294
%296 = load i16, i16* %295
%297 = zext i16 %296 to i32
%298 = shl i32 %297, 8
%299 = trunc i32 %298 to i16
%300 = load i32*, i32** %14
%301 = load i64, i64* %36
%302 = getelementptr inbounds i32, i32* %300, i64 %301
%303 = load i32, i32* %302
%304 = load i32*, i32** %22
%305 = call i32 @LowPassMul(i16 zeroext %299, i32 %303, i32* %304)
store i32 %305, i32* %37
%306 = load i32, i32* %37
%307 = add i32 %306, 268435583
%308 = lshr i32 %307, 8
%309 = trunc i32 %308 to i16
%310 = load i16*, i16** %35
%311 = load i64, i64* %36
%312 = getelementptr inbounds i16, i16* %310, i64 %311
store i16 %309, i16* %312
%313 = load i32, i32* %37
%314 = add i32 %313, 268468223
%315 = lshr i32 %314, 16
%316 = trunc i32 %315 to i8
%317 = load i8*, i8** %13
%318 = load i64, i64* %24
%319 = load i64, i64* %36
%320 = add nsw i64 %318, %319
%321 = getelementptr inbounds i8, i8* %317, i64 %320
store i8 %316, i8* %321
br label %322
322: ; preds = %269
%323 = load i64, i64* %36
%324 = add nsw i64 %323, 1
store i64 %324, i64* %36
br label %264
325: ; preds = %264
br label %326
326: ; preds = %325
%327 = load i64, i64* %33
%328 = add nsw i64 %327, 1
store i64 %328, i64* %33
br label %205
329: ; preds = %103, %118, %205
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 %109
14: ; preds = %11
%15 = shl i32 %4, 1
%16 = mul i32 %15, %5
%17 = tail call i16* @malloc(i32 %16)
store i16* %17, i16** %3
%18 = sext i32 %5 to i64
%19 = icmp sgt i32 %5, 0
br i1 %19, label %20, label %109
20: ; preds = %14
%21 = sext i32 %4 to i64
%22 = sext i32 %6 to i64
%23 = icmp sgt i32 %4, 0
%24 = add nsw i64 %21, -16
%25 = lshr i64 %24, 4
%26 = add nuw nsw i64 %25, 1
%27 = icmp ult i32 %4, 16
%28 = and i64 %21, -16
%29 = and i64 %26, 1
%30 = icmp ult i64 %24, 16
%31 = and i64 %26, 2305843009213693950
%32 = icmp eq i64 %29, 0
%33 = icmp eq i64 %28, %21
br label %34
34: ; preds = %20, %97
%35 = phi i64 [ 0, %20 ], [ %98, %97 ]
%36 = mul nsw i64 %35, %21
%37 = getelementptr inbounds i16, i16* %17, i64 %36
%38 = mul nsw i64 %35, %22
%39 = getelementptr inbounds i8, i8* %0, i64 %38
br i1 %23, label %40, label %97
40: ; preds = %34
br i1 %27, label %95, label %41
41: ; preds = %40
br i1 %30, label %77, label %42
42: ; preds = %41, %42
%43 = phi i64 [ %74, %42 ], [ 0, %41 ]
%44 = phi i64 [ %75, %42 ], [ 0, %41 ]
%45 = getelementptr inbounds i8, i8* %39, i64 %43
%46 = bitcast i8* %45 to <8 x i8>*
%47 = load <8 x i8>, <8 x i8>* %46
%48 = getelementptr inbounds i8, i8* %45, i64 8
%49 = bitcast i8* %48 to <8 x i8>*
%50 = load <8 x i8>, <8 x i8>* %49
%51 = zext <8 x i8> %47 to <8 x i16>
%52 = zext <8 x i8> %50 to <8 x i16>
%53 = shl nuw <8 x i16> %51, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%54 = shl nuw <8 x i16> %52, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%55 = getelementptr inbounds i16, i16* %37, i64 %43
%56 = bitcast i16* %55 to <8 x i16>*
store <8 x i16> %53, <8 x i16>* %56
%57 = getelementptr inbounds i16, i16* %55, i64 8
%58 = bitcast i16* %57 to <8 x i16>*
store <8 x i16> %54, <8 x i16>* %58
%59 = or i64 %43, 16
%60 = getelementptr inbounds i8, i8* %39, i64 %59
%61 = bitcast i8* %60 to <8 x i8>*
%62 = load <8 x i8>, <8 x i8>* %61
%63 = getelementptr inbounds i8, i8* %60, i64 8
%64 = bitcast i8* %63 to <8 x i8>*
%65 = load <8 x i8>, <8 x i8>* %64
%66 = zext <8 x i8> %62 to <8 x i16>
%67 = zext <8 x i8> %65 to <8 x i16>
%68 = shl nuw <8 x i16> %66, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%69 = shl nuw <8 x i16> %67, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%70 = getelementptr inbounds i16, i16* %37, i64 %59
%71 = bitcast i16* %70 to <8 x i16>*
store <8 x i16> %68, <8 x i16>* %71
%72 = getelementptr inbounds i16, i16* %70, i64 8
%73 = bitcast i16* %72 to <8 x i16>*
store <8 x i16> %69, <8 x i16>* %73
%74 = add nuw i64 %43, 32
%75 = add i64 %44, 2
%76 = icmp eq i64 %75, %31
br i1 %76, label %77, label %42
77: ; preds = %42, %41
%78 = phi i64 [ 0, %41 ], [ %74, %42 ]
br i1 %32, label %94, label %79
79: ; preds = %77
%80 = getelementptr inbounds i8, i8* %39, i64 %78
%81 = bitcast i8* %80 to <8 x i8>*
%82 = load <8 x i8>, <8 x i8>* %81
%83 = getelementptr inbounds i8, i8* %80, i64 8
%84 = bitcast i8* %83 to <8 x i8>*
%85 = load <8 x i8>, <8 x i8>* %84
%86 = zext <8 x i8> %82 to <8 x i16>
%87 = zext <8 x i8> %85 to <8 x i16>
%88 = shl nuw <8 x i16> %86, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%89 = shl nuw <8 x i16> %87, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%90 = getelementptr inbounds i16, i16* %37, i64 %78
%91 = bitcast i16* %90 to <8 x i16>*
store <8 x i16> %88, <8 x i16>* %91
%92 = getelementptr inbounds i16, i16* %90, i64 8
%93 = bitcast i16* %92 to <8 x i16>*
store <8 x i16> %89, <8 x i16>* %93
br label %94
94: ; preds = %77, %79
br i1 %33, label %97, label %95
95: ; preds = %40, %94
%96 = phi i64 [ 0, %40 ], [ %28, %94 ]
br label %100
97: ; preds = %100, %94, %34
%98 = add nuw nsw i64 %35, 1
%99 = icmp eq i64 %98, %18
br i1 %99, label %109, label %34
100: ; preds = %95, %100
%101 = phi i64 [ %107, %100 ], [ %96, %95 ]
%102 = getelementptr inbounds i8, i8* %39, i64 %101
%103 = load i8, i8* %102
%104 = zext i8 %103 to i16
%105 = shl nuw i16 %104, 8
%106 = getelementptr inbounds i16, i16* %37, i64 %101
store i16 %105, i16* %106
%107 = add nuw nsw i64 %101, 1
%108 = icmp eq i64 %107, %21
br i1 %108, label %97, label %100
109: ; preds = %97, %14, %11
%110 = phi i16* [ %12, %11 ], [ %17, %14 ], [ %17, %97 ]
%111 = load i32, i32* %8
%112 = icmp eq i32 %111, 0
br i1 %112, label %113, label %118
113: ; preds = %109
%114 = load i32, i32* %9
%115 = icmp eq i32 %114, 0
br i1 %115, label %116, label %118
116: ; preds = %113
%117 = tail call i32 @deNoiseTemporal(i8* %0, i8* %1, i16* %110, i32 %4, i32 %5, i32 %6, i32 %7, i32* %10)
br label %223
118: ; preds = %113, %109
%119 = load i32, i32* %10
%120 = icmp eq i32 %119, 0
br i1 %120, label %121, label %123
121: ; preds = %118
%122 = tail call i32 @deNoiseSpacial(i8* %0, i8* %1, i32* %2, i32 %4, i32 %5, i32 %6, i32 %7, i32* %8, i32* %9)
br label %223
123: ; preds = %118
%124 = load i8, i8* %0
%125 = zext i8 %124 to i32
%126 = shl nuw nsw i32 %125, 16
store i32 %126, i32* %2
%127 = load i16, i16* %110
%128 = shl i16 %127, 8
%129 = tail call i32 @LowPassMul(i16 zeroext %128, i32 %126, i32* %10)
%130 = add i32 %129, 127
%131 = lshr i32 %130, 8
%132 = trunc i32 %131 to i16
store i16 %132, i16* %110
%133 = add i32 %129, 32767
%134 = lshr i32 %133, 16
%135 = trunc i32 %134 to i8
store i8 %135, i8* %1
%136 = sext i32 %4 to i64
%137 = icmp sgt i32 %4, 1
br i1 %137, label %144, label %138
138: ; preds = %144, %123
%139 = sext i32 %5 to i64
%140 = icmp sgt i32 %5, 1
br i1 %140, label %141, label %223
141: ; preds = %138
%142 = sext i32 %6 to i64
%143 = sext i32 %7 to i64
br label %167
144: ; preds = %123, %144
%145 = phi i64 [ %165, %144 ], [ 1, %123 ]
%146 = phi i32 [ %152, %144 ], [ %126, %123 ]
%147 = trunc i32 %146 to i16
%148 = getelementptr inbounds i8, i8* %0, i64 %145
%149 = load i8, i8* %148
%150 = zext i8 %149 to i32
%151 = shl nuw nsw i32 %150, 16
%152 = tail call i32 @LowPassMul(i16 zeroext %147, i32 %151, i32* %8)
%153 = getelementptr inbounds i32, i32* %2, i64 %145
store i32 %152, i32* %153
%154 = getelementptr inbounds i16, i16* %110, i64 %145
%155 = load i16, i16* %154
%156 = shl i16 %155, 8
%157 = tail call i32 @LowPassMul(i16 zeroext %156, i32 %152, i32* %10)
%158 = add i32 %157, 127
%159 = lshr i32 %158, 8
%160 = trunc i32 %159 to i16
store i16 %160, i16* %154
%161 = add i32 %157, 32767
%162 = lshr i32 %161, 16
%163 = trunc i32 %162 to i8
%164 = getelementptr inbounds i8, i8* %1, i64 %145
store i8 %163, i8* %164
%165 = add nuw nsw i64 %145, 1
%166 = icmp eq i64 %165, %136
br i1 %166, label %138, label %144
167: ; preds = %141, %192
%168 = phi i64 [ 0, %141 ], [ %173, %192 ]
%169 = phi i64 [ 0, %141 ], [ %174, %192 ]
%170 = phi i64 [ 1, %141 ], [ %193, %192 ]
%171 = mul nsw i64 %170, %136
%172 = getelementptr inbounds i16, i16* %110, i64 %171
%173 = add nsw i64 %168, %142
%174 = add nsw i64 %169, %143
%175 = getelementptr inbounds i8, i8* %0, i64 %173
%176 = load i8, i8* %175
%177 = zext i8 %176 to i32
%178 = shl nuw nsw i32 %177, 16
%179 = load i32, i32* %2
%180 = trunc i32 %179 to i16
%181 = tail call i32 @LowPassMul(i16 zeroext %180, i32 %178, i32* %9)
store i32 %181, i32* %2
%182 = load i16, i16* %172
%183 = shl i16 %182, 8
%184 = tail call i32 @LowPassMul(i16 zeroext %183, i32 %181, i32* %10)
%185 = add i32 %184, 127
%186 = lshr i32 %185, 8
%187 = trunc i32 %186 to i16
store i16 %187, i16* %172
%188 = add i32 %184, 32767
%189 = lshr i32 %188, 16
%190 = trunc i32 %189 to i8
%191 = getelementptr inbounds i8, i8* %1, i64 %174
store i8 %190, i8* %191
br i1 %137, label %195, label %192
192: ; preds = %195, %167
%193 = add nuw nsw i64 %170, 1
%194 = icmp eq i64 %193, %139
br i1 %194, label %223, label %167
195: ; preds = %167, %195
%196 = phi i64 [ %221, %195 ], [ 1, %167 ]
%197 = phi i32 [ %204, %195 ], [ %178, %167 ]
%198 = trunc i32 %197 to i16
%199 = add nsw i64 %196, %173
%200 = getelementptr inbounds i8, i8* %0, i64 %199
%201 = load i8, i8* %200
%202 = zext i8 %201 to i32
%203 = shl nuw nsw i32 %202, 16
%204 = tail call i32 @LowPassMul(i16 zeroext %198, i32 %203, i32* %8)
%205 = getelementptr inbounds i32, i32* %2, i64 %196
%206 = load i32, i32* %205
%207 = trunc i32 %206 to i16
%208 = tail call i32 @LowPassMul(i16 zeroext %207, i32 %204, i32* %9)
store i32 %208, i32* %205
%209 = getelementptr inbounds i16, i16* %172, i64 %196
%210 = load i16, i16* %209
%211 = shl i16 %210, 8
%212 = tail call i32 @LowPassMul(i16 zeroext %211, i32 %208, i32* %10)
%213 = add i32 %212, 127
%214 = lshr i32 %213, 8
%215 = trunc i32 %214 to i16
store i16 %215, i16* %209
%216 = add i32 %212, 32767
%217 = lshr i32 %216, 16
%218 = trunc i32 %217 to i8
%219 = add nsw i64 %196, %174
%220 = getelementptr inbounds i8, i8* %1, i64 %219
store i8 %218, i8* %220
%221 = add nuw nsw i64 %196, 1
%222 = icmp eq i64 %221, %136
br i1 %222, label %192, label %195
223: ; preds = %192, %138, %121, %116
ret void
}