<garvit244>147_1.py
def insertionSortList( head):
    if not head:
        return None
    
    sortedList = head
    head = head.next
    sortedList.next = None
    
    while head:
        curr = head
        head = head.next
        if curr.val <= sortedList.val:
            curr.next = sortedList
            sortedList = curr
        else:
            temp = sortedList
            while temp.next and temp.next.val < curr.val:
                temp = temp.next
            curr.next = temp.next
            temp.next = curr
    return sortedList
def sample_funcname ( var_0 ) :
    if not var_0 :
        return None
    var_2 = var_0
    var_0 = var_0.next
    var_2.next = None
    while var_0 :
        var_4 = var_0
        var_0 = var_0.next
        if var_4.val <= var_2.val :
            var_4.next = var_2
            var_2 = var_4
        else :
            var_6 = var_2
            while var_6.next and var_6.next.val < var_4.val :
                var_6 = var_6.next
            var_4.next = var_6.next
            var_6.next = var_4
    return var_2
