MCPcopy Index your code
hub / github.com/dispatchrun/coroutine / FizzBuzzSwitchGenerator

Function FizzBuzzSwitchGenerator

compiler/testdata/coroutine_durable.go:318–400  ·  view source on GitHub ↗

go:noinline

(_fn0 int)

Source from the content-addressed store, hash-verified

316
317//go:noinline
318func FizzBuzzSwitchGenerator(_fn0 int) {
319 _c := coroutine.LoadContext[int, any]()
320 var _f0 *struct {
321 IP int
322 X0 int
323 X1 int
324 X2 bool
325 X3 bool
326 X4 bool
327 } = coroutine.Push[struct {
328 IP int
329 X0 int
330 X1 int
331 X2 bool
332 X3 bool
333 X4 bool
334 }](&_c.Stack)
335 if _f0.IP == 0 {
336 *_f0 = struct {
337 IP int
338 X0 int
339 X1 int
340 X2 bool
341 X3 bool
342 X4 bool
343 }{X0: _fn0}
344 }
345 defer func() {
346 if !_c.Unwinding() {
347 coroutine.Pop(&_c.Stack)
348 }
349 }()
350 switch {
351 case _f0.IP < 2:
352 _f0.X1 = 1
353 _f0.IP = 2
354 fallthrough
355 case _f0.IP < 9:
356 for ; _f0.X1 <= _f0.X0; _f0.X1, _f0.IP = _f0.X1+1, 2 {
357 switch {
358 default:
359 switch {
360 case _f0.IP < 3:
361 _f0.X2 = _f0.X1%
362 3 == 0 && _f0.X1%5 == 0
363 _f0.IP = 3
364 fallthrough
365 case _f0.IP < 9:
366 if _f0.X2 {
367 coroutine.Yield[int, any](FizzBuzz)
368 } else {
369 switch {
370 case _f0.IP < 5:
371 _f0.X3 = _f0.X1%
372 3 == 0
373 _f0.IP = 5
374 fallthrough
375 case _f0.IP < 9:

Callers

nothing calls this directly

Calls 3

LoadContextFunction · 0.92
PopFunction · 0.92
UnwindingMethod · 0.80

Tested by

no test coverage detected