package thread
import (
	πg "grumpy"
)
func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseException) {
	ß__frame__ := πg.InternStr("__frame__")
	ßf_back := πg.InternStr("f_back")
	ßget_ident := πg.InternStr("get_ident")
	ßid := πg.InternStr("id")
	var πTemp001 *πg.Object
	_ = πTemp001
	var πTemp002 []πg.FunctionArg
	_ = πTemp002
	var πE *πg.BaseException; _ = πE
	for ; πF.State() >= 0; πF.PopCheckpoint() {
		switch πF.State() {
		case 0:
		default: panic("unexpected function state")
		}
		// line 1: def get_ident():
		πF.SetLineno(1)
		πTemp002 = make([]πg.FunctionArg, 0)
		πTemp001 = πg.NewFunction(πg.NewCode("get_ident", "lib/thread.py", πTemp002, 0, func(πF *πg.Frame, πArgs []*πg.Object) (*πg.Object, *πg.BaseException) {
			var µf *πg.Object = πg.UnboundLocal; _ = µf
			var πTemp001 *πg.Object
			_ = πTemp001
			var πTemp002 *πg.Object
			_ = πTemp002
			var πTemp003 bool
			_ = πTemp003
			var πTemp004 []*πg.Object
			_ = πTemp004
			var πE *πg.BaseException; _ = πE
			for ; πF.State() >= 0; πF.PopCheckpoint() {
				switch πF.State() {
				case 0:
				default: panic("unexpected function state")
				}
				// line 2: f = __frame__()
				πF.SetLineno(2)
				if πTemp001, πE = πg.ResolveGlobal(πF, ß__frame__); πE != nil {
					continue
				}
				if πTemp002, πE = πTemp001.Call(πF, nil, nil); πE != nil {
					continue
				}
				µf = πTemp002
				// line 3: while f.f_back:
				πF.SetLineno(3)
			Label1:
				if πE = πg.CheckLocal(πF, µf, "f"); πE != nil {
					continue
				}
				if πTemp001, πE = πg.GetAttr(πF, µf, ßf_back, nil); πE != nil {
					continue
				}
				if πTemp003, πE = πg.IsTrue(πF, πTemp001); πE != nil {
					continue
				}
				if !πTemp003 {
					goto Label2
				}
				// line 4: f = f.f_back
				πF.SetLineno(4)
				if πE = πg.CheckLocal(πF, µf, "f"); πE != nil {
					continue
				}
				if πTemp002, πE = πg.GetAttr(πF, µf, ßf_back, nil); πE != nil {
					continue
				}
				µf = πTemp002
				goto Label1
				goto Label2
			Label2:
				// line 5: return id(f)
				πF.SetLineno(5)
				πTemp004 = πF.MakeArgs(1)
				if πE = πg.CheckLocal(πF, µf, "f"); πE != nil {
					continue
				}
				πTemp004[0] = µf
				if πTemp001, πE = πg.ResolveGlobal(πF, ßid); πE != nil {
					continue
				}
				if πTemp002, πE = πTemp001.Call(πF, πTemp004, nil); πE != nil {
					continue
				}
				πF.FreeArgs(πTemp004)
				return πTemp002, nil
				return nil, nil
			}
			return nil, πE
		}), πF.Globals()).ToObject()
		if πE = πF.Globals().SetItem(πF, ßget_ident.ToObject(), πTemp001); πE != nil {
			continue
		}
		return nil, nil
	}
	return nil, πE
}
var Code *πg.Code
func init() {
	Code = πg.NewCode("<module>", "lib/thread.py", nil, 0, initModule)
}
