52 lines
1.9 KiB
Plaintext
Vendored
52 lines
1.9 KiB
Plaintext
Vendored
// FILE: /factorial.kt
|
|
// FUN: factorial
|
|
BB 0
|
|
CONTENT
|
|
1 FUN public fun factorial(i: kotlin.Int): kotlin.Int
|
|
2 CONST Int type=kotlin.Int value='1'
|
|
3 VAR var result: kotlin.Int
|
|
4 CONST Int type=kotlin.Int value='2'
|
|
5 GET_VAR 'value-parameter i: Int' type=kotlin.Int origin=null
|
|
6 CALL 'rangeTo(Int): IntRange' type=kotlin.ranges.IntRange origin=RANGE
|
|
7 CALL 'iterator(): IntIterator' type=kotlin.collections.IntIterator origin=FOR_LOOP_ITERATOR
|
|
8 VAR IR_TEMPORARY_VARIABLE val tmp0_iterator: kotlin.collections.IntIterator
|
|
9 WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
|
OUTGOING -> BB 1
|
|
While entry: WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
|
BB 1
|
|
INCOMING <- BB 0, 2
|
|
While entry: WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
|
CONTENT
|
|
1 GET_VAR 'tmp0_iterator: IntIterator' type=kotlin.collections.IntIterator origin=null
|
|
OUTGOING -> BB 2, 3
|
|
CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
|
|
BB 2
|
|
INCOMING <- BB 1
|
|
CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
|
|
CONTENT
|
|
1 GET_VAR 'tmp0_iterator: IntIterator' type=kotlin.collections.IntIterator origin=null
|
|
2 CALL 'next(): Int' type=kotlin.Int origin=FOR_LOOP_NEXT
|
|
3 VAR val j: kotlin.Int
|
|
4 SET_VAR 'result: Int' type=kotlin.Unit origin=MULTEQ
|
|
OUTGOING -> BB 1
|
|
While entry: WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
|
BB 3
|
|
INCOMING <- BB 1
|
|
CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
|
|
CONTENT
|
|
OUTGOING -> BB 4
|
|
While exit: WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
|
BB 4
|
|
INCOMING <- BB 3
|
|
While exit: WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
|
CONTENT
|
|
1 GET_VAR 'result: Int' type=kotlin.Int origin=null
|
|
2 RETURN type=kotlin.Nothing from='factorial(Int): Int'
|
|
OUTGOING -> NONE
|
|
Function exit: FUN public fun factorial(i: kotlin.Int): kotlin.Int
|
|
|
|
// END FUN: factorial
|
|
|
|
// END FILE: /factorial.kt
|
|
|