#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));
    if (!FrameAnt)
      return;
    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    127b <deNoise+0x13b>
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)
cmpq   $0x0,-0x48(%rbp)
jne    11cd <deNoise+0x8d>
jmp    15fc <deNoise+0x4bc>
movq   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x28(%rbp),%rcx
cmp    %rcx,%rax
jge    1276 <deNoise+0x136>
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    1260 <deNoise+0x120>
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    1220 <deNoise+0xe0>
jmp    1265 <deNoise+0x125>
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
jmp    11d5 <deNoise+0x95>
jmp    127b <deNoise+0x13b>
mov    0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jne    12c7 <deNoise+0x187>
mov    0x28(%rbp),%rax
cmpl   $0x0,(%rax)
jne    12c7 <deNoise+0x187>
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    15fc <deNoise+0x4bc>
mov    0x30(%rbp),%rax
cmpl   $0x0,(%rax)
jne    130f <deNoise+0x1cf>
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    15fc <deNoise+0x4bc>
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    1411 <deNoise+0x2d1>
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    136e <deNoise+0x22e>
movq   $0x1,-0x78(%rbp)
mov    -0x78(%rbp),%rax
movslq -0x28(%rbp),%rcx
cmp    %rcx,%rax
jge    15fc <deNoise+0x4bc>
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    15e6 <deNoise+0x4a6>
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    14ec <deNoise+0x3ac>
jmp    15eb <deNoise+0x4ab>
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
jmp    1419 <deNoise+0x2d9>
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    %r8d,0xc(%rsp)
mov    %rdx,0x38(%rsp)
mov    %rsi,%rbx
mov    %rdi,%r13
mov    0xb0(%rsp),%r15d
mov    (%rcx),%rdx
test   %rdx,%rdx
je     1447 <deNoise+0x307>
mov    0xd0(%rsp),%rbp
mov    0xc8(%rsp),%r10
mov    0xc0(%rsp),%rax
mov    0xb8(%rsp),%r11d
cmpl   $0x0,(%rax)
jne    11a4 <deNoise+0x64>
cmpl   $0x0,(%r10)
je     164d <deNoise+0x50d>
cmpl   $0x0,0x0(%rbp)
je     1600 <deNoise+0x4c0>
mov    %r14d,0x20(%rsp)
movzbl 0x0(%r13),%r15d
shl    $0x10,%r15d
mov    0x38(%rsp),%rcx
mov    %r15d,(%rcx)
mov    %rdx,%r14
movzwl (%rdx),%eax
shl    $0x8,%eax
movzwl %ax,%edi
mov    %r15d,%esi
mov    %rbp,%rdx
call   1030 <LowPassMul@plt>
lea    0x7f(%rax),%ecx
shr    $0x8,%ecx
mov    %cx,(%r14)
add    $0x7fff,%eax
shr    $0x10,%eax
mov    %al,(%rbx)
mov    0xc(%rsp),%eax
movslq %eax,%rdx
cmp    $0x2,%eax
jl     1266 <deNoise+0x126>
mov    $0x1,%ebp
movzbl 0x0(%r13,%rbp,1),%esi
shl    $0x10,%esi
movzwl %r15w,%edi
mov    %rdx,%r12
mov    0xc0(%rsp),%rdx
call   1030 <LowPassMul@plt>
mov    %eax,%r15d
mov    0x38(%rsp),%rax
mov    %r15d,(%rax,%rbp,4)
movzwl (%r14,%rbp,2),%eax
shl    $0x8,%eax
movzwl %ax,%edi
mov    %r15d,%esi
mov    0xd0(%rsp),%rdx
call   1030 <LowPassMul@plt>
mov    %r12,%rdx
lea    0x7f(%rax),%ecx
shr    $0x8,%ecx
mov    %cx,(%r14,%rbp,2)
add    $0x7fff,%eax
shr    $0x10,%eax
mov    %al,(%rbx,%rbp,1)
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1200 <deNoise+0xc0>
mov    %r14,0x10(%rsp)
mov    %r13,0x18(%rsp)
mov    %rbx,0x28(%rsp)
mov    0x20(%rsp),%eax
cmp    $0x2,%eax
mov    0xb0(%rsp),%ecx
jl     15fa <deNoise+0x4ba>
cltq
mov    %rax,0x60(%rsp)
movslq %ecx,%rcx
mov    0xb8(%rsp),%eax
movslq %eax,%rsi
mov    0x28(%rsp),%rax
lea    (%rax,%rsi,1),%r14
mov    0x10(%rsp),%rax
lea    (%rax,%rdx,2),%rbp
lea    (%rdx,%rdx,1),%rax
mov    %rax,0x48(%rsp)
mov    0x18(%rsp),%rax
lea    (%rax,%rcx,1),%r8
mov    $0x1,%ebx
xor    %edi,%edi
xor    %eax,%eax
mov    %rax,0x30(%rsp)
mov    %rcx,0x58(%rsp)
mov    %rsi,0x50(%rsp)
mov    %rdx,0x40(%rsp)
jmp    131b <deNoise+0x1db>
mov    0x70(%rsp),%rbx
add    $0x1,%rbx
mov    0x50(%rsp),%rsi
add    %rsi,%r14
add    0x48(%rsp),%rbp
mov    0x58(%rsp),%rcx
mov    0x20(%rsp),%rax
add    %rcx,%rax
cmp    0x60(%rsp),%rbx
mov    0x40(%rsp),%rdx
mov    %rax,%r8
mov    0x68(%rsp),%rdi
je     15fa <deNoise+0x4ba>
mov    %r8,0x20(%rsp)
mov    %rbx,0x70(%rsp)
imul   %rdx,%rbx
add    %rcx,%rdi
mov    0x30(%rsp),%r15
add    %rsi,%r15
mov    0x18(%rsp),%rax
mov    %rdi,0x68(%rsp)
movzbl (%rax,%rdi,1),%r12d
shl    $0x10,%r12d
mov    0x38(%rsp),%r13
movzwl 0x0(%r13),%edi
mov    %r12d,%esi
mov    0xc8(%rsp),%rdx
call   1030 <LowPassMul@plt>
mov    %eax,0x0(%r13)
mov    0x10(%rsp),%rcx
movzwl (%rcx,%rbx,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,%rbx,2)
mov    %r13,%rbx
mov    0x28(%rsp),%rcx
mov    %r15,0x30(%rsp)
mov    %al,(%rcx,%r15,1)
cmpl   $0x2,0xc(%rsp)
mov    0xc0(%rsp),%r13
jl     12e0 <deNoise+0x1a0>
mov    $0x1,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x20(%rsp),%rax
movzbl (%rax,%r15,1),%esi
shl    $0x10,%esi
movzwl %r12w,%edi
mov    %r13,%rdx
call   1030 <LowPassMul@plt>
mov    %eax,%r12d
movzwl (%rbx,%r15,4),%edi
mov    %eax,%esi
mov    0xc8(%rsp),%rdx
call   1030 <LowPassMul@plt>
mov    %eax,(%rbx,%r15,4)
movzwl 0x0(%rbp,%r15,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,0x0(%rbp,%r15,2)
add    $0x7fff,%eax
shr    $0x10,%eax
mov    %al,(%r14,%r15,1)
add    $0x1,%r15
cmp    %r15,0x40(%rsp)
jne    13d0 <deNoise+0x290>
jmp    12e0 <deNoise+0x1a0>
mov    %rcx,%rbp
mov    %r13,0x18(%rsp)
mov    %rbx,0x28(%rsp)
mov    0xc(%rsp),%edi
imul   %r14d,%edi
add    %edi,%edi
call   1050 <malloc@plt>
mov    %rax,0x0(%rbp)
mov    %rax,0x10(%rsp)
test   %rax,%rax
je     15fa <deNoise+0x4ba>
test   %r14d,%r14d
jle    1677 <deNoise+0x537>
mov    %r14d,0x20(%rsp)
movslq %r14d,%r11
movslq 0xc(%rsp),%rcx
movslq %r15d,%r15
lea    -0x10(%rcx),%r14
mov    %r14,%r9
shr    $0x4,%r9
add    $0x1,%r9
mov    %rcx,%r10
and    $0xfffffffffffffff0,%r10
mov    %r9,%rax
and    $0xfffffffffffffffe,%rax
mov    %rax,0x30(%rsp)
mov    0x18(%rsp),%rdx
lea    0x18(%rdx),%rsi
mov    0x10(%rsp),%rbp
lea    0x30(%rbp),%rdi
lea    (%rcx,%rcx,1),%r12
xor    %r13d,%r13d
mov    %r10,0x40(%rsp)
jmp    14e9 <deNoise+0x3a9>
add    $0x1,%r13
add    %r15,%rsi
add    %r12,%rdi
add    %r12,%rbp
add    %r15,%rdx
cmp    %r11,%r13
je     162c <deNoise+0x4ec>
cmpl   $0x0,0xc(%rsp)
jle    14d0 <deNoise+0x390>
cmpl   $0x10,0xc(%rsp)
jae    1500 <deNoise+0x3c0>
xor    %eax,%eax
jmp    15e0 <deNoise+0x4a0>
xchg   %ax,%ax
cmp    $0x10,%r14
jae    150a <deNoise+0x3ca>
xor    %eax,%eax
jmp    1578 <deNoise+0x438>
mov    0x30(%rsp),%rbx
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,%rbx
jne    1520 <deNoise+0x3e0>
test   $0x1,%r9b
je     15d3 <deNoise+0x493>
mov    %r13,%rbx
imul   %rcx,%rbx
mov    %r13,%r8
imul   %r15,%r8
add    0x18(%rsp),%r8
mov    %r11,%r10
mov    %r9,%r11
mov    0x10(%rsp),%r9
lea    (%r9,%rbx,2),%rbx
mov    %r11,%r9
mov    %r10,%r11
movq   (%r8,%rax,1),%xmm0
movq   0x8(%r8,%rax,1),%xmm1
mov    0x40(%rsp),%r10
pxor   %xmm2,%xmm2
punpcklbw %xmm0,%xmm2
pxor   %xmm0,%xmm0
punpcklbw %xmm1,%xmm0
movdqu %xmm2,(%rbx,%rax,2)
movdqu %xmm0,0x10(%rbx,%rax,2)
mov    %r10,%rax
cmp    %rcx,%r10
je     14d0 <deNoise+0x390>
nop
movzbl (%rdx,%rax,1),%ebx
shl    $0x8,%ebx
mov    %bx,0x0(%rbp,%rax,2)
add    $0x1,%rax
cmp    %rax,%rcx
jne    15e0 <deNoise+0x4a0>
jmp    14d0 <deNoise+0x390>
add    $0x78,%rsp
jmp    166c <deNoise+0x52c>
sub    $0x8,%rsp
mov    %r13,%rdi
mov    %rbx,%rsi
mov    0x40(%rsp),%rdx
mov    0x14(%rsp),%ecx
mov    %r14d,%r8d
mov    %r15d,%r9d
push   %r10
push   %rax
push   %r11
call   1060 <deNoiseSpacial@plt>
add    $0x98,%rsp
jmp    166c <deNoise+0x52c>
mov    0x28(%rsp),%rbx
mov    0x18(%rsp),%r13
mov    0x10(%rsp),%rdx
mov    0x20(%rsp),%r14d
mov    0xb0(%rsp),%r15d
jmp    1175 <deNoise+0x35>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    0xc(%rsp),%ecx
mov    %r14d,%r8d
mov    %r15d,%r9d
push   %rbp
push   %r11
call   1040 <deNoiseTemporal@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x28(%rsp),%rbx
mov    0x18(%rsp),%r13
mov    0x10(%rsp),%rdx
jmp    1175 <deNoise+0x35>

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