 
 private struct Ctl {
     let reverse: Bool
-    var path : [Int]
+    var path : UnsafeMutablePointer<Int>
     var pathPosition: [Int: Point]
 }

            if -p <= delta {
                for k in -p..<delta {
                    ctl.path[k + offset] = ctl.pathPosition.count
                    let kRes = calcFootPrint(ctl: ctl, fp: fp, index: k + offset)
                    
                    (fp[k + offset], ctl.pathPosition[ctl.pathPosition.count]) = snake(xAxis: xAxisPointer, yAxis: yAxisPointer, xAxisCount: xAxisCount, yAxisCount: yAxisCount, k: k, y: kRes.y, r: kRes.r)
                }
            }
            
            if delta <= delta + p {
                for k in stride(from: delta + p, to: delta, by: -1) {
                    ctl.path[k + offset] = ctl.pathPosition.count
                    let kRes = calcFootPrint(ctl: ctl, fp: fp, index: k + offset)
                    
                    (fp[k + offset], ctl.pathPosition[ctl.pathPosition.count]) = snake(xAxis: xAxisPointer, yAxis: yAxisPointer, xAxisCount: xAxisCount, yAxisCount: yAxisCount, k: k, y: kRes.y, r: kRes.r)
                }
            }
            
            ctl.path[delta + offset] = ctl.pathPosition.count
            let deltaResult = calcFootPrint(ctl: ctl, fp: fp, index: delta + offset)
            
            (fp[delta + offset], ctl.pathPosition[ctl.pathPosition.count]) = snake(xAxis: xAxisPointer, yAxis: yAxisPointer, xAxisCount: xAxisCount, yAxisCount: yAxisCount, k: delta, y: deltaResult.y, r: deltaResult.r)
            
            if fp[delta + offset] >= yAxisCount {
                break
            }
            
            p += 1
        }
        
        var r = ctl.path[delta + offset]
        var epc = [Int: Point]()
        while (r != -1) {
            epc[epc.count] = Point(x: ctl.pathPosition[r]!.x, y: ctl.pathPosition[r]!.y, k: -1)

        return editScript
    }
    
    private func calcFootPrint(ctl: Ctl, fp: UnsafeMutablePointer<Int>, index: Int) -> (r: Int, y: Int) {
        let lsP = fp[index - 1] + 1
        let rsP = fp[index + 1]
        let r = lsP > rsP ? ctl.path[index - 1] : ctl.path[index + 1]
