Instantly share code, notes, and snippets.

Embed
What would you like to do?
Swift Unboxed: @objc and dynamic dispatch
/*
@objc and dynamic dispatch demo
From the article "@objc, Swift, and the Depths of Dynamic Dispatch"
https://swiftunboxed.com/interop/objc-dynamic/
*/
import Foundation
class ToObjcOrNotObjc {
@discardableResult
@objc dynamic func performDynamicOperation() -> Int {
return 42
}
@discardableResult
@objc func performOcOperation() -> Int {
return 42
}
@discardableResult
func performOperation() -> Int {
return 42
}
}
// This function exists to have a single place with the three calls next to
// each other for easy inspection and comparison.
func callSite() {
let q = ToObjcOrNotObjc()
q.performOperation()
q.performOcOperation()
q.performDynamicOperation()
}
let iterations = 100000000
let q = ToObjcOrNotObjc()
do {
let startTime = Date()
for _ in 0...iterations {
q.performOperation()
}
let timing = Date().timeIntervalSince(startTime)
print("Time for \(iterations)x performOperation: \(timing)s")
}
do {
let startTime = Date()
for _ in 0...iterations {
q.performOcOperation()
}
let timing = Date().timeIntervalSince(startTime)
print("Time for \(iterations)x performOcOperation: \(timing)s")
}
do {
let startTime = Date()
for _ in 0...iterations {
q.performDynamicOperation()
}
let timing = Date().timeIntervalSince(startTime)
print("Time for \(iterations)x performDynamicOperation: \(timing)s")
}
sil_stage raw
import Builtin
import Swift
import SwiftShims
// iterations
sil_global hidden [let] @_T07orchard10iterationsSiv : $Int
// q
sil_global hidden [let] @_T07orchard1qAA011ToObjcOrNotC0Cv : $ToObjcOrNotObjc
// main
sil @main : $@convention(c) (Int32, UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>) -> Int32 {
bb0(%0 : $Int32, %1 : $UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>):
alloc_global @_T07orchard10iterationsSiv // id: %2
%3 = global_addr @_T07orchard10iterationsSiv : $*Int // users: %392, %316, %249, %173, %106, %30, %8
// function_ref Int.init(_builtinIntegerLiteral:)
%4 = function_ref @_T0S2iBi2048_22_builtinIntegerLiteral_tcfC : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %7
%5 = metatype $@thin Int.Type // user: %7
%6 = integer_literal $Builtin.Int2048, 100000000 // user: %7
%7 = apply %4(%6, %5) : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %8
store %7 to [trivial] %3 : $*Int // id: %8
alloc_global @_T07orchard1qAA011ToObjcOrNotC0Cv // id: %9
%10 = global_addr @_T07orchard1qAA011ToObjcOrNotC0Cv : $*ToObjcOrNotObjc // users: %342, %339, %199, %196, %56, %53, %14
// function_ref ToObjcOrNotObjc.__allocating_init()
%11 = function_ref @_T07orchard011ToObjcOrNotC0CACycfC : $@convention(method) (@thick ToObjcOrNotObjc.Type) -> @owned ToObjcOrNotObjc // user: %13
%12 = metatype $@thick ToObjcOrNotObjc.Type // user: %13
%13 = apply %11(%12) : $@convention(method) (@thick ToObjcOrNotObjc.Type) -> @owned ToObjcOrNotObjc // user: %14
store %13 to [init] %10 : $*ToObjcOrNotObjc // id: %14
// function_ref Date.init()
%15 = function_ref @_T010Foundation4DateVACycfC : $@convention(method) (@thin Date.Type) -> Date // user: %17
%16 = metatype $@thin Date.Type // user: %17
%17 = apply %15(%16) : $@convention(method) (@thin Date.Type) -> Date // users: %63, %18
debug_value %17 : $Date, let, name "startTime" // id: %18
%19 = alloc_box ${ var ClosedRangeIterator<Int> }, var, name "$generator" // users: %58, %20
%20 = project_box %19 : ${ var ClosedRangeIterator<Int> }, 0 // users: %45, %39
// function_ref CountableClosedRange.makeIterator()
%21 = function_ref @_T0s20CountableClosedRangeV12makeIterators0bcE0VyxGyF : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in_guaranteed CountableClosedRange<τ_0_0>) -> @out ClosedRangeIterator<τ_0_0> // user: %39
// function_ref ... infix<A>(_:_:)
%22 = function_ref @_T0s3zzzois20CountableClosedRangeVyxGx_xts10ComparableRzs11_StrideableRzs13SignedInteger6StridesAFPRpzlF : $@convention(thin) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in τ_0_0, @in τ_0_0) -> @out CountableClosedRange<τ_0_0> // user: %33
%23 = alloc_stack $CountableClosedRange<Int> // users: %41, %36, %33
// function_ref Int.init(_builtinIntegerLiteral:)
%24 = function_ref @_T0S2iBi2048_22_builtinIntegerLiteral_tcfC : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %27
%25 = metatype $@thin Int.Type // user: %27
%26 = integer_literal $Builtin.Int2048, 0 // user: %27
%27 = apply %24(%26, %25) : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %29
%28 = alloc_stack $Int // users: %35, %33, %29
store %27 to [trivial] %28 : $*Int // id: %29
%30 = load [trivial] %3 : $*Int // user: %32
%31 = alloc_stack $Int // users: %34, %33, %32
store %30 to [trivial] %31 : $*Int // id: %32
%33 = apply %22<Int, Int>(%23, %28, %31) : $@convention(thin) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in τ_0_0, @in τ_0_0) -> @out CountableClosedRange<τ_0_0>
dealloc_stack %31 : $*Int // id: %34
dealloc_stack %28 : $*Int // id: %35
%36 = load [trivial] %23 : $*CountableClosedRange<Int> // user: %38
%37 = alloc_stack $CountableClosedRange<Int> // users: %40, %39, %38
store %36 to [trivial] %37 : $*CountableClosedRange<Int> // id: %38
%39 = apply %21<Int, Int>(%20, %37) : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in_guaranteed CountableClosedRange<τ_0_0>) -> @out ClosedRangeIterator<τ_0_0>
dealloc_stack %37 : $*CountableClosedRange<Int> // id: %40
dealloc_stack %23 : $*CountableClosedRange<Int> // id: %41
br bb1 // id: %42
bb1: // Preds: bb3 bb0
// function_ref ClosedRangeIterator.next()
%43 = function_ref @_T0s19ClosedRangeIteratorV4nextxSgyF : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@inout ClosedRangeIterator<τ_0_0>) -> @out Optional<τ_0_0> // user: %46
%44 = alloc_stack $Optional<Int> // users: %49, %48, %46
%45 = begin_access [modify] [unknown] %20 : $*ClosedRangeIterator<Int> // users: %47, %46
%46 = apply %43<Int, Int>(%44, %45) : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@inout ClosedRangeIterator<τ_0_0>) -> @out Optional<τ_0_0>
end_access %45 : $*ClosedRangeIterator<Int> // id: %47
%48 = load [trivial] %44 : $*Optional<Int> // user: %50
dealloc_stack %44 : $*Optional<Int> // id: %49
switch_enum %48 : $Optional<Int>, case #Optional.some!enumelt.1: bb3, case #Optional.none!enumelt: bb2 // id: %50
bb2: // Preds: bb1
br bb4 // id: %51
bb3(%52 : $Int): // Preds: bb1
%53 = load_borrow %10 : $*ToObjcOrNotObjc // users: %56, %55, %54
%54 = class_method %53 : $ToObjcOrNotObjc, #ToObjcOrNotObjc.performOperation!1 : (ToObjcOrNotObjc) -> () -> Int, $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int // user: %55
%55 = apply %54(%53) : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int
end_borrow %53 from %10 : $ToObjcOrNotObjc, $*ToObjcOrNotObjc // id: %56
br bb1 // id: %57
bb4: // Preds: bb2
destroy_value %19 : ${ var ClosedRangeIterator<Int> } // id: %58
// function_ref Date.timeIntervalSince(_:)
%59 = function_ref @_T010Foundation4DateV17timeIntervalSinceSdACF : $@convention(method) (Date, Date) -> Double // user: %63
// function_ref Date.init()
%60 = function_ref @_T010Foundation4DateVACycfC : $@convention(method) (@thin Date.Type) -> Date // user: %62
%61 = metatype $@thin Date.Type // user: %62
%62 = apply %60(%61) : $@convention(method) (@thin Date.Type) -> Date // user: %63
%63 = apply %59(%17, %62) : $@convention(method) (Date, Date) -> Double // users: %132, %64
debug_value %63 : $Double, let, name "timing" // id: %64
// function_ref print(_:separator:terminator:)
%65 = function_ref @_T0s5printySayypGd_SS9separatorSS10terminatortF : $@convention(thin) (@owned Array<Any>, @owned String, @owned String) -> () // user: %157
%66 = integer_literal $Builtin.Word, 1 // user: %68
// function_ref _allocateUninitializedArray<A>(_:)
%67 = function_ref @_T0s27_allocateUninitializedArraySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %68
%68 = apply %67<Any>(%66) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // users: %74, %73, %69
%69 = begin_borrow %68 : $(Array<Any>, Builtin.RawPointer) // users: %73, %72, %70
%70 = tuple_extract %69 : $(Array<Any>, Builtin.RawPointer), 0 // user: %71
%71 = copy_value %70 : $Array<Any> // user: %157
%72 = tuple_extract %69 : $(Array<Any>, Builtin.RawPointer), 1 // user: %75
end_borrow %69 from %68 : $(Array<Any>, Builtin.RawPointer), $(Array<Any>, Builtin.RawPointer) // id: %73
destroy_value %68 : $(Array<Any>, Builtin.RawPointer) // id: %74
%75 = pointer_to_address %72 : $Builtin.RawPointer to [strict] $*Any // user: %76
%76 = init_existential_addr %75 : $*Any, $String // user: %152
// function_ref String.init(stringInterpolation:)
%77 = function_ref @_T0S2SSaySSG19stringInterpolationd_tcfC : $@convention(method) (@owned Array<String>, @thin String.Type) -> @owned String // user: %151
%78 = metatype $@thin String.Type // user: %151
%79 = integer_literal $Builtin.Word, 5 // user: %81
// function_ref _allocateUninitializedArray<A>(_:)
%80 = function_ref @_T0s27_allocateUninitializedArraySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %81
%81 = apply %80<String>(%79) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // users: %87, %86, %82
%82 = begin_borrow %81 : $(Array<String>, Builtin.RawPointer) // users: %86, %85, %83
%83 = tuple_extract %82 : $(Array<String>, Builtin.RawPointer), 0 // user: %84
%84 = copy_value %83 : $Array<String> // user: %151
%85 = tuple_extract %82 : $(Array<String>, Builtin.RawPointer), 1 // user: %88
end_borrow %82 from %81 : $(Array<String>, Builtin.RawPointer), $(Array<String>, Builtin.RawPointer) // id: %86
destroy_value %81 : $(Array<String>, Builtin.RawPointer) // id: %87
%88 = pointer_to_address %85 : $Builtin.RawPointer to [strict] $*String // users: %137, %128, %113, %103, %101
// function_ref String.init<A>(stringInterpolationSegment:)
%89 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzs20TextOutputStreamableRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %99
%90 = metatype $@thin String.Type // user: %99
%91 = string_literal utf8 "Time for " // user: %96
%92 = integer_literal $Builtin.Word, 9 // user: %96
%93 = integer_literal $Builtin.Int1, -1 // user: %96
%94 = metatype $@thin String.Type // user: %96
// function_ref String.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:)
%95 = function_ref @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %96
%96 = apply %95(%91, %92, %93, %94) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %98
%97 = alloc_stack $String // users: %100, %99, %98
store %96 to [init] %97 : $*String // id: %98
%99 = apply %89<String>(%97, %90) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %101
dealloc_stack %97 : $*String // id: %100
store %99 to [init] %88 : $*String // id: %101
%102 = integer_literal $Builtin.Word, 1 // user: %103
%103 = index_addr %88 : $*String, %102 : $Builtin.Word // user: %111
// function_ref String.init<A>(stringInterpolationSegment:)
%104 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible> (@in τ_0_0, @thin String.Type) -> @owned String // user: %109
%105 = metatype $@thin String.Type // user: %109
%106 = load [trivial] %3 : $*Int // user: %108
%107 = alloc_stack $Int // users: %110, %109, %108
store %106 to [trivial] %107 : $*Int // id: %108
%109 = apply %104<Int>(%107, %105) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible> (@in τ_0_0, @thin String.Type) -> @owned String // user: %111
dealloc_stack %107 : $*Int // id: %110
store %109 to [init] %103 : $*String // id: %111
%112 = integer_literal $Builtin.Word, 2 // user: %113
%113 = index_addr %88 : $*String, %112 : $Builtin.Word // user: %126
// function_ref String.init<A>(stringInterpolationSegment:)
%114 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzs20TextOutputStreamableRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %124
%115 = metatype $@thin String.Type // user: %124
%116 = string_literal utf8 "x performOperation: " // user: %121
%117 = integer_literal $Builtin.Word, 20 // user: %121
%118 = integer_literal $Builtin.Int1, -1 // user: %121
%119 = metatype $@thin String.Type // user: %121
// function_ref String.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:)
%120 = function_ref @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %121
%121 = apply %120(%116, %117, %118, %119) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %123
%122 = alloc_stack $String // users: %125, %124, %123
store %121 to [init] %122 : $*String // id: %123
%124 = apply %114<String>(%122, %115) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %126
dealloc_stack %122 : $*String // id: %125
store %124 to [init] %113 : $*String // id: %126
%127 = integer_literal $Builtin.Word, 3 // user: %128
%128 = index_addr %88 : $*String, %127 : $Builtin.Word // user: %135
// function_ref String.init<A>(stringInterpolationSegment:)
%129 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible> (@in τ_0_0, @thin String.Type) -> @owned String // user: %133
%130 = metatype $@thin String.Type // user: %133
%131 = alloc_stack $Double // users: %134, %133, %132
store %63 to [trivial] %131 : $*Double // id: %132
%133 = apply %129<Double>(%131, %130) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible> (@in τ_0_0, @thin String.Type) -> @owned String // user: %135
dealloc_stack %131 : $*Double // id: %134
store %133 to [init] %128 : $*String // id: %135
%136 = integer_literal $Builtin.Word, 4 // user: %137
%137 = index_addr %88 : $*String, %136 : $Builtin.Word // user: %150
// function_ref String.init<A>(stringInterpolationSegment:)
%138 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzs20TextOutputStreamableRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %148
%139 = metatype $@thin String.Type // user: %148
%140 = string_literal utf8 "" // user: %145
%141 = integer_literal $Builtin.Word, 0 // user: %145
%142 = integer_literal $Builtin.Int1, -1 // user: %145
%143 = metatype $@thin String.Type // user: %145
// function_ref String.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:)
%144 = function_ref @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %145
%145 = apply %144(%140, %141, %142, %143) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %147
%146 = alloc_stack $String // users: %149, %148, %147
store %145 to [init] %146 : $*String // id: %147
%148 = apply %138<String>(%146, %139) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %150
dealloc_stack %146 : $*String // id: %149
store %148 to [init] %137 : $*String // id: %150
%151 = apply %77(%84, %78) : $@convention(method) (@owned Array<String>, @thin String.Type) -> @owned String // user: %152
store %151 to [init] %76 : $*String // id: %152
// function_ref default argument 1 of print(_:separator:terminator:)
%153 = function_ref @_T0s5printySayypGd_SS9separatorSS10terminatortFfA0_ : $@convention(thin) () -> @owned String // user: %154
%154 = apply %153() : $@convention(thin) () -> @owned String // user: %157
// function_ref default argument 2 of print(_:separator:terminator:)
%155 = function_ref @_T0s5printySayypGd_SS9separatorSS10terminatortFfA1_ : $@convention(thin) () -> @owned String // user: %156
%156 = apply %155() : $@convention(thin) () -> @owned String // user: %157
%157 = apply %65(%71, %154, %156) : $@convention(thin) (@owned Array<Any>, @owned String, @owned String) -> ()
// function_ref Date.init()
%158 = function_ref @_T010Foundation4DateVACycfC : $@convention(method) (@thin Date.Type) -> Date // user: %160
%159 = metatype $@thin Date.Type // user: %160
%160 = apply %158(%159) : $@convention(method) (@thin Date.Type) -> Date // users: %206, %161
debug_value %160 : $Date, let, name "startTime" // id: %161
%162 = alloc_box ${ var ClosedRangeIterator<Int> }, var, name "$generator" // users: %201, %163
%163 = project_box %162 : ${ var ClosedRangeIterator<Int> }, 0 // users: %188, %182
// function_ref CountableClosedRange.makeIterator()
%164 = function_ref @_T0s20CountableClosedRangeV12makeIterators0bcE0VyxGyF : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in_guaranteed CountableClosedRange<τ_0_0>) -> @out ClosedRangeIterator<τ_0_0> // user: %182
// function_ref ... infix<A>(_:_:)
%165 = function_ref @_T0s3zzzois20CountableClosedRangeVyxGx_xts10ComparableRzs11_StrideableRzs13SignedInteger6StridesAFPRpzlF : $@convention(thin) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in τ_0_0, @in τ_0_0) -> @out CountableClosedRange<τ_0_0> // user: %176
%166 = alloc_stack $CountableClosedRange<Int> // users: %184, %179, %176
// function_ref Int.init(_builtinIntegerLiteral:)
%167 = function_ref @_T0S2iBi2048_22_builtinIntegerLiteral_tcfC : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %170
%168 = metatype $@thin Int.Type // user: %170
%169 = integer_literal $Builtin.Int2048, 0 // user: %170
%170 = apply %167(%169, %168) : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %172
%171 = alloc_stack $Int // users: %178, %176, %172
store %170 to [trivial] %171 : $*Int // id: %172
%173 = load [trivial] %3 : $*Int // user: %175
%174 = alloc_stack $Int // users: %177, %176, %175
store %173 to [trivial] %174 : $*Int // id: %175
%176 = apply %165<Int, Int>(%166, %171, %174) : $@convention(thin) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in τ_0_0, @in τ_0_0) -> @out CountableClosedRange<τ_0_0>
dealloc_stack %174 : $*Int // id: %177
dealloc_stack %171 : $*Int // id: %178
%179 = load [trivial] %166 : $*CountableClosedRange<Int> // user: %181
%180 = alloc_stack $CountableClosedRange<Int> // users: %183, %182, %181
store %179 to [trivial] %180 : $*CountableClosedRange<Int> // id: %181
%182 = apply %164<Int, Int>(%163, %180) : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in_guaranteed CountableClosedRange<τ_0_0>) -> @out ClosedRangeIterator<τ_0_0>
dealloc_stack %180 : $*CountableClosedRange<Int> // id: %183
dealloc_stack %166 : $*CountableClosedRange<Int> // id: %184
br bb5 // id: %185
bb5: // Preds: bb7 bb4
// function_ref ClosedRangeIterator.next()
%186 = function_ref @_T0s19ClosedRangeIteratorV4nextxSgyF : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@inout ClosedRangeIterator<τ_0_0>) -> @out Optional<τ_0_0> // user: %189
%187 = alloc_stack $Optional<Int> // users: %192, %191, %189
%188 = begin_access [modify] [unknown] %163 : $*ClosedRangeIterator<Int> // users: %190, %189
%189 = apply %186<Int, Int>(%187, %188) : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@inout ClosedRangeIterator<τ_0_0>) -> @out Optional<τ_0_0>
end_access %188 : $*ClosedRangeIterator<Int> // id: %190
%191 = load [trivial] %187 : $*Optional<Int> // user: %193
dealloc_stack %187 : $*Optional<Int> // id: %192
switch_enum %191 : $Optional<Int>, case #Optional.some!enumelt.1: bb7, case #Optional.none!enumelt: bb6 // id: %193
bb6: // Preds: bb5
br bb8 // id: %194
bb7(%195 : $Int): // Preds: bb5
%196 = load_borrow %10 : $*ToObjcOrNotObjc // users: %199, %198, %197
%197 = class_method %196 : $ToObjcOrNotObjc, #ToObjcOrNotObjc.performOcOperation!1 : (ToObjcOrNotObjc) -> () -> Int, $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int // user: %198
%198 = apply %197(%196) : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int
end_borrow %196 from %10 : $ToObjcOrNotObjc, $*ToObjcOrNotObjc // id: %199
br bb5 // id: %200
bb8: // Preds: bb6
destroy_value %162 : ${ var ClosedRangeIterator<Int> } // id: %201
// function_ref Date.timeIntervalSince(_:)
%202 = function_ref @_T010Foundation4DateV17timeIntervalSinceSdACF : $@convention(method) (Date, Date) -> Double // user: %206
// function_ref Date.init()
%203 = function_ref @_T010Foundation4DateVACycfC : $@convention(method) (@thin Date.Type) -> Date // user: %205
%204 = metatype $@thin Date.Type // user: %205
%205 = apply %203(%204) : $@convention(method) (@thin Date.Type) -> Date // user: %206
%206 = apply %202(%160, %205) : $@convention(method) (Date, Date) -> Double // users: %275, %207
debug_value %206 : $Double, let, name "timing" // id: %207
// function_ref print(_:separator:terminator:)
%208 = function_ref @_T0s5printySayypGd_SS9separatorSS10terminatortF : $@convention(thin) (@owned Array<Any>, @owned String, @owned String) -> () // user: %300
%209 = integer_literal $Builtin.Word, 1 // user: %211
// function_ref _allocateUninitializedArray<A>(_:)
%210 = function_ref @_T0s27_allocateUninitializedArraySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %211
%211 = apply %210<Any>(%209) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // users: %217, %216, %212
%212 = begin_borrow %211 : $(Array<Any>, Builtin.RawPointer) // users: %216, %215, %213
%213 = tuple_extract %212 : $(Array<Any>, Builtin.RawPointer), 0 // user: %214
%214 = copy_value %213 : $Array<Any> // user: %300
%215 = tuple_extract %212 : $(Array<Any>, Builtin.RawPointer), 1 // user: %218
end_borrow %212 from %211 : $(Array<Any>, Builtin.RawPointer), $(Array<Any>, Builtin.RawPointer) // id: %216
destroy_value %211 : $(Array<Any>, Builtin.RawPointer) // id: %217
%218 = pointer_to_address %215 : $Builtin.RawPointer to [strict] $*Any // user: %219
%219 = init_existential_addr %218 : $*Any, $String // user: %295
// function_ref String.init(stringInterpolation:)
%220 = function_ref @_T0S2SSaySSG19stringInterpolationd_tcfC : $@convention(method) (@owned Array<String>, @thin String.Type) -> @owned String // user: %294
%221 = metatype $@thin String.Type // user: %294
%222 = integer_literal $Builtin.Word, 5 // user: %224
// function_ref _allocateUninitializedArray<A>(_:)
%223 = function_ref @_T0s27_allocateUninitializedArraySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %224
%224 = apply %223<String>(%222) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // users: %230, %229, %225
%225 = begin_borrow %224 : $(Array<String>, Builtin.RawPointer) // users: %229, %228, %226
%226 = tuple_extract %225 : $(Array<String>, Builtin.RawPointer), 0 // user: %227
%227 = copy_value %226 : $Array<String> // user: %294
%228 = tuple_extract %225 : $(Array<String>, Builtin.RawPointer), 1 // user: %231
end_borrow %225 from %224 : $(Array<String>, Builtin.RawPointer), $(Array<String>, Builtin.RawPointer) // id: %229
destroy_value %224 : $(Array<String>, Builtin.RawPointer) // id: %230
%231 = pointer_to_address %228 : $Builtin.RawPointer to [strict] $*String // users: %280, %271, %256, %246, %244
// function_ref String.init<A>(stringInterpolationSegment:)
%232 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzs20TextOutputStreamableRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %242
%233 = metatype $@thin String.Type // user: %242
%234 = string_literal utf8 "Time for " // user: %239
%235 = integer_literal $Builtin.Word, 9 // user: %239
%236 = integer_literal $Builtin.Int1, -1 // user: %239
%237 = metatype $@thin String.Type // user: %239
// function_ref String.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:)
%238 = function_ref @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %239
%239 = apply %238(%234, %235, %236, %237) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %241
%240 = alloc_stack $String // users: %243, %242, %241
store %239 to [init] %240 : $*String // id: %241
%242 = apply %232<String>(%240, %233) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %244
dealloc_stack %240 : $*String // id: %243
store %242 to [init] %231 : $*String // id: %244
%245 = integer_literal $Builtin.Word, 1 // user: %246
%246 = index_addr %231 : $*String, %245 : $Builtin.Word // user: %254
// function_ref String.init<A>(stringInterpolationSegment:)
%247 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible> (@in τ_0_0, @thin String.Type) -> @owned String // user: %252
%248 = metatype $@thin String.Type // user: %252
%249 = load [trivial] %3 : $*Int // user: %251
%250 = alloc_stack $Int // users: %253, %252, %251
store %249 to [trivial] %250 : $*Int // id: %251
%252 = apply %247<Int>(%250, %248) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible> (@in τ_0_0, @thin String.Type) -> @owned String // user: %254
dealloc_stack %250 : $*Int // id: %253
store %252 to [init] %246 : $*String // id: %254
%255 = integer_literal $Builtin.Word, 2 // user: %256
%256 = index_addr %231 : $*String, %255 : $Builtin.Word // user: %269
// function_ref String.init<A>(stringInterpolationSegment:)
%257 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzs20TextOutputStreamableRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %267
%258 = metatype $@thin String.Type // user: %267
%259 = string_literal utf8 "x performOcOperation: " // user: %264
%260 = integer_literal $Builtin.Word, 22 // user: %264
%261 = integer_literal $Builtin.Int1, -1 // user: %264
%262 = metatype $@thin String.Type // user: %264
// function_ref String.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:)
%263 = function_ref @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %264
%264 = apply %263(%259, %260, %261, %262) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %266
%265 = alloc_stack $String // users: %268, %267, %266
store %264 to [init] %265 : $*String // id: %266
%267 = apply %257<String>(%265, %258) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %269
dealloc_stack %265 : $*String // id: %268
store %267 to [init] %256 : $*String // id: %269
%270 = integer_literal $Builtin.Word, 3 // user: %271
%271 = index_addr %231 : $*String, %270 : $Builtin.Word // user: %278
// function_ref String.init<A>(stringInterpolationSegment:)
%272 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible> (@in τ_0_0, @thin String.Type) -> @owned String // user: %276
%273 = metatype $@thin String.Type // user: %276
%274 = alloc_stack $Double // users: %277, %276, %275
store %206 to [trivial] %274 : $*Double // id: %275
%276 = apply %272<Double>(%274, %273) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible> (@in τ_0_0, @thin String.Type) -> @owned String // user: %278
dealloc_stack %274 : $*Double // id: %277
store %276 to [init] %271 : $*String // id: %278
%279 = integer_literal $Builtin.Word, 4 // user: %280
%280 = index_addr %231 : $*String, %279 : $Builtin.Word // user: %293
// function_ref String.init<A>(stringInterpolationSegment:)
%281 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzs20TextOutputStreamableRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %291
%282 = metatype $@thin String.Type // user: %291
%283 = string_literal utf8 "" // user: %288
%284 = integer_literal $Builtin.Word, 0 // user: %288
%285 = integer_literal $Builtin.Int1, -1 // user: %288
%286 = metatype $@thin String.Type // user: %288
// function_ref String.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:)
%287 = function_ref @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %288
%288 = apply %287(%283, %284, %285, %286) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %290
%289 = alloc_stack $String // users: %292, %291, %290
store %288 to [init] %289 : $*String // id: %290
%291 = apply %281<String>(%289, %282) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %293
dealloc_stack %289 : $*String // id: %292
store %291 to [init] %280 : $*String // id: %293
%294 = apply %220(%227, %221) : $@convention(method) (@owned Array<String>, @thin String.Type) -> @owned String // user: %295
store %294 to [init] %219 : $*String // id: %295
// function_ref default argument 1 of print(_:separator:terminator:)
%296 = function_ref @_T0s5printySayypGd_SS9separatorSS10terminatortFfA0_ : $@convention(thin) () -> @owned String // user: %297
%297 = apply %296() : $@convention(thin) () -> @owned String // user: %300
// function_ref default argument 2 of print(_:separator:terminator:)
%298 = function_ref @_T0s5printySayypGd_SS9separatorSS10terminatortFfA1_ : $@convention(thin) () -> @owned String // user: %299
%299 = apply %298() : $@convention(thin) () -> @owned String // user: %300
%300 = apply %208(%214, %297, %299) : $@convention(thin) (@owned Array<Any>, @owned String, @owned String) -> ()
// function_ref Date.init()
%301 = function_ref @_T010Foundation4DateVACycfC : $@convention(method) (@thin Date.Type) -> Date // user: %303
%302 = metatype $@thin Date.Type // user: %303
%303 = apply %301(%302) : $@convention(method) (@thin Date.Type) -> Date // users: %349, %304
debug_value %303 : $Date, let, name "startTime" // id: %304
%305 = alloc_box ${ var ClosedRangeIterator<Int> }, var, name "$generator" // users: %344, %306
%306 = project_box %305 : ${ var ClosedRangeIterator<Int> }, 0 // users: %331, %325
// function_ref CountableClosedRange.makeIterator()
%307 = function_ref @_T0s20CountableClosedRangeV12makeIterators0bcE0VyxGyF : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in_guaranteed CountableClosedRange<τ_0_0>) -> @out ClosedRangeIterator<τ_0_0> // user: %325
// function_ref ... infix<A>(_:_:)
%308 = function_ref @_T0s3zzzois20CountableClosedRangeVyxGx_xts10ComparableRzs11_StrideableRzs13SignedInteger6StridesAFPRpzlF : $@convention(thin) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in τ_0_0, @in τ_0_0) -> @out CountableClosedRange<τ_0_0> // user: %319
%309 = alloc_stack $CountableClosedRange<Int> // users: %327, %322, %319
// function_ref Int.init(_builtinIntegerLiteral:)
%310 = function_ref @_T0S2iBi2048_22_builtinIntegerLiteral_tcfC : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %313
%311 = metatype $@thin Int.Type // user: %313
%312 = integer_literal $Builtin.Int2048, 0 // user: %313
%313 = apply %310(%312, %311) : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %315
%314 = alloc_stack $Int // users: %321, %319, %315
store %313 to [trivial] %314 : $*Int // id: %315
%316 = load [trivial] %3 : $*Int // user: %318
%317 = alloc_stack $Int // users: %320, %319, %318
store %316 to [trivial] %317 : $*Int // id: %318
%319 = apply %308<Int, Int>(%309, %314, %317) : $@convention(thin) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in τ_0_0, @in τ_0_0) -> @out CountableClosedRange<τ_0_0>
dealloc_stack %317 : $*Int // id: %320
dealloc_stack %314 : $*Int // id: %321
%322 = load [trivial] %309 : $*CountableClosedRange<Int> // user: %324
%323 = alloc_stack $CountableClosedRange<Int> // users: %326, %325, %324
store %322 to [trivial] %323 : $*CountableClosedRange<Int> // id: %324
%325 = apply %307<Int, Int>(%306, %323) : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in_guaranteed CountableClosedRange<τ_0_0>) -> @out ClosedRangeIterator<τ_0_0>
dealloc_stack %323 : $*CountableClosedRange<Int> // id: %326
dealloc_stack %309 : $*CountableClosedRange<Int> // id: %327
br bb9 // id: %328
bb9: // Preds: bb11 bb8
// function_ref ClosedRangeIterator.next()
%329 = function_ref @_T0s19ClosedRangeIteratorV4nextxSgyF : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@inout ClosedRangeIterator<τ_0_0>) -> @out Optional<τ_0_0> // user: %332
%330 = alloc_stack $Optional<Int> // users: %335, %334, %332
%331 = begin_access [modify] [unknown] %306 : $*ClosedRangeIterator<Int> // users: %333, %332
%332 = apply %329<Int, Int>(%330, %331) : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@inout ClosedRangeIterator<τ_0_0>) -> @out Optional<τ_0_0>
end_access %331 : $*ClosedRangeIterator<Int> // id: %333
%334 = load [trivial] %330 : $*Optional<Int> // user: %336
dealloc_stack %330 : $*Optional<Int> // id: %335
switch_enum %334 : $Optional<Int>, case #Optional.some!enumelt.1: bb11, case #Optional.none!enumelt: bb10 // id: %336
bb10: // Preds: bb9
br bb12 // id: %337
bb11(%338 : $Int): // Preds: bb9
%339 = load_borrow %10 : $*ToObjcOrNotObjc // users: %342, %341, %340
%340 = class_method [volatile] %339 : $ToObjcOrNotObjc, #ToObjcOrNotObjc.performDynamicOperation!1.foreign : (ToObjcOrNotObjc) -> () -> Int, $@convention(objc_method) (ToObjcOrNotObjc) -> Int // user: %341
%341 = apply %340(%339) : $@convention(objc_method) (ToObjcOrNotObjc) -> Int
end_borrow %339 from %10 : $ToObjcOrNotObjc, $*ToObjcOrNotObjc // id: %342
br bb9 // id: %343
bb12: // Preds: bb10
destroy_value %305 : ${ var ClosedRangeIterator<Int> } // id: %344
// function_ref Date.timeIntervalSince(_:)
%345 = function_ref @_T010Foundation4DateV17timeIntervalSinceSdACF : $@convention(method) (Date, Date) -> Double // user: %349
// function_ref Date.init()
%346 = function_ref @_T010Foundation4DateVACycfC : $@convention(method) (@thin Date.Type) -> Date // user: %348
%347 = metatype $@thin Date.Type // user: %348
%348 = apply %346(%347) : $@convention(method) (@thin Date.Type) -> Date // user: %349
%349 = apply %345(%303, %348) : $@convention(method) (Date, Date) -> Double // users: %418, %350
debug_value %349 : $Double, let, name "timing" // id: %350
// function_ref print(_:separator:terminator:)
%351 = function_ref @_T0s5printySayypGd_SS9separatorSS10terminatortF : $@convention(thin) (@owned Array<Any>, @owned String, @owned String) -> () // user: %443
%352 = integer_literal $Builtin.Word, 1 // user: %354
// function_ref _allocateUninitializedArray<A>(_:)
%353 = function_ref @_T0s27_allocateUninitializedArraySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %354
%354 = apply %353<Any>(%352) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // users: %360, %359, %355
%355 = begin_borrow %354 : $(Array<Any>, Builtin.RawPointer) // users: %359, %358, %356
%356 = tuple_extract %355 : $(Array<Any>, Builtin.RawPointer), 0 // user: %357
%357 = copy_value %356 : $Array<Any> // user: %443
%358 = tuple_extract %355 : $(Array<Any>, Builtin.RawPointer), 1 // user: %361
end_borrow %355 from %354 : $(Array<Any>, Builtin.RawPointer), $(Array<Any>, Builtin.RawPointer) // id: %359
destroy_value %354 : $(Array<Any>, Builtin.RawPointer) // id: %360
%361 = pointer_to_address %358 : $Builtin.RawPointer to [strict] $*Any // user: %362
%362 = init_existential_addr %361 : $*Any, $String // user: %438
// function_ref String.init(stringInterpolation:)
%363 = function_ref @_T0S2SSaySSG19stringInterpolationd_tcfC : $@convention(method) (@owned Array<String>, @thin String.Type) -> @owned String // user: %437
%364 = metatype $@thin String.Type // user: %437
%365 = integer_literal $Builtin.Word, 5 // user: %367
// function_ref _allocateUninitializedArray<A>(_:)
%366 = function_ref @_T0s27_allocateUninitializedArraySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %367
%367 = apply %366<String>(%365) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // users: %373, %372, %368
%368 = begin_borrow %367 : $(Array<String>, Builtin.RawPointer) // users: %372, %371, %369
%369 = tuple_extract %368 : $(Array<String>, Builtin.RawPointer), 0 // user: %370
%370 = copy_value %369 : $Array<String> // user: %437
%371 = tuple_extract %368 : $(Array<String>, Builtin.RawPointer), 1 // user: %374
end_borrow %368 from %367 : $(Array<String>, Builtin.RawPointer), $(Array<String>, Builtin.RawPointer) // id: %372
destroy_value %367 : $(Array<String>, Builtin.RawPointer) // id: %373
%374 = pointer_to_address %371 : $Builtin.RawPointer to [strict] $*String // users: %423, %414, %399, %389, %387
// function_ref String.init<A>(stringInterpolationSegment:)
%375 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzs20TextOutputStreamableRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %385
%376 = metatype $@thin String.Type // user: %385
%377 = string_literal utf8 "Time for " // user: %382
%378 = integer_literal $Builtin.Word, 9 // user: %382
%379 = integer_literal $Builtin.Int1, -1 // user: %382
%380 = metatype $@thin String.Type // user: %382
// function_ref String.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:)
%381 = function_ref @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %382
%382 = apply %381(%377, %378, %379, %380) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %384
%383 = alloc_stack $String // users: %386, %385, %384
store %382 to [init] %383 : $*String // id: %384
%385 = apply %375<String>(%383, %376) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %387
dealloc_stack %383 : $*String // id: %386
store %385 to [init] %374 : $*String // id: %387
%388 = integer_literal $Builtin.Word, 1 // user: %389
%389 = index_addr %374 : $*String, %388 : $Builtin.Word // user: %397
// function_ref String.init<A>(stringInterpolationSegment:)
%390 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible> (@in τ_0_0, @thin String.Type) -> @owned String // user: %395
%391 = metatype $@thin String.Type // user: %395
%392 = load [trivial] %3 : $*Int // user: %394
%393 = alloc_stack $Int // users: %396, %395, %394
store %392 to [trivial] %393 : $*Int // id: %394
%395 = apply %390<Int>(%393, %391) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible> (@in τ_0_0, @thin String.Type) -> @owned String // user: %397
dealloc_stack %393 : $*Int // id: %396
store %395 to [init] %389 : $*String // id: %397
%398 = integer_literal $Builtin.Word, 2 // user: %399
%399 = index_addr %374 : $*String, %398 : $Builtin.Word // user: %412
// function_ref String.init<A>(stringInterpolationSegment:)
%400 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzs20TextOutputStreamableRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %410
%401 = metatype $@thin String.Type // user: %410
%402 = string_literal utf8 "x performDynamicOperation: " // user: %407
%403 = integer_literal $Builtin.Word, 27 // user: %407
%404 = integer_literal $Builtin.Int1, -1 // user: %407
%405 = metatype $@thin String.Type // user: %407
// function_ref String.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:)
%406 = function_ref @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %407
%407 = apply %406(%402, %403, %404, %405) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %409
%408 = alloc_stack $String // users: %411, %410, %409
store %407 to [init] %408 : $*String // id: %409
%410 = apply %400<String>(%408, %401) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %412
dealloc_stack %408 : $*String // id: %411
store %410 to [init] %399 : $*String // id: %412
%413 = integer_literal $Builtin.Word, 3 // user: %414
%414 = index_addr %374 : $*String, %413 : $Builtin.Word // user: %421
// function_ref String.init<A>(stringInterpolationSegment:)
%415 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible> (@in τ_0_0, @thin String.Type) -> @owned String // user: %419
%416 = metatype $@thin String.Type // user: %419
%417 = alloc_stack $Double // users: %420, %419, %418
store %349 to [trivial] %417 : $*Double // id: %418
%419 = apply %415<Double>(%417, %416) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible> (@in τ_0_0, @thin String.Type) -> @owned String // user: %421
dealloc_stack %417 : $*Double // id: %420
store %419 to [init] %414 : $*String // id: %421
%422 = integer_literal $Builtin.Word, 4 // user: %423
%423 = index_addr %374 : $*String, %422 : $Builtin.Word // user: %436
// function_ref String.init<A>(stringInterpolationSegment:)
%424 = function_ref @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzs20TextOutputStreamableRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %434
%425 = metatype $@thin String.Type // user: %434
%426 = string_literal utf8 "" // user: %431
%427 = integer_literal $Builtin.Word, 0 // user: %431
%428 = integer_literal $Builtin.Int1, -1 // user: %431
%429 = metatype $@thin String.Type // user: %431
// function_ref String.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:)
%430 = function_ref @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %431
%431 = apply %430(%426, %427, %428, %429) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %433
%432 = alloc_stack $String // users: %435, %434, %433
store %431 to [init] %432 : $*String // id: %433
%434 = apply %424<String>(%432, %425) : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String // user: %436
dealloc_stack %432 : $*String // id: %435
store %434 to [init] %423 : $*String // id: %436
%437 = apply %363(%370, %364) : $@convention(method) (@owned Array<String>, @thin String.Type) -> @owned String // user: %438
store %437 to [init] %362 : $*String // id: %438
// function_ref default argument 1 of print(_:separator:terminator:)
%439 = function_ref @_T0s5printySayypGd_SS9separatorSS10terminatortFfA0_ : $@convention(thin) () -> @owned String // user: %440
%440 = apply %439() : $@convention(thin) () -> @owned String // user: %443
// function_ref default argument 2 of print(_:separator:terminator:)
%441 = function_ref @_T0s5printySayypGd_SS9separatorSS10terminatortFfA1_ : $@convention(thin) () -> @owned String // user: %442
%442 = apply %441() : $@convention(thin) () -> @owned String // user: %443
%443 = apply %351(%357, %440, %442) : $@convention(thin) (@owned Array<Any>, @owned String, @owned String) -> ()
%444 = integer_literal $Builtin.Int32, 0 // user: %445
%445 = struct $Int32 (%444 : $Builtin.Int32) // user: %446
return %445 : $Int32 // id: %446
} // end sil function 'main'
// ToObjcOrNotObjc.performDynamicOperation()
sil hidden @_T07orchard011ToObjcOrNotC0C23performDynamicOperationSiyF : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int {
// %0 // user: %1
bb0(%0 : $ToObjcOrNotObjc):
debug_value %0 : $ToObjcOrNotObjc, let, name "self", argno 1 // id: %1
// function_ref Int.init(_builtinIntegerLiteral:)
%2 = function_ref @_T0S2iBi2048_22_builtinIntegerLiteral_tcfC : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %5
%3 = metatype $@thin Int.Type // user: %5
%4 = integer_literal $Builtin.Int2048, 42 // user: %5
%5 = apply %2(%4, %3) : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %6
return %5 : $Int // id: %6
} // end sil function '_T07orchard011ToObjcOrNotC0C23performDynamicOperationSiyF'
// Int.init(_builtinIntegerLiteral:)
sil [transparent] [serialized] @_T0S2iBi2048_22_builtinIntegerLiteral_tcfC : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int
// @objc ToObjcOrNotObjc.performDynamicOperation()
sil hidden [thunk] @_T07orchard011ToObjcOrNotC0C23performDynamicOperationSiyFTo : $@convention(objc_method) (ToObjcOrNotObjc) -> Int {
// %0 // user: %1
bb0(%0 : $ToObjcOrNotObjc):
%1 = copy_value %0 : $ToObjcOrNotObjc // users: %6, %5, %2
%2 = begin_borrow %1 : $ToObjcOrNotObjc // users: %5, %4
// function_ref ToObjcOrNotObjc.performDynamicOperation()
%3 = function_ref @_T07orchard011ToObjcOrNotC0C23performDynamicOperationSiyF : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int // user: %4
%4 = apply %3(%2) : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int // user: %7
end_borrow %2 from %1 : $ToObjcOrNotObjc, $ToObjcOrNotObjc // id: %5
destroy_value %1 : $ToObjcOrNotObjc // id: %6
return %4 : $Int // id: %7
} // end sil function '_T07orchard011ToObjcOrNotC0C23performDynamicOperationSiyFTo'
// ToObjcOrNotObjc.performOcOperation()
sil hidden @_T07orchard011ToObjcOrNotC0C18performOcOperationSiyF : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int {
// %0 // user: %1
bb0(%0 : $ToObjcOrNotObjc):
debug_value %0 : $ToObjcOrNotObjc, let, name "self", argno 1 // id: %1
// function_ref Int.init(_builtinIntegerLiteral:)
%2 = function_ref @_T0S2iBi2048_22_builtinIntegerLiteral_tcfC : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %5
%3 = metatype $@thin Int.Type // user: %5
%4 = integer_literal $Builtin.Int2048, 42 // user: %5
%5 = apply %2(%4, %3) : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %6
return %5 : $Int // id: %6
} // end sil function '_T07orchard011ToObjcOrNotC0C18performOcOperationSiyF'
// @objc ToObjcOrNotObjc.performOcOperation()
sil hidden [thunk] @_T07orchard011ToObjcOrNotC0C18performOcOperationSiyFTo : $@convention(objc_method) (ToObjcOrNotObjc) -> Int {
// %0 // user: %1
bb0(%0 : $ToObjcOrNotObjc):
%1 = copy_value %0 : $ToObjcOrNotObjc // users: %6, %5, %2
%2 = begin_borrow %1 : $ToObjcOrNotObjc // users: %5, %4
// function_ref ToObjcOrNotObjc.performOcOperation()
%3 = function_ref @_T07orchard011ToObjcOrNotC0C18performOcOperationSiyF : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int // user: %4
%4 = apply %3(%2) : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int // user: %7
end_borrow %2 from %1 : $ToObjcOrNotObjc, $ToObjcOrNotObjc // id: %5
destroy_value %1 : $ToObjcOrNotObjc // id: %6
return %4 : $Int // id: %7
} // end sil function '_T07orchard011ToObjcOrNotC0C18performOcOperationSiyFTo'
// ToObjcOrNotObjc.performOperation()
sil hidden @_T07orchard011ToObjcOrNotC0C16performOperationSiyF : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int {
// %0 // user: %1
bb0(%0 : $ToObjcOrNotObjc):
debug_value %0 : $ToObjcOrNotObjc, let, name "self", argno 1 // id: %1
// function_ref Int.init(_builtinIntegerLiteral:)
%2 = function_ref @_T0S2iBi2048_22_builtinIntegerLiteral_tcfC : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %5
%3 = metatype $@thin Int.Type // user: %5
%4 = integer_literal $Builtin.Int2048, 42 // user: %5
%5 = apply %2(%4, %3) : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int // user: %6
return %5 : $Int // id: %6
} // end sil function '_T07orchard011ToObjcOrNotC0C16performOperationSiyF'
// ToObjcOrNotObjc.deinit
sil hidden @_T07orchard011ToObjcOrNotC0Cfd : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> @owned Builtin.NativeObject {
// %0 // users: %2, %1
bb0(%0 : $ToObjcOrNotObjc):
debug_value %0 : $ToObjcOrNotObjc, let, name "self", argno 1 // id: %1
%2 = unchecked_ref_cast %0 : $ToObjcOrNotObjc to $Builtin.NativeObject // user: %3
%3 = unchecked_ownership_conversion %2 : $Builtin.NativeObject, @guaranteed to @owned // user: %4
return %3 : $Builtin.NativeObject // id: %4
} // end sil function '_T07orchard011ToObjcOrNotC0Cfd'
// ToObjcOrNotObjc.__deallocating_deinit
sil hidden @_T07orchard011ToObjcOrNotC0CfD : $@convention(method) (@owned ToObjcOrNotObjc) -> () {
// %0 // users: %6, %5, %3, %1
bb0(%0 : $ToObjcOrNotObjc):
debug_value %0 : $ToObjcOrNotObjc, let, name "self", argno 1 // id: %1
// function_ref ToObjcOrNotObjc.deinit
%2 = function_ref @_T07orchard011ToObjcOrNotC0Cfd : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> @owned Builtin.NativeObject // user: %4
%3 = begin_borrow %0 : $ToObjcOrNotObjc // users: %5, %4
%4 = apply %2(%3) : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> @owned Builtin.NativeObject // user: %7
end_borrow %3 from %0 : $ToObjcOrNotObjc, $ToObjcOrNotObjc // id: %5
end_lifetime %0 : $ToObjcOrNotObjc // id: %6
%7 = unchecked_ref_cast %4 : $Builtin.NativeObject to $ToObjcOrNotObjc // user: %8
dealloc_ref %7 : $ToObjcOrNotObjc // id: %8
%9 = tuple () // user: %10
return %9 : $() // id: %10
} // end sil function '_T07orchard011ToObjcOrNotC0CfD'
// ToObjcOrNotObjc.__allocating_init()
sil hidden @_T07orchard011ToObjcOrNotC0CACycfC : $@convention(method) (@thick ToObjcOrNotObjc.Type) -> @owned ToObjcOrNotObjc {
bb0(%0 : $@thick ToObjcOrNotObjc.Type):
%1 = alloc_ref $ToObjcOrNotObjc // user: %3
// function_ref ToObjcOrNotObjc.init()
%2 = function_ref @_T07orchard011ToObjcOrNotC0CACycfc : $@convention(method) (@owned ToObjcOrNotObjc) -> @owned ToObjcOrNotObjc // user: %3
%3 = apply %2(%1) : $@convention(method) (@owned ToObjcOrNotObjc) -> @owned ToObjcOrNotObjc // user: %4
return %3 : $ToObjcOrNotObjc // id: %4
} // end sil function '_T07orchard011ToObjcOrNotC0CACycfC'
// ToObjcOrNotObjc.init()
sil hidden @_T07orchard011ToObjcOrNotC0CACycfc : $@convention(method) (@owned ToObjcOrNotObjc) -> @owned ToObjcOrNotObjc {
// %0 // users: %2, %1
bb0(%0 : $ToObjcOrNotObjc):
debug_value %0 : $ToObjcOrNotObjc, let, name "self" // id: %1
%2 = mark_uninitialized [rootself] %0 : $ToObjcOrNotObjc // users: %4, %3
%3 = copy_value %2 : $ToObjcOrNotObjc // user: %5
destroy_value %2 : $ToObjcOrNotObjc // id: %4
return %3 : $ToObjcOrNotObjc // id: %5
} // end sil function '_T07orchard011ToObjcOrNotC0CACycfc'
// callSite()
sil hidden @_T07orchard8callSiteyyF : $@convention(thin) () -> () {
bb0:
// function_ref ToObjcOrNotObjc.__allocating_init()
%0 = function_ref @_T07orchard011ToObjcOrNotC0CACycfC : $@convention(method) (@thick ToObjcOrNotObjc.Type) -> @owned ToObjcOrNotObjc // user: %2
%1 = metatype $@thick ToObjcOrNotObjc.Type // user: %2
%2 = apply %0(%1) : $@convention(method) (@thick ToObjcOrNotObjc.Type) -> @owned ToObjcOrNotObjc // users: %16, %15, %12, %11, %8, %7, %4, %3
debug_value %2 : $ToObjcOrNotObjc, let, name "q" // id: %3
%4 = begin_borrow %2 : $ToObjcOrNotObjc // users: %7, %6, %5
%5 = class_method %4 : $ToObjcOrNotObjc, #ToObjcOrNotObjc.performOperation!1 : (ToObjcOrNotObjc) -> () -> Int, $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int // user: %6
%6 = apply %5(%4) : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int
end_borrow %4 from %2 : $ToObjcOrNotObjc, $ToObjcOrNotObjc // id: %7
%8 = begin_borrow %2 : $ToObjcOrNotObjc // users: %11, %10, %9
%9 = class_method %8 : $ToObjcOrNotObjc, #ToObjcOrNotObjc.performOcOperation!1 : (ToObjcOrNotObjc) -> () -> Int, $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int // user: %10
%10 = apply %9(%8) : $@convention(method) (@guaranteed ToObjcOrNotObjc) -> Int
end_borrow %8 from %2 : $ToObjcOrNotObjc, $ToObjcOrNotObjc // id: %11
%12 = begin_borrow %2 : $ToObjcOrNotObjc // users: %15, %14, %13
%13 = class_method [volatile] %12 : $ToObjcOrNotObjc, #ToObjcOrNotObjc.performDynamicOperation!1.foreign : (ToObjcOrNotObjc) -> () -> Int, $@convention(objc_method) (ToObjcOrNotObjc) -> Int // user: %14
%14 = apply %13(%12) : $@convention(objc_method) (ToObjcOrNotObjc) -> Int
end_borrow %12 from %2 : $ToObjcOrNotObjc, $ToObjcOrNotObjc // id: %15
destroy_value %2 : $ToObjcOrNotObjc // id: %16
%17 = tuple () // user: %18
return %17 : $() // id: %18
} // end sil function '_T07orchard8callSiteyyF'
// Date.init()
sil @_T010Foundation4DateVACycfC : $@convention(method) (@thin Date.Type) -> Date
// CountableClosedRange.makeIterator()
sil [serialized] @_T0s20CountableClosedRangeV12makeIterators0bcE0VyxGyF : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in_guaranteed CountableClosedRange<τ_0_0>) -> @out ClosedRangeIterator<τ_0_0>
// ... infix<A>(_:_:)
sil [transparent] [serialized] @_T0s3zzzois20CountableClosedRangeVyxGx_xts10ComparableRzs11_StrideableRzs13SignedInteger6StridesAFPRpzlF : $@convention(thin) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@in τ_0_0, @in τ_0_0) -> @out CountableClosedRange<τ_0_0>
// ClosedRangeIterator.next()
sil [serialized] @_T0s19ClosedRangeIteratorV4nextxSgyF : $@convention(method) <τ_0_0 where τ_0_0 : Comparable, τ_0_0 : _Strideable, τ_0_0.Stride : SignedInteger> (@inout ClosedRangeIterator<τ_0_0>) -> @out Optional<τ_0_0>
// Date.timeIntervalSince(_:)
sil @_T010Foundation4DateV17timeIntervalSinceSdACF : $@convention(method) (Date, Date) -> Double
// print(_:separator:terminator:)
sil [noinline] [_semantics "stdlib_binary_only"] @_T0s5printySayypGd_SS9separatorSS10terminatortF : $@convention(thin) (@owned Array<Any>, @owned String, @owned String) -> ()
// _allocateUninitializedArray<A>(_:)
sil [serialized] [always_inline] @_T0s27_allocateUninitializedArraySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer)
// String.init(stringInterpolation:)
sil [serialized] [readonly] @_T0S2SSaySSG19stringInterpolationd_tcfC : $@convention(method) (@owned Array<String>, @thin String.Type) -> @owned String
// String.init<A>(stringInterpolationSegment:)
sil @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzs20TextOutputStreamableRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible, τ_0_0 : TextOutputStreamable> (@in τ_0_0, @thin String.Type) -> @owned String
// String.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:)
sil [serialized] [readonly] [_semantics "string.makeUTF8"] @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String
// String.init<A>(stringInterpolationSegment:)
sil [serialized] @_T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzlufC : $@convention(method) <τ_0_0 where τ_0_0 : CustomStringConvertible> (@in τ_0_0, @thin String.Type) -> @owned String
// default argument 1 of print(_:separator:terminator:)
sil [noinline] [_semantics "stdlib_binary_only"] @_T0s5printySayypGd_SS9separatorSS10terminatortFfA0_ : $@convention(thin) () -> @owned String
// default argument 2 of print(_:separator:terminator:)
sil [noinline] [_semantics "stdlib_binary_only"] @_T0s5printySayypGd_SS9separatorSS10terminatortFfA1_ : $@convention(thin) () -> @owned String
sil_vtable ToObjcOrNotObjc {
#ToObjcOrNotObjc.performOcOperation!1: (ToObjcOrNotObjc) -> () -> Int : _T07orchard011ToObjcOrNotC0C18performOcOperationSiyF // ToObjcOrNotObjc.performOcOperation()
#ToObjcOrNotObjc.performOperation!1: (ToObjcOrNotObjc) -> () -> Int : _T07orchard011ToObjcOrNotC0C16performOperationSiyF // ToObjcOrNotObjc.performOperation()
#ToObjcOrNotObjc.init!initializer.1: (ToObjcOrNotObjc.Type) -> () -> ToObjcOrNotObjc : _T07orchard011ToObjcOrNotC0CACycfc // ToObjcOrNotObjc.init()
#ToObjcOrNotObjc.deinit!deallocator: _T07orchard011ToObjcOrNotC0CfD // ToObjcOrNotObjc.__deallocating_deinit
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment