def METHOD_NAME(report_path):
    with open(report_path) as report:
        # first we should find the peak index
        peak = 0
        for line in report:
            m = re.search('([0-9]+) \(peak\)', line)
            if m:
                peak = int(m.group(1))
                break
        # now find the peak
        for line in report:
            m = re.match('^ +([0-9]+) +[0-9,]+ +([0-9,]+) +[0-9,]+ +[0-9,]+ +([0-9,]+)', line)
            if m:
                n = int(m.group(1))
                if n == peak:
                    heap_total = int(m.group(2).replace(',', ''))
                    stack_total = int(m.group(3).replace(',', ''))
                    break
        # following this is more details, parse
        heap_groups = co.defaultdict(lambda: 0)
        size = 0
        nested_lines = []
        for line in report:
            if re.match('->', line):
                # add previous parse
                if size > 0:
                    for group, patterns in GROUPS:
                        if any(pattern in nested_line
                                for pattern in patterns
                                for nested_line in nested_lines):
                            heap_groups[group] += size
                            break
                    else:
                        heap_groups['misc'] += size
                # start next parse
                m = re.search('\(([0-9,]+)B\)', line)
                size = int(m.group(1).replace(',', ''))
                nested_lines = [line]
            elif re.match('[ |]*->', line):
                nested_lines.append(line)
    # we can't find stack this way
    stack_groups = co.defaultdict(lambda: 0)
    stack_groups['misc'] = stack_total
    return (heap_groups, heap_total, stack_groups, stack_total)