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