namespace eval algo2 {


# Autogenerated with DRAKON Editor 1.27

proc denormalized { condition1 condition2 condition3 } {
    #item 151
    set result "A"
    #item 148
    if {$condition1} {
        #item 158
        if {$condition3} {
            #item 157
            append result "E"
        } else {
            #item 156
            append result "D"
        }
    } else {
        #item 152
        append result "B"
        #item 153
        if {$condition2} {
            #item 158
            if {$condition3} {
                #item 157
                append result "E"
            } else {
                #item 156
                append result "D"
            }
        } else {
            #item 155
            append result "C"
        }
    }
    #item 159
    append result "F"
    #item 160
    return $result
}

proc empty { } {
    
}

proc empty_if { condition } {
    #item 13
    if {$condition} {
        
    } else {
        
    }
}

proc left_if { condition } {
    #item 25
    set a 0
    #item 22
    if {$condition} {
        
    } else {
        #item 21
        set a A
    }
    #item 26
    return $a
}

proc nested_empty_if { condition1 condition2 condition3 } {
    #item 54
    if {$condition1} {
        #item 57
        if {$condition3} {
            
        } else {
            
        }
    } else {
        #item 59
        if {$condition2} {
            
        } else {
            
        }
    }
}

proc nested_if { condition1 condition2 condition3 } {
    #item 74
    set result "A"
    #item 66
    if {$condition1} {
        #item 71
        if {$condition2} {
            #item 73
            append result "B"
        } else {
            
        }
    } else {
        #item 69
        if {$condition3} {
            
        } else {
            #item 76
            append result "C"
        }
    }
    #item 75
    return $result
}

proc nested_if2 { condition1 condition2 condition3 } {
    #item 90
    set result "A"
    #item 82
    if {$condition1} {
        #item 87
        if {$condition2} {
            #item 89
            append result "B"
        } else {
            
        }
        #item 95
        append result "D"
    } else {
        #item 85
        if {$condition3} {
            
        } else {
            #item 92
            append result "C"
        }
        #item 96
        append result "E"
    }
    #item 91
    return $result
}

proc nested_if3 { condition1 condition2 condition3 } {
    #item 110
    set result "A"
    #item 102
    if {$condition1} {
        #item 107
        if {$condition2} {
            #item 109
            append result "B"
        } else {
            #item 117
            append result "F"
        }
        #item 115
        append result "D"
    } else {
        #item 105
        if {$condition3} {
            #item 118
            append result "G"
        } else {
            #item 112
            append result "C"
        }
        #item 116
        append result "E"
    }
    #item 111
    return $result
}

proc nested_if4 { condition1 condition2 condition3 } {
    #item 132
    set result "A"
    #item 124
    if {$condition1} {
        #item 141
        append result "H"
        #item 129
        if {$condition2} {
            #item 131
            append result "B"
        } else {
            #item 139
            append result "F"
        }
        #item 137
        append result "D"
    } else {
        #item 142
        append result "I"
        #item 127
        if {$condition3} {
            #item 140
            append result "G"
        } else {
            #item 134
            append result "C"
        }
        #item 138
        append result "E"
    }
    #item 133
    return $result
}

proc normal_if { condition } {
    #item 44
    if {$condition} {
        #item 47
        set a B
    } else {
        #item 43
        set a A
    }
    #item 48
    return $a
}

proc one_op { } {
    #item 7
    return 300
}

proc right_if { condition } {
    #item 36
    set a 0
    #item 33
    if {$condition} {
        #item 32
        set a A
    } else {
        
    }
    #item 37
    return $a
}

proc switch_bug { items special } {
    #item 218
    set result ""
    foreach item $items {
        #item 201
        if {$item == "foo"} {
            #item 204
            set exit_message "foo$result"
            #item 216
            set result "2-$exit_message"
            break
        } else {
            
        }
        #item 205
        append result "U"
        #item 2130001
        if {$special == "good"} {
            
        } else {
            #item 211
            set exit_message "x$result"
            #item 216
            set result "2-$exit_message"
            break
        }
        #item 217
        append result "V"
    }
    #item 215
    return $result
}

proc xloop_2exits { n } {
    #item 187
    set i 1
    set result 1
    while { 1 } {
        #item 188
        if {$i < $n} {
            
        } else {
            break
        }
        #item 191
        set result [ expr { $result * $i } ]
        incr i
        #item 193
        if {$result > 10} {
            break
        } else {
            
        }
    }
    #item 190
    return $result
}

proc xloop_simple { n } {
    #item 166
    set i 1
    set result 1
    while { 1 } {
        #item 170
        set result [ expr { $result * $i } ]
        incr i
        #item 167
        if {$i >= $n} {
            break
        } else {
            
        }
    }
    #item 169
    return $result
}

proc xloop_simple2 { n } {
    #item 176
    set i 1
    set result 1
    while { 1 } {
        #item 177
        if {$i < $n} {
            
        } else {
            break
        }
        #item 180
        set result [ expr { $result * $i } ]
        incr i
    }
    #item 179
    return $result
}

}
