├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── images └── bruh.jpg ├── include ├── DemanglePass.h ├── Demangler.h ├── DetrampolinePass.h ├── Detrampoliner.h └── logging.h ├── src ├── DemanglePass.cpp ├── Demangler.cpp ├── DetrampolinePass.cpp ├── Detrampoliner.cpp └── main.cpp └── test ├── cpp ├── main-proc.ll ├── main.bc ├── main.cpp └── main.ll ├── objc ├── main ├── main-proc.ll ├── main.bc ├── main.ll └── main.m ├── rust ├── main ├── main-proc.ll ├── main.bc ├── main.ll └── main.rs └── swift ├── main-proc.ll ├── main.bc ├── main.ll └── main.swift /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | build/ 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## TODO: documentation building via doxy, zlib for xar reading (future), 2 | cmake_minimum_required(VERSION 3.20) 3 | 4 | project(bruh) 5 | 6 | set(CMAKE_CXX_VERSION 20) 7 | set(CMAKE_OSX_DEPLOYMENT_TARGET "11.1" CACHE STRING "Minimum OSX Deployment Version") 8 | 9 | option(SWIFT_SOURCE_PATH "Path to the Swift source code") 10 | option(SWIFT_BUILD_PATH "Path to the Swift build path") 11 | 12 | find_package(LLVM REQUIRED CONFIG) 13 | message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") 14 | message(STATUS "Found LLVM-Config.cmake in ${LLVM_DIR}") 15 | 16 | if (CMAKE_COMPILER_IS_GNUXX) 17 | add_definitions(-std=c++20 -fPIC) 18 | add_definitions(-fno-rtti) 19 | elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") 20 | add_definitions(-std=c++20 -stdlib=libc++) 21 | add_definitions(-fno-rtti) 22 | endif() 23 | 24 | set(BRUH_SRC 25 | src/main.cpp 26 | src/Demangler.cpp 27 | src/DemanglePass.cpp 28 | src/Detrampoliner.cpp 29 | src/DetrampolinePass.cpp 30 | ) 31 | 32 | set(BRUH_INCLUDES 33 | include/Demangler.h 34 | include/DemanglePass.h 35 | include/Detrampoliner.h 36 | include/DetrampolinePass.h 37 | include/logging.h 38 | ) 39 | 40 | set(SWIFT_AST_INCLUDES 41 | ${SWIFT_SOURCE_PATH}/include/swift/AST/ReferenceStorage.def 42 | ) 43 | 44 | set(SWIFT_DEMANGLING_INCLUDES 45 | ${SWIFT_SOURCE_PATH}/include/swift/Demangling/Demangle.h 46 | ${SWIFT_SOURCE_PATH}/include/swift/Demangling/Demangler.h 47 | ${SWIFT_SOURCE_PATH}/include/swift/Demangling/DemangleNodes.def 48 | ${SWIFT_SOURCE_PATH}/include/swift/Demangling/ManglingMacros.h 49 | ${SWIFT_SOURCE_PATH}/include/swift/Demangling/ManglingUtils.h 50 | ${SWIFT_SOURCE_PATH}/include/swift/Demangling/NamespaceMacros.h 51 | ${SWIFT_SOURCE_PATH}/include/swift/Demangling/Punycode.h 52 | ${SWIFT_SOURCE_PATH}/include/swift/Demangling/StandardTypesMangling.def 53 | ${SWIFT_SOURCE_PATH}/include/swift/Demangling/TypeDecoder.h 54 | ${SWIFT_SOURCE_PATH}/include/swift/Demangling/TypeLookupError.h 55 | ${SWIFT_SOURCE_PATH}/include/swift/Demangling/ValueWitnessMangling.def 56 | ) 57 | 58 | message(STATUS "Swift Demangling Includes: ${SWIFT_DEMANGLING_INCLUDES}") 59 | 60 | add_executable(bruh 61 | ${BRUH_SRC} 62 | ${BRUH_INCLUDES} 63 | 64 | ${SWIFT_AST_INCLUDES} 65 | ${SWIFT_DEMANGLING_INCLUDES} 66 | ) 67 | 68 | target_include_directories(bruh PRIVATE 69 | ${CMAKE_CURRENT_SOURCE_DIR}/include 70 | ${LLVM_INCLUDE_DIRS} 71 | ${SWIFT_SOURCE_PATH}/include/ 72 | ) 73 | 74 | # Thank you https://stackoverflow.com/questions/31422680/how-to-set-visual-studio-filters-for-nested-sub-directory-using-cmake 75 | function(assign_source_group) 76 | foreach(source IN ITEMS ${ARGN}) 77 | # if not absolute path, make it so 78 | if (IS_ABSOLUTE "${source}") 79 | file(RELATIVE_PATH relative_source "${CMAKE_CURRENT_SOURCE_DIR}" "${source}") 80 | else() 81 | set(relative_source "${source}") 82 | endif() 83 | 84 | # get the directory name 85 | get_filename_component(directory_name "${relative_source}" PATH) 86 | # replace '/' with '\\' as per source_group documentation on subgroups 87 | string(REPLACE "/" "\\" source_path "${directory_name}") 88 | # make the source group 89 | source_group("${source_path}" FILES "${source}") 90 | endforeach() 91 | endfunction(assign_source_group) 92 | 93 | assign_source_group(${BRUH_SRC}) 94 | assign_source_group(${BRUH_INCLUDES}) 95 | assign_source_group(${SWIFT_DEMANGLING_INCLUDES}) 96 | assign_source_group(${SWIFT_AST_INCLUDES}) 97 | 98 | llvm_map_components_to_libnames( 99 | llvm_libs 100 | support 101 | core 102 | irreader 103 | object 104 | debuginfodwarf 105 | analysis 106 | ) 107 | 108 | message(STATUS "Found LLVM Libs: ${llvm_libs}") 109 | 110 | target_link_libraries(bruh 111 | ${llvm_libs} 112 | ${SWIFT_BUILD_PATH}/lib/libswiftDemangling.a 113 | ) 114 | 115 | install(TARGETS bruh RUNTIME DESTINATION bin) 116 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BRUH (Bitcode, Readable for Us Humans) 2 | 3 | ![bruh zone](images/bruh.jpg) 4 | 5 | `bruh` is a tool to make LLVM IR more human readable. 6 | 7 | Its intention is not to create valid IR for anything other than easier reading for humans. 8 | 9 | For example, it will take CallSites like these: 10 | 11 | ```llvm 12 | # objc 13 | %42 = call %0* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %0* (i8*, i8*, i64)*)(i8* %41, i8* %40, i64 1) 14 | 15 | # cpp 16 | %6 = call nonnull align 8 dereferenceable(8) %"class.std::__1::basic_ostream"* @_ZNSt3__1lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(%"class.std::__1::basic_ostream"* nonnull align 8 dereferenceable(8) %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)), !dbg !2452 17 | 18 | # Swift 19 | %17 = call swiftcc %swift.refcounted* @"$sScTss5Error_pRs_rlE8priority9operationScTyxsAA_pGScPSg_xyYaYbKcntcfC"(%TScPSg* noalias nocapture %6, i8* bitcast (%swift.async_func_pointer* @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTATu" to i8*), %swift.refcounted* %14, %swift.type* getelementptr inbounds (%swift.full_type, %swift.full_type* @"$sytN", i32 0, i32 1)) 20 | 21 | # Rust 22 | %0 = call nonnull i8* @"_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h52016c20d23e96b9E"(i8* %_2) 23 | ``` 24 | 25 | And change them to: 26 | 27 | ```llvm 28 | # objc 29 | %42 = call %0* @"-[StringGetterer getStringFor:]"(i8* %41, i8* %40, i64 1) 30 | 31 | # cpp 32 | %6 = call nonnull align 8 dereferenceable(8) %"class.std::__1::basic_ostream"* @"std::__1::basic_ostream >& std::__1::operator<< >(std::__1::basic_ostream >&, char const*)"(%"class.std::__1::basic_ostream"* nonnull align 8 dereferenceable(8) %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)), !dbg !2452 33 | 34 | # Swift 35 | %17 = call swiftcc %swift.refcounted* @"(extension in Swift):Swift.Task< where B == Swift.Error>.init(priority: Swift.Optional, operation: __owned @Sendable () async throws -> A) -> Swift.Task"(%TScPSg* noalias nocapture %6, i8* bitcast (%swift.async_func_pointer* @"async function pointer to partial apply forwarder for reabstraction thunk helper from @escaping @callee_guaranteed @Sendable @async () -> (@error @owned Swift.Error) to @escaping @callee_guaranteed @Sendable @async () -> (@out (), @error @owned Swift.Error)" to i8*), %swift.refcounted* %14, %swift.type* getelementptr inbounds (%swift.full_type, %swift.full_type* @"type metadata for ()", i32 0, i32 1)) 36 | call void @swift_release(%swift.refcounted* %17) #5 37 | 38 | # Rust 39 | %0 = call nonnull i8* @"core::pitr::non_null::NonNull$LT$T$GT$::new_unchecked::h52016c20d23e96b9"(i8* %_2) 40 | ``` 41 | 42 | ## Requirements 43 | 44 | - A modern build of Swift (has been tested with 5.10) 45 | - A modern build of LLVM (has been tested with 14.0) 46 | - A modern compiler (has been tested with Clang 13.0) 47 | - macOS 48 | - see [Limitations](#limitations) 49 | 50 | ## Building 51 | 52 | bruh uses the CMake build system, so create a build directory and run the following command: 53 | 54 | ```bash 55 | mkdir build && cd build 56 | cmake -GNinja -DSWIFT_BUILD_PATH="/path/to/swift/build/" -DSWIFT_SOURCE_PATH="/path/to/swift/source" ../ 57 | ``` 58 | 59 | Optionally, you may need to pass `-DLLVM_DIR` if you don't have LLVM on your `PATH`. You should use the Apple fork of the LLVM project - if you built Swift, you can use the same LLVM it uses. If you don't, you will see `Invalid record` errors when using `bruh`. 60 | 61 | ## Running 62 | 63 | Once built, bruh can be run from the command line like so: 64 | 65 | ```bash 66 | ❯ ./bruh --help 67 | OVERVIEW: bruh (Bitcode, Readable for Us Humans) v0.1 68 | USAGE: bruh [options] 69 | 70 | OPTIONS: 71 | 72 | General options: 73 | 74 | --processed= - Emit processed IR to this filepath, or stdout if nothing is provided 75 | --regular= - Emit unprocessed IR to this filepath 76 | ``` 77 | 78 | There are a set of test files in `test//main.bc` that you can test, currently bruh requires a bitcode file - not a binary, or ll file. 79 | 80 | ### Example 81 | 82 | ```bash 83 | ./bruh --processed=test/objc/main-proc.ll test/objc/main.bc 84 | ``` 85 | 86 | ## Limitations 87 | 88 | Currently, this tool (in the form provided) will only work on macOS, however if you recompile [Swifts Demangling library](https://github.com/apple/swift/tree/main/lib/Demangling) there shouldn't be an issue running this on linux. Support for linux will be added in the [Future](#future). 89 | 90 | ## Future 91 | 92 | - Linux support 93 | - Cleaning up of: 94 | - whitespace (explode structs to be readable etc) 95 | - call sites (placing arguments in the call name) 96 | - module printing for ease of reading 97 | - Collapse bitcasts as _most_ of the time you don't really need to read them 98 | - Def-Use/Call Flow annotations to easier follow usage of registers. 99 | 100 | ## License 101 | 102 | bruh is licensed under LGPL 3.0. See [LICENSE](LICENSE). 103 | -------------------------------------------------------------------------------- /images/bruh.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NinjaLikesCheez/bruh/3e3bce65794be58b85cc2283fc01ecc1058575e4/images/bruh.jpg -------------------------------------------------------------------------------- /include/DemanglePass.h: -------------------------------------------------------------------------------- 1 | // 2 | // DemanglePass.h 3 | // bruh 4 | // 5 | // Created by NinjaLikesCheez on 12/7/21. 6 | // 7 | 8 | #ifndef DEMANGLEPASS_H_ 9 | #define DEMANGLEPASS_H_ 10 | 11 | #include 12 | 13 | #include "Demangler.h" 14 | 15 | using llvm::BasicBlock; 16 | using llvm::Function; 17 | using llvm::GlobalVariable; 18 | using llvm::Instruction; 19 | using llvm::InstVisitor; 20 | using llvm::Module; 21 | using llvm::StructType; 22 | using llvm::Value; 23 | 24 | class DemanglePass : public InstVisitor { 25 | /// Module we're operating on 26 | const Module *module; 27 | Demangler *demangler; 28 | 29 | public: 30 | DemanglePass(const Module *module, Demangler *demangler) : module(module), demangler(demangler) { } 31 | 32 | // Compiler will be a hateful bastard if we don't define these 33 | void visit(Module &module) { InstVisitor::visit(module); } 34 | void visit(Function &function) { InstVisitor::visit(function); } 35 | void visit(BasicBlock &basicBlock) { InstVisitor::visit(basicBlock); } 36 | void visit(Instruction &instruction) { InstVisitor::visit(instruction); } 37 | 38 | void visitModule(Module &module); 39 | void visitFunction(Function &function); 40 | void visitBasicBlock(BasicBlock &basicBlock); 41 | void visitInstruction(Instruction &instruction); 42 | 43 | private: 44 | /// Demangles the name of a struct type 45 | void visitStructType(StructType *type); 46 | 47 | /// Demangles the name of a Global, as well as it's initializer 48 | void visitGlobal(GlobalVariable &global); 49 | 50 | /// Demangles the name of a value 51 | void visitValue(Value *value); 52 | }; 53 | 54 | 55 | #endif // DEMANGLEPASS_H_ 56 | -------------------------------------------------------------------------------- /include/Demangler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Demangler.h 3 | // bruh 4 | // 5 | // Created by NinjaLikesCheez on 23/11/2021. 6 | // 7 | 8 | #ifndef DEMANGLER_H_ 9 | #define DEMANGLER_H_ 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | using std::map; 17 | using std::string; 18 | 19 | using llvm::StringRef; 20 | 21 | /// Demangles a range of mangling schemes, currently supports: Swift & whatever LLVM's Demangle support 22 | class Demangler { 23 | private: 24 | // Previously seen symbol cache. Mapping of Mangled Name to Demangled Name 25 | map symbols; 26 | 27 | public: 28 | Demangler() { } 29 | 30 | /// Demangles a symbol 31 | string demangle(const string symbol); 32 | 33 | /// Demangles a symbol 34 | string demangle(const StringRef symbol); 35 | }; 36 | 37 | #endif // DEMANGLER_H_ 38 | -------------------------------------------------------------------------------- /include/DetrampolinePass.h: -------------------------------------------------------------------------------- 1 | // 2 | // DetrampolinePass.h 3 | // bruh 4 | // 5 | // Created by NinjaLikesCheez on 1/21/22. 6 | // 7 | 8 | #ifndef DETRAMPOLINEPASS_H_ 9 | #define DETRAMPOLINEPASS_H_ 10 | 11 | #include 12 | 13 | #include "Detrampoliner.h" 14 | 15 | using llvm::BasicBlock; 16 | using llvm::Function; 17 | using llvm::InstVisitor; 18 | using llvm::Module; 19 | using llvm::Value; 20 | 21 | class DetrampolinePass : public InstVisitor { 22 | /// The module we're operating on 23 | Module *module; 24 | Detrampoliner *detrampoliner; 25 | 26 | Value* getRenameTarget(Value *value); 27 | 28 | public: 29 | explicit DetrampolinePass(Module *module) : module(module) { 30 | detrampoliner = new Detrampoliner(module); 31 | } 32 | 33 | // Compiler will be a hateful bastard if we don't defined these 34 | void visit(Module &module) { InstVisitor::visit(module); } 35 | void visit(Function &function) { InstVisitor::visit(function); } 36 | void visit(BasicBlock &basicBlock) { InstVisitor::visit(basicBlock); } 37 | void visit(Instruction &instruction) { InstVisitor::visit(instruction); } 38 | 39 | void visitModule(Module &module); 40 | void visitFunction(Function &function); 41 | void visitBasicBlock(BasicBlock &basicBlock); 42 | void visitInstruction(Instruction &instruction); 43 | }; 44 | 45 | 46 | #endif // DETRAMPOLINEPASS_H_ 47 | -------------------------------------------------------------------------------- /include/Detrampoliner.h: -------------------------------------------------------------------------------- 1 | // 2 | // Detrampoliner.h 3 | // bruh 4 | // 5 | // Created by NinjaLikesCheez on 1/21/22. 6 | // 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | using std::map; 16 | using std::string; 17 | using std::tuple; 18 | using std::vector; 19 | 20 | using llvm::AllocaInst; 21 | using llvm::ConstantExpr; 22 | using llvm::ConstantStruct; 23 | using llvm::ConstantArray; 24 | using llvm::CallInst; 25 | using llvm::GlobalVariable; 26 | using llvm::Instruction; 27 | using llvm::Module; 28 | using llvm::Value; 29 | 30 | class Detrampoliner { 31 | private: 32 | const Module *module; 33 | 34 | /// Represents whether this call is operating on the class or an instance of the class 35 | enum CallType { 36 | Class, 37 | Instance, 38 | Selector, 39 | Unknown 40 | }; 41 | 42 | /// Result of a detrampoline operation. CallType, ClassName, SelectorName 43 | typedef tuple DetrampolineResult; 44 | 45 | /// The trampolines we support 46 | enum Trampolines { 47 | objc_msgSend, 48 | objc_msgSendSuper, 49 | objc_msgSendSuper2, 50 | objc_msgSend_stret, 51 | objc_msgSendSuper_stret, 52 | objc_msgSend_fpret, 53 | acceleratedDispatch, // Use `getAcceleratedDispatchFunctionName` to get function names for these values 54 | unknown, 55 | }; 56 | 57 | /// The prefix for an ObjC Class struct 58 | static inline string classPrefix = "OBJC_CLASS_$_"; 59 | static inline string selectorReferencesPrefix = "OBJC_SELECTOR_REFERENCES_"; 60 | static inline string methodVarNamePrefix = "OBJC_METH_VAR_NAME_"; 61 | 62 | static inline string instanceMethodsPrefix = "_OBJC_$_INSTANCE_METHODS_"; 63 | static inline string classMethodsPrefix = "_OBJC_$_CLASS_METHODS_"; 64 | 65 | /// A mapping of trampoline function names to their trampoline type. 66 | static inline map functionNameToTrampolines = { 67 | {"objc_msgSend", objc_msgSend}, 68 | {"objc_msgSendSuper", objc_msgSendSuper}, 69 | {"objc_msgSendSuper2", objc_msgSendSuper2}, 70 | {"objc_msgSend_stret", objc_msgSend_stret}, 71 | {"objc_msgSendSuper_stret", objc_msgSendSuper_stret}, 72 | {"objc_msgSend_fpret", objc_msgSend_fpret}, 73 | 74 | // Accelerate Dispatch calls 75 | {"objc_alloc", acceleratedDispatch}, 76 | {"objc_autorelease", acceleratedDispatch}, 77 | {"objc_release", acceleratedDispatch}, 78 | {"objc_retain", acceleratedDispatch}, 79 | {"objc_alloc_init", acceleratedDispatch}, 80 | {"objc_allocWithZone", acceleratedDispatch}, 81 | {"objc_opt_class", acceleratedDispatch}, 82 | {"objc_opt_isKindOfClass", acceleratedDispatch}, 83 | {"objc_opt_new", acceleratedDispatch}, 84 | {"objc_opt_respondsToSelector", acceleratedDispatch}, 85 | {"objc_opt_self", acceleratedDispatch}, 86 | }; 87 | 88 | /// A mapping of known accelerated dispatch function names to their objc syntactic name 89 | static inline map acceleratedDispatchToFunctionName = { 90 | {"objc_alloc", "alloc"}, 91 | {"objc_autorelease", "autorelease"}, 92 | {"objc_release", "release"}, 93 | {"objc_retain", "retain"}, 94 | {"objc_alloc_init", "alloc] init"}, 95 | {"objc_allocWithZone", "allocWithZone:"}, 96 | {"objc_opt_class", "class"}, 97 | {"objc_opt_isKindOfClass", "isKindOfClass:"}, 98 | {"objc_opt_new", "new"}, 99 | {"objc_opt_respondsToSelector", "respondsToSelector:"}, 100 | {"objc_opt_self", "self"}, 101 | }; 102 | 103 | /// Returns a function name for a value. Normally called on a call's called operand 104 | string getFunctionName(const Value *value); 105 | 106 | /// Returns a syntactic function name for an accelerated dispatch function 107 | string getAcceleratedDispatchFunctionName(const string functionName) { 108 | auto it = acceleratedDispatchToFunctionName.find(functionName); 109 | 110 | if (it != acceleratedDispatchToFunctionName.end()) { 111 | return it->second; 112 | } 113 | 114 | return {}; 115 | } 116 | 117 | /// Returns the trampoline type for a trampoline function name 118 | enum Trampolines getObjCRuntimeTrampoline(const string functionName) { 119 | auto it = functionNameToTrampolines.find(functionName); 120 | 121 | if (it != functionNameToTrampolines.end()) { 122 | return it->second; 123 | } 124 | 125 | return unknown; 126 | } 127 | 128 | /// Attempts to resolve a name for a class argument 129 | string resolveSelfArgument(const Value *value); 130 | 131 | /// Attempts to resolve a name from an allocation 132 | string resolveSelfAllocation(const AllocaInst *alloca); 133 | 134 | /// Attempts to resolve a name for a selector argument 135 | string resolveSelectorArgument(const Value *value); 136 | 137 | /// Attempts to resolve the pattern for a constant string being held by a global 138 | string resolveGlobalVariableBackingString(const GlobalVariable *globalVariable); 139 | 140 | /// Attempts to get an ObjC Class name for a global 141 | string getGlobalClassName(const GlobalVariable *global); 142 | 143 | /// Attempts to detrampoline a call 144 | DetrampolineResult detrampoline(const CallInst &callInst); 145 | 146 | /// Returns the ObjC call prefix for a given type 147 | string getCallTypePrefix(CallType type); 148 | 149 | map> classToMethodNameAndCallType; 150 | 151 | /// Mapping of Global names to Class names 152 | map classNames; 153 | 154 | /// Mapping of Selector names to Method Var names 155 | map selectorToMethodVars; 156 | 157 | /// Mapping of Method vars to Method Var names 158 | map methodVarsToNames; 159 | 160 | /// Mapping of CallInst's to their Detrampolining Results 161 | map callsToResult; 162 | 163 | /// Preprocesses a Class Global to populate the mappings 164 | void preprocessClass(const GlobalVariable &global); 165 | 166 | /// Preprocesses a Selector Reference Global to populate the mappings 167 | void preprocessSelectorReferences(const GlobalVariable &global); 168 | 169 | /// Preprocesses a MethodVar Global to populate the mappings 170 | void preprocessMethodVarName(const GlobalVariable &global); 171 | 172 | /// Preprocesses a CallInst to populate the mappings 173 | void preprocessCallInst(const CallInst *call); 174 | 175 | void preprocessInstanceMethods(const GlobalVariable &global); 176 | void preprocessClassMethods(const GlobalVariable &global); 177 | 178 | /// Extract a target GlobalVariable from a ConstantExpr 179 | const GlobalVariable * getMethodGlobalFromConstantExpr(const ConstantExpr *expr); 180 | 181 | /// Returns all method name globals from a method list (instance or class methods list) 182 | vector getMethodsForMethodList(const ConstantArray *array); 183 | 184 | /// Returns the backing constant array from a method list global 185 | const ConstantArray * getConstantArrayFromGlobalMethodList(const GlobalVariable &global); 186 | 187 | /// Looks up the call type for a given class & selector name 188 | CallType getCallType(string className, string selectorName); 189 | 190 | /// Extracts a string value from a Global Variable 191 | string getConstantStringFromGlobal(const GlobalVariable *global); 192 | 193 | public: 194 | explicit Detrampoliner(const Module *module); 195 | 196 | /// Detrampolines a call, and returns the name with optional objc calling syntax 197 | string detrampolineWithSyntax(const CallInst *callInst, bool addSyntax = true); 198 | }; 199 | -------------------------------------------------------------------------------- /include/logging.h: -------------------------------------------------------------------------------- 1 | #ifndef LOGGING_H_ 2 | #define LOGGING_H_ 3 | 4 | #define LOG(x) \ 5 | llvm::outs() << x << "\n"; 6 | 7 | #ifndef NDEBUG 8 | 9 | #define LOG_DEBUG(x) \ 10 | llvm::outs() << "[Debug]: " << x << "\n"; 11 | 12 | #define LOG_LLVM_PTR(fmt, x) \ 13 | llvm::outs() << fmt; \ 14 | x->print(llvm::outs()); \ 15 | llvm::outs() << "\n"; 16 | 17 | #define LOG_LLVM_REF(fmt, x) \ 18 | llvm::outs() << fmt; \ 19 | x.print(llvm::outs()); \ 20 | llvm::outs() << "\n"; 21 | #else 22 | 23 | #define LOG_DEBUG(x) (void)0 24 | #define LOG_LLVM_PTR(fmt, x) (void)0 25 | #define LOG_LLVM_REF(fmt, x) (void)0 26 | 27 | #endif 28 | 29 | #endif // LOGGING_H_ 30 | -------------------------------------------------------------------------------- /src/DemanglePass.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // DemanglerPass.cpp 3 | // bruh 4 | // 5 | // Created by NinjaLikesCheez on 1/6/22. 6 | // 7 | 8 | #include "DemanglePass.h" 9 | #include "Demangler.h" 10 | 11 | // MARK: - Regular visitors 12 | void DemanglePass::visitModule(Module &module) { 13 | // Resolve structure type names 14 | for (const auto structType : module.getIdentifiedStructTypes()) { 15 | visitStructType(structType); 16 | } 17 | 18 | // Resolve global names 19 | for (auto &global : module.globals()) { 20 | visitGlobal(global); 21 | } 22 | } 23 | 24 | void DemanglePass::visitStructType(StructType *type) { 25 | auto structName = demangler->demangle(type->getName()); 26 | 27 | if (!structName.empty()) { 28 | type->setName(structName); 29 | } 30 | } 31 | 32 | void DemanglePass::visitFunction(Function &function) { 33 | auto functionName = demangler->demangle(function.getName()); 34 | 35 | if (!functionName.empty()) { 36 | function.setName(functionName); 37 | } 38 | } 39 | void DemanglePass::visitBasicBlock(BasicBlock &basicBlock) {} 40 | 41 | void DemanglePass::visitInstruction(Instruction &instruction) { 42 | if (instruction.hasName()) { 43 | visitValue(&instruction); 44 | } 45 | 46 | for (const auto &operand : instruction.operands()) { 47 | visitValue(operand); 48 | } 49 | } 50 | 51 | // MARK: - Custom visitors 52 | void DemanglePass::visitGlobal(GlobalVariable &global) { 53 | auto globalName = demangler->demangle(global.getName()); 54 | 55 | if (!globalName.empty()) { 56 | global.setName(globalName); 57 | } 58 | 59 | if (global.hasInitializer()) { 60 | visitValue(global.getInitializer()); 61 | } 62 | } 63 | 64 | void DemanglePass::visitValue(Value *value) { 65 | auto valueName = demangler->demangle(value->getName()); 66 | 67 | if (!valueName.empty()) { 68 | value->setName(valueName); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/Demangler.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Demangler.cpp 3 | // bruh 4 | // 5 | // Created by NinjaLikesCheez on 23/11/2021. 6 | // 7 | 8 | #include "Demangler.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | string Demangler::demangle(const string symbol) { 17 | if (symbol.empty()) { return {}; } 18 | 19 | // If we've seen this symbol before, return the result of the previous demangling 20 | if (symbols.contains(symbol)) { 21 | return symbols[symbol]; 22 | } 23 | 24 | // TODO: handle hidden names, BCSymbol lookup, OBJC class refs, ivar refs, accelerate dispatch naming, etc 25 | auto demangledSymbol = symbol.find('\1') == 0 ? symbol.substr(1) : symbol; 26 | 27 | /* Swift */ 28 | // Sometimes you see partial patterns in Swift (only when manually compiled?) 29 | // in these cases, we want to lop off everything to the left of the mangle prefix 30 | // Note: This currently doesn't support Swift 3, 4 mangling schemes 31 | // Patterns seen (and handled): 32 | // got.$sym 33 | auto dotPosition = demangledSymbol.find_first_of("."); 34 | std::string remaining = ""; 35 | 36 | if (dotPosition != std::string::npos) { 37 | // got.$sym 38 | if (demangledSymbol.front() != '$' && demangledSymbol.at(dotPosition + 1) == '$') { 39 | remaining = demangledSymbol.substr(0, dotPosition); 40 | demangledSymbol = demangledSymbol.substr(dotPosition + 1, demangledSymbol.size()); 41 | } 42 | } 43 | 44 | if (swift::Demangle::isSwiftSymbol(demangledSymbol)) { 45 | demangledSymbol = swift::Demangle::demangleSymbolAsString(demangledSymbol); 46 | } else { 47 | /* C++, Rust, msft, dlang, whatever else LLVM supports */ 48 | demangledSymbol = llvm::demangle(demangledSymbol); 49 | } 50 | 51 | // Handle adding the remaining string back 52 | if (!remaining.empty()) { 53 | demangledSymbol = remaining + "." + demangledSymbol; 54 | } 55 | 56 | symbols[symbol] = demangledSymbol; 57 | 58 | return demangledSymbol; 59 | } 60 | 61 | string Demangler::demangle(const StringRef symbol) { 62 | return demangle(symbol.str()); 63 | } 64 | -------------------------------------------------------------------------------- /src/DetrampolinePass.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // DetrampolinePass.cpp 3 | // bruh 4 | // 5 | // Created by NinjaLikesCheez on 1/21/22. 6 | // 7 | 8 | #include "DetrampolinePass.h" 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | void DetrampolinePass::visitModule(Module &module) {} 16 | void DetrampolinePass::visitFunction(Function &function) {} 17 | void DetrampolinePass::visitBasicBlock(BasicBlock &basicBlock) {} 18 | 19 | void DetrampolinePass::visitInstruction(Instruction &instruction) { 20 | if (const auto callInst = dyn_cast(&instruction)) { 21 | string callName = detrampoliner->detrampolineWithSyntax(callInst, false); 22 | 23 | if (callName.empty()) { 24 | return; 25 | } 26 | 27 | for (auto &F : module->functions()) { 28 | if (F.getName().str().find(callName) != string::npos) { 29 | if (auto value = dyn_cast(&F)) { 30 | // callInst->setCalledFunction(F); // GAH 31 | callInst->setCalledOperand(value); 32 | break; 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Detrampoliner.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Detrampoliner.cpp 3 | // bruh 4 | // 5 | // Created by NinjaLikesCheez on 1/21/22. 6 | // 7 | 8 | #include "Detrampoliner.h" 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | #include "logging.h" 19 | 20 | using llvm::ConstantArray; 21 | using llvm::ConstantDataArray; 22 | using llvm::ConstantInt; 23 | using llvm::GetElementPtrInst; 24 | using llvm::Intrinsic::IndependentIntrinsics; 25 | using llvm::LoadInst; 26 | using llvm::StoreInst; 27 | using llvm::User; 28 | 29 | using std::vector; 30 | using std::ostringstream; 31 | 32 | // MARK: - Preprocessing 33 | // TODO: preprocess strings here too? Or make that another pass (then we can handle swift strings too, do that actually) 34 | // TODO: ivars too plz 35 | Detrampoliner::Detrampoliner(const Module *module): module(module) { 36 | // Preprocess Class, Selector Refs, and Method Var names to populate our mappings 37 | for (const auto &global : module->globals()) { 38 | auto globalName = global.getName().str(); // If global doesn't have a name this will be empty! 39 | 40 | if (globalName.starts_with(classPrefix)) { 41 | preprocessClass(global); 42 | } else if (globalName.starts_with(selectorReferencesPrefix)) { 43 | preprocessSelectorReferences(global); 44 | } else if (globalName.starts_with(methodVarNamePrefix)) { 45 | preprocessMethodVarName(global); 46 | } 47 | } 48 | 49 | // Maps selectors to type (class, instance) 50 | for (const auto &global : module->globals()) { 51 | auto globalName = global.getName().str(); 52 | 53 | if (globalName.starts_with(instanceMethodsPrefix)) { 54 | preprocessInstanceMethods(global); 55 | } else if (globalName.starts_with(classMethodsPrefix)) { 56 | preprocessClassMethods(global); 57 | } 58 | } 59 | 60 | // Preprocess all CallInsts 61 | for (const auto &F : module->functions()) { 62 | for (const auto &BB : F) { 63 | for (const auto &I : BB) { 64 | if (const auto call = dyn_cast(&I)) { 65 | preprocessCallInst(call); 66 | } 67 | } 68 | } 69 | } 70 | } 71 | 72 | void Detrampoliner::preprocessClass(const GlobalVariable &global) { 73 | auto globalName = global.getName().str(); 74 | 75 | if (!globalName.empty()) { 76 | auto className = globalName.substr(classPrefix.length(), string::npos); 77 | 78 | classNames[globalName] = className; 79 | } 80 | 81 | return; 82 | } 83 | 84 | void Detrampoliner::preprocessSelectorReferences(const GlobalVariable &global) { 85 | for (const auto &operand : global.operands()) { 86 | if (const auto &constantExpr = dyn_cast(operand)) { 87 | if (auto methodGlobal = getMethodGlobalFromConstantExpr(constantExpr)) { 88 | selectorToMethodVars[global.getName().str()] = methodGlobal->getName().str(); 89 | } 90 | } 91 | } 92 | } 93 | 94 | void Detrampoliner::preprocessMethodVarName(const GlobalVariable &global) { 95 | auto methodVarName = getConstantStringFromGlobal(&global); 96 | 97 | methodVarsToNames[global.getName().str()] = methodVarName; 98 | } 99 | 100 | void Detrampoliner::preprocessCallInst(const CallInst *call) { 101 | callsToResult[call] = detrampoline(*call); 102 | } 103 | 104 | void Detrampoliner::preprocessInstanceMethods(const GlobalVariable &global) { 105 | auto className = getGlobalClassName(&global); 106 | 107 | if (const auto &array = getConstantArrayFromGlobalMethodList(global)) { 108 | for (const auto &method : getMethodsForMethodList(array)) { 109 | auto methodName = methodVarsToNames[method->getName().str()]; 110 | std::pair methodVarAndCallType{ methodName, Instance }; 111 | classToMethodNameAndCallType[className].insert(methodVarAndCallType); 112 | } 113 | } 114 | } 115 | 116 | 117 | void Detrampoliner::preprocessClassMethods(const GlobalVariable &global) { 118 | auto className = getGlobalClassName(&global); 119 | 120 | if (const auto &array = getConstantArrayFromGlobalMethodList(global)) { 121 | for (const auto &method : getMethodsForMethodList(array)) { 122 | auto methodName = methodVarsToNames[method->getName().str()]; 123 | std::pair methodVarAndCallType{ method->getName().str(), Class }; 124 | classToMethodNameAndCallType[className].insert(methodVarAndCallType); 125 | } 126 | } 127 | } 128 | 129 | const ConstantArray * Detrampoliner::getConstantArrayFromGlobalMethodList(const GlobalVariable &global) { 130 | for (const auto &operand : global.operands()) { 131 | if (const auto &structure = dyn_cast(operand)) { 132 | for (const auto &structOp : structure->operands()) { 133 | if (const auto &constantArray = dyn_cast(structOp)) { 134 | return constantArray; 135 | } 136 | } 137 | } 138 | } 139 | 140 | return nullptr; 141 | } 142 | 143 | vector Detrampoliner::getMethodsForMethodList(const ConstantArray *array) { 144 | vector results; 145 | 146 | for (const auto &operand : array->operands()) { 147 | if (const auto &constantStructure = dyn_cast(operand)) { 148 | for (const auto &structOperand : constantStructure->operands()) { 149 | if (const auto &constantExpr = dyn_cast(structOperand)) { 150 | if (auto structGlobal = getMethodGlobalFromConstantExpr(constantExpr)) { 151 | results.push_back(structGlobal); 152 | } 153 | } 154 | } 155 | } 156 | } 157 | 158 | return results; 159 | } 160 | 161 | const GlobalVariable * Detrampoliner::getMethodGlobalFromConstantExpr(const ConstantExpr *expr) { 162 | if (const auto &gep = dyn_cast(expr->getAsInstruction())) { 163 | if (const auto &global = dyn_cast(gep->getPointerOperand())) { 164 | auto globalName = global->getName(); 165 | 166 | if (globalName.find(methodVarNamePrefix) != string::npos) { 167 | return global; 168 | } 169 | } 170 | } 171 | 172 | return nullptr; 173 | } 174 | 175 | string Detrampoliner::getConstantStringFromGlobal(const GlobalVariable *global) { 176 | for (const auto &operand : global->operands()) { 177 | if (const auto &constantDataArray = dyn_cast(operand)) { 178 | if (constantDataArray->isString()) { 179 | auto stringValue = constantDataArray->getAsString().str(); 180 | 181 | if (stringValue.back() == '\00') { 182 | stringValue.pop_back(); 183 | } 184 | 185 | return stringValue; 186 | } 187 | } 188 | } 189 | 190 | return {}; 191 | } 192 | 193 | // MARK: - Detrampolining 194 | string Detrampoliner::detrampolineWithSyntax(const CallInst *callInst, bool addSyntax) { 195 | CallType callType = Unknown; 196 | string className = "", selectorName = ""; 197 | 198 | tie(callType, className, selectorName) = callsToResult[callInst]; 199 | 200 | if (className.empty() || selectorName.empty()) { 201 | return {}; 202 | } 203 | 204 | ostringstream ss; 205 | 206 | if (addSyntax) { 207 | ss << getCallTypePrefix(callType) << "[" << className << " " << selectorName << "]"; 208 | } else { 209 | ss << className << " " << selectorName; 210 | } 211 | 212 | return ss.str(); 213 | } 214 | 215 | string Detrampoliner::getCallTypePrefix(CallType type) { 216 | switch (type) { 217 | case Class: 218 | return "+"; 219 | case Instance: 220 | return "-"; 221 | case Unknown: 222 | default: 223 | return {}; 224 | } 225 | } 226 | 227 | Detrampoliner::DetrampolineResult Detrampoliner::detrampoline(const CallInst &callInst) { 228 | string selfName = ""; 229 | string selectorName = ""; 230 | CallType callType = Unknown; 231 | 232 | if (callInst.getIntrinsicID() != llvm::Intrinsic::not_intrinsic) { 233 | // TODO: handle intrinsics? 234 | LOG_DEBUG("Support for intrinsics is currently not implemented..."); 235 | return {callType, selfName, selectorName}; 236 | } 237 | 238 | string functionName = getFunctionName(callInst.getCalledOperand()); 239 | 240 | if (functionName.empty()) { 241 | return {callType, selfName, selectorName}; 242 | } 243 | 244 | Value *selfArg = nullptr; 245 | Value *selectorArg = nullptr; 246 | 247 | auto trampoline = getObjCRuntimeTrampoline(functionName); 248 | 249 | if (trampoline == unknown) { 250 | LOG_DEBUG("Call type was unhandled: " << functionName); 251 | return {callType, selfName, selectorName}; 252 | } 253 | 254 | switch (trampoline) { 255 | case objc_msgSend: 256 | case objc_msgSendSuper: 257 | case objc_msgSendSuper2: 258 | case objc_msgSend_stret: 259 | case objc_msgSendSuper_stret: 260 | case objc_msgSend_fpret: 261 | if (callInst.getNumOperands() == 1) { 262 | selfArg = callInst.getOperand(0); 263 | } else if (callInst.getNumOperands() > 1) { 264 | selfArg = callInst.getOperand(0); 265 | selectorArg = callInst.getOperand(1); 266 | } 267 | 268 | break; 269 | case acceleratedDispatch: 270 | selfArg = callInst.getOperand(0); 271 | selectorName = getAcceleratedDispatchFunctionName(functionName); 272 | 273 | break; 274 | case unknown: 275 | LOG_DEBUG("Call type was unhandled: " << functionName); 276 | return {callType, selfName, selectorName}; 277 | } 278 | 279 | if (selfArg) { 280 | selfName = resolveSelfArgument(selfArg); 281 | } 282 | 283 | if (selectorArg) { 284 | selectorName = resolveSelectorArgument(selectorArg); 285 | } 286 | 287 | callType = getCallType(selfName, selectorName); 288 | 289 | return {callType, selfName, selectorName}; 290 | } 291 | 292 | string Detrampoliner::getFunctionName(const Value *value) { 293 | if (value->hasName()) { return value->getName().str(); } 294 | 295 | if (const auto &loadInst = dyn_cast(value)) { 296 | return getFunctionName(loadInst->getOperand(0)); 297 | } else if (const auto &callInst = dyn_cast(value)) { 298 | if (callInst->getCalledOperand() != nullptr) { 299 | return getFunctionName(callInst->getCalledOperand()); 300 | } 301 | } else if (const auto &constantExpr = dyn_cast(value)) { 302 | if (constantExpr->isCast()) { 303 | return getFunctionName(constantExpr->getOperand(0)); 304 | } 305 | } 306 | 307 | return {}; 308 | } 309 | 310 | Detrampoliner::CallType Detrampoliner::getCallType(string className, string selectorName) { 311 | if (className.empty() || selectorName.empty()) { 312 | return Unknown; 313 | } 314 | 315 | auto it = classToMethodNameAndCallType.find(className); 316 | 317 | if (it != classToMethodNameAndCallType.end()) { 318 | auto methodIt = it->second.find(selectorName); 319 | 320 | if (methodIt != it->second.end()) { 321 | return methodIt->second; 322 | } 323 | } 324 | 325 | return Unknown; 326 | } 327 | 328 | string Detrampoliner::resolveSelfArgument(const Value *value) { 329 | auto strippedValue = value->stripPointerCasts(); 330 | 331 | if (const auto &loadInst = dyn_cast(strippedValue)) { 332 | auto pointerOperand = loadInst->getPointerOperand(); 333 | 334 | if (const auto &allocaInst = dyn_cast(pointerOperand)) { 335 | return resolveSelfAllocation(allocaInst); 336 | } else if (const auto &global = dyn_cast(pointerOperand)) { 337 | return resolveGlobalVariableBackingString(global); 338 | } 339 | } else if (const auto &alloca = dyn_cast(strippedValue)) { 340 | return resolveSelfAllocation(alloca); 341 | } else if (const auto &call = dyn_cast(strippedValue)) { 342 | return get<1>(detrampoline(*call)); 343 | } 344 | 345 | return {}; 346 | } 347 | 348 | string Detrampoliner::resolveSelfAllocation(const AllocaInst *alloca) { 349 | // Find stores to our memory location 350 | vector stores = {}; 351 | 352 | for (const auto &user : alloca->users()) { 353 | if (const auto &store = dyn_cast(user)) { 354 | stores.push_back(store); 355 | } else if (isa(user)) { 356 | for (const auto &gepUser : user->users()) { 357 | if (const auto &store = dyn_cast(gepUser)) { 358 | stores.push_back(store); 359 | } 360 | } 361 | } 362 | } 363 | 364 | // Determine what is stored 365 | for (const auto &store : stores) { 366 | if (const auto &call = dyn_cast(store->getValueOperand()->stripPointerCasts())) { 367 | // If this is an intrinsic it may propagate the target call 368 | auto target = call; 369 | if (call->getIntrinsicID() != llvm::Intrinsic::not_intrinsic) { 370 | if (call->getNumOperands() >= 1) { 371 | if (const auto &targetCall = dyn_cast(call->getOperand(0))) { 372 | target = targetCall; 373 | } 374 | } 375 | } 376 | return get<1>(detrampoline(*target)); 377 | } else if (const auto &load = dyn_cast(store->getValueOperand()->stripPointerCasts())) { 378 | if (const auto &global = dyn_cast(load->getPointerOperand()->stripPointerCasts())) { 379 | if (const auto &innerGlobal = dyn_cast(global->getOperand(0))) { 380 | auto innerGlobalName = innerGlobal->getName().str(); 381 | 382 | if (innerGlobalName.find(classPrefix) != std::string::npos) { 383 | return innerGlobalName.substr(classPrefix.length(), string::npos); 384 | } 385 | } 386 | } 387 | } 388 | } 389 | 390 | return {}; 391 | } 392 | 393 | string Detrampoliner::resolveSelectorArgument(const Value *value) { 394 | if (const auto &loadInst = dyn_cast(value)) { 395 | if (const auto &globalVariable = dyn_cast(loadInst->getPointerOperand())) { 396 | if (globalVariable->getNumOperands() < 1) { 397 | return {}; // Probably not the target we're looking for 398 | } 399 | 400 | try { 401 | // This _should_ be a guaranteed lookup provding everything prior to this call worked as intended... 402 | auto methodVar = selectorToMethodVars.at(globalVariable->getName().str()); 403 | auto methodVarName = methodVarsToNames[methodVar]; 404 | 405 | return methodVarName; 406 | } catch (...) {} 407 | 408 | return resolveGlobalVariableBackingString(globalVariable); 409 | } 410 | } 411 | 412 | return {}; 413 | } 414 | 415 | string Detrampoliner::getGlobalClassName(const GlobalVariable *global) { 416 | if (global->hasName()) { 417 | auto globalName = global->getName().str(); 418 | 419 | if (globalName.find(classPrefix) != string::npos) { 420 | return globalName.substr(classPrefix.length(), string::npos); 421 | } else if (globalName.find(instanceMethodsPrefix) != string::npos) { 422 | return globalName.substr(instanceMethodsPrefix.length(), string::npos); 423 | } else if (globalName.find(classMethodsPrefix) != string::npos) { 424 | return globalName.substr(classMethodsPrefix.length(), string::npos); 425 | } 426 | } 427 | 428 | return {}; 429 | } 430 | 431 | string Detrampoliner::resolveGlobalVariableBackingString(const GlobalVariable *globalVariable) { 432 | // TODO: Extract some portions of this function in part 2 433 | if (const auto &innerGlobal = dyn_cast(globalVariable->getOperand(0))) { 434 | try { 435 | // This _should_ be guaranteed at this point 436 | // but if not - fall back on a manual resolution of the global constant string 437 | return classNames.at(innerGlobal->getName().str()); 438 | } catch (...) { 439 | return getGlobalClassName(innerGlobal); 440 | } 441 | } 442 | 443 | User *target = nullptr; 444 | 445 | if (const auto &constantExpr = dyn_cast(globalVariable->getOperand(0))) { 446 | if (auto *gep = dyn_cast(constantExpr->getAsInstruction())) { 447 | target = gep; 448 | 449 | for (const auto &idx : gep->indices()) { 450 | if (const auto &constantInt = dyn_cast(idx)) { 451 | uint64_t index = constantInt->getValue().getLimitedValue(); 452 | auto operand = target->getOperand(index); 453 | 454 | if (isa(operand)) { 455 | target = cast(operand); 456 | } 457 | } 458 | } 459 | } 460 | } 461 | 462 | if (target == nullptr) { return {}; } 463 | 464 | string stringValue = {}; 465 | 466 | if (const auto &methodNameArray = dyn_cast(target)) { 467 | if (methodNameArray->isString()) { 468 | stringValue = methodNameArray->getAsString().str(); 469 | 470 | if (stringValue.back() == '\00') { 471 | stringValue.pop_back(); 472 | } 473 | } 474 | } 475 | 476 | return stringValue; 477 | } 478 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // main.cpp 3 | // bruh 4 | // 5 | // Created by NinjaLikesCheez on 19/11/2021. 6 | // 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | #include "Demangler.h" 19 | #include "DemanglePass.h" 20 | #include "DetrampolinePass.h" 21 | #include "logging.h" 22 | 23 | using llvm::cl::opt; 24 | using llvm::cl::alias; 25 | using llvm::cl::aliasopt; 26 | using llvm::cl::Positional; 27 | using llvm::cl::desc; 28 | using llvm::cl::init; 29 | using llvm::Expected; 30 | using llvm::MemoryBuffer; 31 | using llvm::StringRef; 32 | using llvm::createStringError; 33 | using llvm::LLVMContext; 34 | using llvm::ExitOnError; 35 | using llvm::PrettyStackTraceProgram; 36 | using llvm::raw_fd_ostream; 37 | using llvm::llvm_shutdown_obj; 38 | 39 | using std::string; 40 | 41 | // CLI Options 42 | static opt InputFilename( 43 | Positional, 44 | desc(""), 45 | init("-") // default to stdout 46 | ); 47 | 48 | static opt RegularOutput( 49 | "regular", 50 | desc("Emit unprocessed IR to this filepath") 51 | ); 52 | 53 | static alias regularAlias("r", desc("Alias for --regular"), aliasopt(RegularOutput)); 54 | 55 | static opt ProcessedOutput( 56 | "processed", 57 | desc("Emit processed IR to this filepath, or stdout if nothing is provided"), 58 | init("-") // default to stdout 59 | ); 60 | 61 | static alias processedAlias("p", desc("Alias for --processed"), aliasopt(ProcessedOutput)); 62 | 63 | static Expected> getBitcodeFile(StringRef path) { 64 | Expected> memoryBufferOrError = errorOrToExpected(MemoryBuffer::getFileOrSTDIN(path)); 65 | 66 | if (auto error = memoryBufferOrError.takeError()) { 67 | return std::move(error); 68 | } 69 | 70 | auto memoryBuffer = std::move(*memoryBufferOrError); 71 | 72 | if (memoryBuffer->getBufferSize() & 3) { 73 | return createStringError( 74 | std::errc::illegal_byte_sequence, 75 | "Bitcode stream should be a multiple of 4 bytes in length" 76 | ); 77 | } 78 | 79 | return std::move(memoryBuffer); 80 | } 81 | 82 | int main(int argc, char **argv, char **envp) { 83 | LLVMContext context; 84 | llvm_shutdown_obj shutdownObject; 85 | 86 | llvm::sys::PrintStackTraceOnErrorSignal(argv[0]); 87 | PrettyStackTraceProgram X(argc, argv); 88 | llvm::cl::ParseCommandLineOptions(argc, argv, "bruh (Bitcode, Readable for Us Humans) v0.1"); 89 | 90 | ExitOnError ExitOnErr("bruh (Bitcode, Readable for Us Humans): "); 91 | 92 | // If InputFilename is "-"" we're reading data from stdin, check there's actually data there to read 93 | if (InputFilename == "-") { 94 | int n; 95 | if (ioctl(0, FIONREAD, &n) == 0 && n == 0) { 96 | LOG("You didn't specify an input, and didn't pipe any data in via stdin.\n"); 97 | llvm::cl::PrintHelpMessage(); 98 | return 1; 99 | } 100 | } 101 | 102 | // TODO: support multi modules via BitcodeFileContents reading APIs 103 | std::unique_ptr bitcode = ExitOnErr(getBitcodeFile(InputFilename)); 104 | 105 | // Convert bitcode to a module 106 | std::unique_ptr module = ExitOnErr(getOwningLazyBitcodeModule(std::move(bitcode), context, true)); 107 | ExitOnErr(module->materializeAll()); 108 | 109 | // Dump regular, unprocessed IR if asked to 110 | std::error_code errorCode; 111 | if (!RegularOutput.empty()) { 112 | raw_fd_ostream os(RegularOutput, errorCode); 113 | 114 | if (errorCode) { 115 | LOG("error: failed to open file for regular printing: " << RegularOutput); 116 | } else { 117 | module->print(os, NULL, false, true); 118 | } 119 | } 120 | 121 | // Dump processed IR 122 | raw_fd_ostream os(ProcessedOutput, errorCode); 123 | 124 | if (errorCode) { 125 | LOG("error: failed to open file for regular printing: " << ProcessedOutput); 126 | } else { 127 | auto demangler = new Demangler(); 128 | auto demanglePass = new DemanglePass(module.get(), demangler); 129 | demanglePass->visit(*module); 130 | 131 | auto detrampolinePass = new DetrampolinePass(module.get()); 132 | detrampolinePass->visit(*module); 133 | 134 | module->print(os, NULL, true, true); 135 | } 136 | 137 | return errorCode.value(); 138 | } 139 | -------------------------------------------------------------------------------- /test/cpp/main.bc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NinjaLikesCheez/bruh/3e3bce65794be58b85cc2283fc01ecc1058575e4/test/cpp/main.bc -------------------------------------------------------------------------------- /test/cpp/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | struct MyStruct { 7 | int x; 8 | }; 9 | 10 | ostream& operator<<(ostream& os, const MyStruct& s) { 11 | os << "MyStruct(x: " << s.x << ")"; 12 | return os; 13 | } 14 | 15 | int getInteger() { 16 | return 1; 17 | } 18 | 19 | string getString() { 20 | return "Hello, World!"; 21 | } 22 | 23 | MyStruct getMyStruct() { 24 | MyStruct myStruct; 25 | return myStruct; 26 | } 27 | 28 | int main(int argc, char **argv) { 29 | cout << "getInteger: " << getInteger() << endl; 30 | cout << "getString: " << getString() << endl; 31 | cout << "getMyStruct: " << getMyStruct() << endl; 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /test/objc/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NinjaLikesCheez/bruh/3e3bce65794be58b85cc2283fc01ecc1058575e4/test/objc/main -------------------------------------------------------------------------------- /test/objc/main-proc.ll: -------------------------------------------------------------------------------- 1 | ; ModuleID = 'test/objc/main.bc' 2 | source_filename = "main.m" 3 | target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 4 | target triple = "x86_64-apple-macosx12.0.0" 5 | 6 | %0 = type opaque 7 | %1 = type opaque 8 | %2 = type opaque 9 | %struct.__NSConstantString_tag = type { i32*, i32, i8*, i64 } 10 | %struct._objc_cache = type opaque 11 | %struct._class_t = type { %struct._class_t*, %struct._class_t*, %struct._objc_cache*, i8* (i8*, i8*)**, %struct._class_ro_t* } 12 | %struct._class_ro_t = type { i32, i32, i32, i8*, i8*, %struct.__method_list_t*, %struct._objc_protocol_list*, %struct._ivar_list_t*, i8*, %struct._prop_list_t* } 13 | %struct.__method_list_t = type { i32, i32, [0 x %struct._objc_method] } 14 | %struct._objc_method = type { i8*, i8*, i8* } 15 | %struct._objc_protocol_list = type { i64, [0 x %struct._protocol_t*] } 16 | %struct._protocol_t = type { i8*, i8*, %struct._objc_protocol_list*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct._prop_list_t*, i32, i32, i8**, i8*, %struct._prop_list_t* } 17 | %struct._ivar_list_t = type { i32, i32, [0 x %struct._ivar_t] } 18 | %struct._ivar_t = type { i64*, i8*, i8*, i32, i32 } 19 | %struct._prop_list_t = type { i32, i32, [0 x %struct._prop_t] } 20 | %struct._prop_t = type { i8*, i8* } 21 | %struct._objc_super = type { i8*, i8* } 22 | 23 | @__CFConstantStringClassReference = external global [0 x i32] 24 | @.str = private unnamed_addr constant [6 x i8] c"Hello\00", section "__TEXT,__cstring,cstring_literals", align 1 25 | @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i64 5 }, section "__DATA,__cfstring", align 8 #0 26 | @.str.1 = private unnamed_addr constant [6 x i8] c"World\00", section "__TEXT,__cstring,cstring_literals", align 1 27 | @_unnamed_cfstring_.2 = private global %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i64 5 }, section "__DATA,__cfstring", align 8 #0 28 | @_objc_empty_cache = external global %struct._objc_cache 29 | @"OBJC_METACLASS_$_NSObject" = external global %struct._class_t 30 | @OBJC_CLASS_NAME_ = private unnamed_addr constant [15 x i8] c"StringGetterer\00", section "__TEXT,__objc_classname,cstring_literals", align 1 31 | @"_OBJC_METACLASS_RO_$_StringGetterer" = internal global %struct._class_ro_t { i32 129, i32 40, i32 40, i8* null, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), %struct.__method_list_t* null, %struct._objc_protocol_list* null, %struct._ivar_list_t* null, i8* null, %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8 32 | @"OBJC_METACLASS_$_StringGetterer" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_NSObject", %struct._class_t* @"OBJC_METACLASS_$_NSObject", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"_OBJC_METACLASS_RO_$_StringGetterer" }, section "__DATA, __objc_data", align 8 33 | @"OBJC_CLASS_$_NSObject" = external global %struct._class_t 34 | @OBJC_METH_VAR_NAME_ = private unnamed_addr constant [14 x i8] c"getStringFor:\00", section "__TEXT,__objc_methname,cstring_literals", align 1 35 | @OBJC_METH_VAR_TYPE_ = private unnamed_addr constant [11 x i8] c"@24@0:8Q16\00", section "__TEXT,__objc_methtype,cstring_literals", align 1 36 | @"_OBJC_$_INSTANCE_METHODS_StringGetterer" = internal global { i32, i32, [1 x %struct._objc_method] } { i32 24, i32 1, [1 x %struct._objc_method] [%struct._objc_method { i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* bitcast (%0* (%1*, i8*, i64)* @"-[StringGetterer getStringFor:]" to i8*) }] }, section "__DATA, __objc_const", align 8 37 | @"_OBJC_CLASS_RO_$_StringGetterer" = internal global %struct._class_ro_t { i32 128, i32 8, i32 8, i8* null, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), %struct.__method_list_t* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"_OBJC_$_INSTANCE_METHODS_StringGetterer" to %struct.__method_list_t*), %struct._objc_protocol_list* null, %struct._ivar_list_t* null, i8* null, %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8 38 | @"OBJC_CLASS_$_StringGetterer" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_StringGetterer", %struct._class_t* @"OBJC_CLASS_$_NSObject", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"_OBJC_CLASS_RO_$_StringGetterer" }, section "__DATA, __objc_data", align 8 39 | @.str.3 = private unnamed_addr constant [2 x i8] c",\00", section "__TEXT,__cstring,cstring_literals", align 1 40 | @_unnamed_cfstring_.4 = private global %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i64 1 }, section "__DATA,__cfstring", align 8 #0 41 | @OBJC_CLASS_NAME_.5 = private unnamed_addr constant [18 x i8] c"SeparatorGetterer\00", section "__TEXT,__objc_classname,cstring_literals", align 1 42 | @OBJC_METH_VAR_NAME_.6 = private unnamed_addr constant [13 x i8] c"getSeparator\00", section "__TEXT,__objc_methname,cstring_literals", align 1 43 | @OBJC_METH_VAR_TYPE_.7 = private unnamed_addr constant [8 x i8] c"@16@0:8\00", section "__TEXT,__objc_methtype,cstring_literals", align 1 44 | @"_OBJC_$_CLASS_METHODS_SeparatorGetterer" = internal global { i32, i32, [1 x %struct._objc_method] } { i32 24, i32 1, [1 x %struct._objc_method] [%struct._objc_method { i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_METH_VAR_NAME_.6, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_.7, i32 0, i32 0), i8* bitcast (%0* (i8*, i8*)* @"+[SeparatorGetterer getSeparator]" to i8*) }] }, section "__DATA, __objc_const", align 8 45 | @"_OBJC_METACLASS_RO_$_SeparatorGetterer" = internal global %struct._class_ro_t { i32 129, i32 40, i32 40, i8* null, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @OBJC_CLASS_NAME_.5, i32 0, i32 0), %struct.__method_list_t* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"_OBJC_$_CLASS_METHODS_SeparatorGetterer" to %struct.__method_list_t*), %struct._objc_protocol_list* null, %struct._ivar_list_t* null, i8* null, %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8 46 | @"OBJC_METACLASS_$_SeparatorGetterer" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_NSObject", %struct._class_t* @"OBJC_METACLASS_$_NSObject", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"_OBJC_METACLASS_RO_$_SeparatorGetterer" }, section "__DATA, __objc_data", align 8 47 | @"_OBJC_CLASS_RO_$_SeparatorGetterer" = internal global %struct._class_ro_t { i32 128, i32 8, i32 8, i8* null, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @OBJC_CLASS_NAME_.5, i32 0, i32 0), %struct.__method_list_t* null, %struct._objc_protocol_list* null, %struct._ivar_list_t* null, i8* null, %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8 48 | @"OBJC_CLASS_$_SeparatorGetterer" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_SeparatorGetterer", %struct._class_t* @"OBJC_CLASS_$_NSObject", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"_OBJC_CLASS_RO_$_SeparatorGetterer" }, section "__DATA, __objc_data", align 8 49 | @"OBJC_CLASS_$_ExclaimationGetterer" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_ExclaimationGetterer", %struct._class_t* @"OBJC_CLASS_$_NSObject", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"_OBJC_CLASS_RO_$_ExclaimationGetterer" }, section "__DATA, __objc_data", align 8 50 | @"OBJC_CLASSLIST_SUP_REFS_$_" = private global %struct._class_t* @"OBJC_CLASS_$_ExclaimationGetterer", section "__DATA,__objc_superrefs,regular,no_dead_strip", align 8 51 | @OBJC_METH_VAR_NAME_.8 = private unnamed_addr constant [5 x i8] c"self\00", section "__TEXT,__objc_methname,cstring_literals", align 1 52 | @OBJC_SELECTOR_REFERENCES_ = internal externally_initialized global i8* getelementptr inbounds ([5 x i8], [5 x i8]* @OBJC_METH_VAR_NAME_.8, i32 0, i32 0), section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8 53 | @OBJC_METH_VAR_NAME_.9 = private unnamed_addr constant [17 x i8] c"setExclaimation:\00", section "__TEXT,__objc_methname,cstring_literals", align 1 54 | @OBJC_SELECTOR_REFERENCES_.10 = internal externally_initialized global i8* getelementptr inbounds ([17 x i8], [17 x i8]* @OBJC_METH_VAR_NAME_.9, i32 0, i32 0), section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8 55 | @OBJC_CLASS_NAME_.11 = private unnamed_addr constant [21 x i8] c"ExclaimationGetterer\00", section "__TEXT,__objc_classname,cstring_literals", align 1 56 | @"_OBJC_METACLASS_RO_$_ExclaimationGetterer" = internal global %struct._class_ro_t { i32 389, i32 40, i32 40, i8* null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @OBJC_CLASS_NAME_.11, i32 0, i32 0), %struct.__method_list_t* null, %struct._objc_protocol_list* null, %struct._ivar_list_t* null, i8* null, %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8 57 | @"OBJC_METACLASS_$_ExclaimationGetterer" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_NSObject", %struct._class_t* @"OBJC_METACLASS_$_NSObject", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"_OBJC_METACLASS_RO_$_ExclaimationGetterer" }, section "__DATA, __objc_data", align 8 58 | @OBJC_CLASS_NAME_.12 = private unnamed_addr constant [2 x i8] c"\01\00", section "__TEXT,__objc_classname,cstring_literals", align 1 59 | @OBJC_METH_VAR_NAME_.13 = private unnamed_addr constant [22 x i8] c"initWithExclaimation:\00", section "__TEXT,__objc_methname,cstring_literals", align 1 60 | @OBJC_METH_VAR_TYPE_.14 = private unnamed_addr constant [11 x i8] c"@24@0:8@16\00", section "__TEXT,__objc_methtype,cstring_literals", align 1 61 | @OBJC_METH_VAR_NAME_.15 = private unnamed_addr constant [16 x i8] c"getExclaimation\00", section "__TEXT,__objc_methname,cstring_literals", align 1 62 | @OBJC_METH_VAR_NAME_.16 = private unnamed_addr constant [13 x i8] c"exclaimation\00", section "__TEXT,__objc_methname,cstring_literals", align 1 63 | @OBJC_METH_VAR_TYPE_.17 = private unnamed_addr constant [11 x i8] c"v24@0:8@16\00", section "__TEXT,__objc_methtype,cstring_literals", align 1 64 | @OBJC_METH_VAR_NAME_.18 = private unnamed_addr constant [14 x i8] c".cxx_destruct\00", section "__TEXT,__objc_methname,cstring_literals", align 1 65 | @OBJC_METH_VAR_TYPE_.19 = private unnamed_addr constant [8 x i8] c"v16@0:8\00", section "__TEXT,__objc_methtype,cstring_literals", align 1 66 | @"_OBJC_$_INSTANCE_METHODS_ExclaimationGetterer" = internal global { i32, i32, [5 x %struct._objc_method] } { i32 24, i32 5, [5 x %struct._objc_method] [%struct._objc_method { i8* getelementptr inbounds ([22 x i8], [22 x i8]* @OBJC_METH_VAR_NAME_.13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @OBJC_METH_VAR_TYPE_.14, i32 0, i32 0), i8* bitcast (i8* (%2*, i8*, %0*)* @"-[ExclaimationGetterer initWithExclaimation:]" to i8*) }, %struct._objc_method { i8* getelementptr inbounds ([16 x i8], [16 x i8]* @OBJC_METH_VAR_NAME_.15, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_.7, i32 0, i32 0), i8* bitcast (%0* (%2*, i8*)* @"-[ExclaimationGetterer getExclaimation]" to i8*) }, %struct._objc_method { i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_METH_VAR_NAME_.16, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_.7, i32 0, i32 0), i8* bitcast (%0* (%2*, i8*)* @"-[ExclaimationGetterer exclaimation]" to i8*) }, %struct._objc_method { i8* getelementptr inbounds ([17 x i8], [17 x i8]* @OBJC_METH_VAR_NAME_.9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @OBJC_METH_VAR_TYPE_.17, i32 0, i32 0), i8* bitcast (void (%2*, i8*, %0*)* @"-[ExclaimationGetterer setExclaimation:]" to i8*) }, %struct._objc_method { i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_.18, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_.19, i32 0, i32 0), i8* bitcast (void (%2*, i8*)* @"-[ExclaimationGetterer .cxx_destruct]" to i8*) }] }, section "__DATA, __objc_const", align 8 67 | @"OBJC_IVAR_$_ExclaimationGetterer._exclaimation" = hidden constant i64 8, section "__DATA, __objc_ivar", align 8 68 | @OBJC_METH_VAR_NAME_.20 = private unnamed_addr constant [14 x i8] c"_exclaimation\00", section "__TEXT,__objc_methname,cstring_literals", align 1 69 | @OBJC_METH_VAR_TYPE_.21 = private unnamed_addr constant [12 x i8] c"@\22NSString\22\00", section "__TEXT,__objc_methtype,cstring_literals", align 1 70 | @"_OBJC_$_INSTANCE_VARIABLES_ExclaimationGetterer" = internal global { i32, i32, [1 x %struct._ivar_t] } { i32 32, i32 1, [1 x %struct._ivar_t] [%struct._ivar_t { i64* @"OBJC_IVAR_$_ExclaimationGetterer._exclaimation", i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_.20, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_TYPE_.21, i32 0, i32 0), i32 3, i32 8 }] }, section "__DATA, __objc_const", align 8 71 | @OBJC_PROP_NAME_ATTR_ = private unnamed_addr constant [13 x i8] c"exclaimation\00", section "__TEXT,__objc_methname,cstring_literals", align 1 72 | @OBJC_PROP_NAME_ATTR_.22 = private unnamed_addr constant [32 x i8] c"T@\22NSString\22,&,N,V_exclaimation\00", section "__TEXT,__objc_methname,cstring_literals", align 1 73 | @"_OBJC_$_PROP_LIST_ExclaimationGetterer" = internal global { i32, i32, [1 x %struct._prop_t] } { i32 16, i32 1, [1 x %struct._prop_t] [%struct._prop_t { i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_PROP_NAME_ATTR_, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @OBJC_PROP_NAME_ATTR_.22, i32 0, i32 0) }] }, section "__DATA, __objc_const", align 8 74 | @"_OBJC_CLASS_RO_$_ExclaimationGetterer" = internal global %struct._class_ro_t { i32 388, i32 8, i32 16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @OBJC_CLASS_NAME_.12, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @OBJC_CLASS_NAME_.11, i32 0, i32 0), %struct.__method_list_t* bitcast ({ i32, i32, [5 x %struct._objc_method] }* @"_OBJC_$_INSTANCE_METHODS_ExclaimationGetterer" to %struct.__method_list_t*), %struct._objc_protocol_list* null, %struct._ivar_list_t* bitcast ({ i32, i32, [1 x %struct._ivar_t] }* @"_OBJC_$_INSTANCE_VARIABLES_ExclaimationGetterer" to %struct._ivar_list_t*), i8* null, %struct._prop_list_t* bitcast ({ i32, i32, [1 x %struct._prop_t] }* @"_OBJC_$_PROP_LIST_ExclaimationGetterer" to %struct._prop_list_t*) }, section "__DATA, __objc_const", align 8 75 | @"OBJC_CLASSLIST_REFERENCES_$_" = internal global %struct._class_t* @"OBJC_CLASS_$_StringGetterer", section "__DATA,__objc_classrefs,regular,no_dead_strip", align 8 76 | @"OBJC_CLASSLIST_REFERENCES_$_.23" = internal global %struct._class_t* @"OBJC_CLASS_$_ExclaimationGetterer", section "__DATA,__objc_classrefs,regular,no_dead_strip", align 8 77 | @.str.24 = private unnamed_addr constant [2 x i8] c"!\00", section "__TEXT,__cstring,cstring_literals", align 1 78 | @_unnamed_cfstring_.25 = private global %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.24, i32 0, i32 0), i64 1 }, section "__DATA,__cfstring", align 8 #0 79 | @OBJC_SELECTOR_REFERENCES_.26 = internal externally_initialized global i8* getelementptr inbounds ([22 x i8], [22 x i8]* @OBJC_METH_VAR_NAME_.13, i32 0, i32 0), section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8 80 | @.str.27 = private unnamed_addr constant [10 x i8] c"%@%@ %@%@\00", section "__TEXT,__cstring,cstring_literals", align 1 81 | @_unnamed_cfstring_.28 = private global %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.27, i32 0, i32 0), i64 9 }, section "__DATA,__cfstring", align 8 #0 82 | @OBJC_SELECTOR_REFERENCES_.29 = internal externally_initialized global i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8 83 | @"OBJC_CLASSLIST_REFERENCES_$_.30" = internal global %struct._class_t* @"OBJC_CLASS_$_SeparatorGetterer", section "__DATA,__objc_classrefs,regular,no_dead_strip", align 8 84 | @OBJC_SELECTOR_REFERENCES_.31 = internal externally_initialized global i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_METH_VAR_NAME_.6, i32 0, i32 0), section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8 85 | @OBJC_SELECTOR_REFERENCES_.32 = internal externally_initialized global i8* getelementptr inbounds ([16 x i8], [16 x i8]* @OBJC_METH_VAR_NAME_.15, i32 0, i32 0), section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8 86 | @"OBJC_LABEL_CLASS_$" = private global [3 x i8*] [i8* bitcast (%struct._class_t* @"OBJC_CLASS_$_StringGetterer" to i8*), i8* bitcast (%struct._class_t* @"OBJC_CLASS_$_SeparatorGetterer" to i8*), i8* bitcast (%struct._class_t* @"OBJC_CLASS_$_ExclaimationGetterer" to i8*)], section "__DATA,__objc_classlist,regular,no_dead_strip", align 8 87 | @llvm.compiler.used = appending global [37 x i8*] [i8* getelementptr inbounds ([15 x i8], [15 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"_OBJC_$_INSTANCE_METHODS_StringGetterer" to i8*), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @OBJC_CLASS_NAME_.5, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_METH_VAR_NAME_.6, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_.7, i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"_OBJC_$_CLASS_METHODS_SeparatorGetterer" to i8*), i8* bitcast (%struct._class_t** @"OBJC_CLASSLIST_SUP_REFS_$_" to i8*), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @OBJC_METH_VAR_NAME_.8, i32 0, i32 0), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_ to i8*), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @OBJC_METH_VAR_NAME_.9, i32 0, i32 0), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.10 to i8*), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @OBJC_CLASS_NAME_.11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @OBJC_CLASS_NAME_.12, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @OBJC_METH_VAR_NAME_.13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @OBJC_METH_VAR_TYPE_.14, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @OBJC_METH_VAR_NAME_.15, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_METH_VAR_NAME_.16, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @OBJC_METH_VAR_TYPE_.17, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_.18, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_.19, i32 0, i32 0), i8* bitcast ({ i32, i32, [5 x %struct._objc_method] }* @"_OBJC_$_INSTANCE_METHODS_ExclaimationGetterer" to i8*), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_.20, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_TYPE_.21, i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._ivar_t] }* @"_OBJC_$_INSTANCE_VARIABLES_ExclaimationGetterer" to i8*), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_PROP_NAME_ATTR_, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @OBJC_PROP_NAME_ATTR_.22, i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._prop_t] }* @"_OBJC_$_PROP_LIST_ExclaimationGetterer" to i8*), i8* bitcast (%struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_" to i8*), i8* bitcast (%struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_.23" to i8*), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.26 to i8*), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.29 to i8*), i8* bitcast (%struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_.30" to i8*), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.31 to i8*), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.32 to i8*), i8* bitcast ([3 x i8*]* @"OBJC_LABEL_CLASS_$" to i8*)], section "llvm.metadata" 88 | 89 | ; Function Attrs: noinline optnone ssp uwtable 90 | define internal %0* @"-[StringGetterer getStringFor:]"(%1* %0, i8* %1, i64 %2) #1 { 91 | %4 = alloca %0*, align 8 92 | %5 = alloca %1*, align 8 93 | %6 = alloca i8*, align 8 94 | %7 = alloca i64, align 8 95 | store %1* %0, %1** %5, align 8 96 | store i8* %1, i8** %6, align 8 97 | store i64 %2, i64* %7, align 8 98 | %8 = load i64, i64* %7, align 8 99 | switch i64 %8, label %15 [ 100 | i64 0, label %9 101 | i64 1, label %12 102 | ] 103 | 104 | 9: ; preds = %3 105 | %10 = call i8* @llvm.objc.retain(i8* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_ to i8*)) #2 106 | %11 = bitcast i8* %10 to %0* 107 | store %0* %11, %0** %4, align 8 108 | br label %15 109 | 110 | 12: ; preds = %3 111 | %13 = call i8* @llvm.objc.retain(i8* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_.2 to i8*)) #2 112 | %14 = bitcast i8* %13 to %0* 113 | store %0* %14, %0** %4, align 8 114 | br label %15 115 | 116 | 15: ; preds = %12, %9, %3 117 | %16 = load %0*, %0** %4, align 8 118 | %17 = bitcast %0* %16 to i8* 119 | %18 = tail call i8* @llvm.objc.autoreleaseReturnValue(i8* %17) #2 120 | %19 = bitcast i8* %18 to %0* 121 | ret %0* %19 122 | } 123 | 124 | ; Function Attrs: nounwind 125 | declare i8* @llvm.objc.retain(i8* %0) #2 126 | 127 | ; Function Attrs: nounwind 128 | declare i8* @llvm.objc.autoreleaseReturnValue(i8* %0) #2 129 | 130 | ; Function Attrs: noinline optnone ssp uwtable 131 | define internal %0* @"+[SeparatorGetterer getSeparator]"(i8* %0, i8* %1) #1 { 132 | %3 = alloca i8*, align 8 133 | %4 = alloca i8*, align 8 134 | store i8* %0, i8** %3, align 8 135 | store i8* %1, i8** %4, align 8 136 | %5 = tail call i8* @llvm.objc.retainAutoreleaseReturnValue(i8* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_.4 to i8*)) #2 137 | %6 = bitcast i8* %5 to %0* 138 | ret %0* %6 139 | } 140 | 141 | ; Function Attrs: nounwind 142 | declare i8* @llvm.objc.retainAutoreleaseReturnValue(i8* %0) #2 143 | 144 | ; Function Attrs: noinline optnone ssp uwtable 145 | define internal i8* @"-[ExclaimationGetterer initWithExclaimation:]"(%2* %0, i8* %1, %0* %2) #1 { 146 | %4 = alloca %2*, align 8 147 | %5 = alloca i8*, align 8 148 | %6 = alloca %0*, align 8 149 | %7 = alloca %struct._objc_super, align 8 150 | store %2* %0, %2** %4, align 8 151 | store i8* %1, i8** %5, align 8 152 | store %0* null, %0** %6, align 8 153 | %8 = bitcast %0** %6 to i8** 154 | %9 = bitcast %0* %2 to i8* 155 | call void @llvm.objc.storeStrong(i8** %8, i8* %9) #2 156 | %10 = load %2*, %2** %4, align 8 157 | %11 = bitcast %2* %10 to i8* 158 | %12 = getelementptr inbounds %struct._objc_super, %struct._objc_super* %7, i32 0, i32 0 159 | store i8* %11, i8** %12, align 8 160 | %13 = load %struct._class_t*, %struct._class_t** @"OBJC_CLASSLIST_SUP_REFS_$_", align 8 161 | %14 = bitcast %struct._class_t* %13 to i8* 162 | %15 = getelementptr inbounds %struct._objc_super, %struct._objc_super* %7, i32 0, i32 1 163 | store i8* %14, i8** %15, align 8 164 | %16 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_, align 8, !invariant.load !17 165 | %17 = call i8* bitcast (i8* (%struct._objc_super*, i8*, ...)* @objc_msgSendSuper2 to i8* (%struct._objc_super*, i8*)*)(%struct._objc_super* %7, i8* %16) 166 | %18 = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %17) #2 167 | %19 = bitcast i8* %18 to %2* 168 | %20 = load %2*, %2** %4, align 8 169 | store %2* %19, %2** %4, align 8 170 | %21 = bitcast %2* %20 to i8* 171 | call void @llvm.objc.release(i8* %21) #2, !clang.imprecise_release !17 172 | %22 = icmp ne %2* %19, null 173 | br i1 %22, label %23, label %28 174 | 175 | 23: ; preds = %3 176 | %24 = load %0*, %0** %6, align 8 177 | %25 = load %2*, %2** %4, align 8 178 | %26 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.10, align 8, !invariant.load !17 179 | %27 = bitcast %2* %25 to i8* 180 | call void @"-[ExclaimationGetterer setExclaimation:]"(i8* %27, i8* %26, %0* %24) 181 | br label %28 182 | 183 | 28: ; preds = %23, %3 184 | %29 = load %2*, %2** %4, align 8 185 | %30 = bitcast %2* %29 to i8* 186 | %31 = call i8* @llvm.objc.retain(i8* %30) #2 187 | %32 = bitcast i8* %31 to %2* 188 | %33 = bitcast %2* %32 to i8* 189 | %34 = bitcast %0** %6 to i8** 190 | call void @llvm.objc.storeStrong(i8** %34, i8* null) #2 191 | %35 = bitcast %2** %4 to i8** 192 | call void @llvm.objc.storeStrong(i8** %35, i8* null) #2 193 | ret i8* %33 194 | } 195 | 196 | ; Function Attrs: nounwind 197 | declare void @llvm.objc.storeStrong(i8** %0, i8* %1) #2 198 | 199 | declare i8* @objc_msgSendSuper2(%struct._objc_super* %0, i8* %1, ...) 200 | 201 | ; Function Attrs: nounwind 202 | declare i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %0) #2 203 | 204 | ; Function Attrs: nounwind 205 | declare void @llvm.objc.release(i8* %0) #2 206 | 207 | ; Function Attrs: nonlazybind 208 | declare i8* @objc_msgSend(i8* %0, i8* %1, ...) #3 209 | 210 | ; Function Attrs: noinline optnone ssp uwtable 211 | define internal %0* @"-[ExclaimationGetterer getExclaimation]"(%2* %0, i8* %1) #1 { 212 | %3 = alloca %2*, align 8 213 | %4 = alloca i8*, align 8 214 | store %2* %0, %2** %3, align 8 215 | store i8* %1, i8** %4, align 8 216 | %5 = load %2*, %2** %3, align 8 217 | %6 = bitcast %2* %5 to i8* 218 | %7 = getelementptr inbounds i8, i8* %6, i64 8 219 | %8 = bitcast i8* %7 to %0** 220 | %9 = load %0*, %0** %8, align 8 221 | %10 = bitcast %0* %9 to i8* 222 | %11 = tail call i8* @llvm.objc.retainAutoreleaseReturnValue(i8* %10) #2 223 | %12 = bitcast i8* %11 to %0* 224 | ret %0* %12 225 | } 226 | 227 | ; Function Attrs: noinline optnone ssp uwtable 228 | define internal %0* @"-[ExclaimationGetterer exclaimation]"(%2* %0, i8* %1) #1 { 229 | %3 = alloca %2*, align 8 230 | %4 = alloca i8*, align 8 231 | store %2* %0, %2** %3, align 8 232 | store i8* %1, i8** %4, align 8 233 | %5 = load %2*, %2** %3, align 8 234 | %6 = bitcast %2* %5 to i8* 235 | %7 = getelementptr inbounds i8, i8* %6, i64 8 236 | %8 = bitcast i8* %7 to %0** 237 | %9 = load %0*, %0** %8, align 8 238 | ret %0* %9 239 | } 240 | 241 | ; Function Attrs: noinline optnone ssp uwtable 242 | define internal void @"-[ExclaimationGetterer setExclaimation:]"(%2* %0, i8* %1, %0* %2) #1 { 243 | %4 = alloca %2*, align 8 244 | %5 = alloca i8*, align 8 245 | %6 = alloca %0*, align 8 246 | store %2* %0, %2** %4, align 8 247 | store i8* %1, i8** %5, align 8 248 | store %0* %2, %0** %6, align 8 249 | %7 = load %0*, %0** %6, align 8 250 | %8 = load %2*, %2** %4, align 8 251 | %9 = bitcast %2* %8 to i8* 252 | %10 = getelementptr inbounds i8, i8* %9, i64 8 253 | %11 = bitcast i8* %10 to %0** 254 | %12 = bitcast %0** %11 to i8** 255 | %13 = bitcast %0* %7 to i8* 256 | call void @llvm.objc.storeStrong(i8** %12, i8* %13) #2 257 | ret void 258 | } 259 | 260 | ; Function Attrs: noinline optnone ssp uwtable 261 | define internal void @"-[ExclaimationGetterer .cxx_destruct]"(%2* %0, i8* %1) #1 { 262 | %3 = alloca %2*, align 8 263 | %4 = alloca i8*, align 8 264 | store %2* %0, %2** %3, align 8 265 | store i8* %1, i8** %4, align 8 266 | %5 = load %2*, %2** %3, align 8 267 | %6 = bitcast %2* %5 to i8* 268 | %7 = getelementptr inbounds i8, i8* %6, i64 8 269 | %8 = bitcast i8* %7 to %0** 270 | %9 = bitcast %0** %8 to i8** 271 | call void @llvm.objc.storeStrong(i8** %9, i8* null) #2 272 | ret void 273 | } 274 | 275 | ; Function Attrs: noinline optnone ssp uwtable 276 | define i32 @main(i32 %0, i8** %1, i8** %2, i8** %3) #4 { 277 | %5 = alloca i32, align 4 278 | %6 = alloca i32, align 4 279 | %7 = alloca i8**, align 8 280 | %8 = alloca i8**, align 8 281 | %9 = alloca i8**, align 8 282 | %10 = alloca %1*, align 8 283 | %11 = alloca %2*, align 8 284 | store i32 0, i32* %5, align 4 285 | store i32 %0, i32* %6, align 4 286 | store i8** %1, i8*** %7, align 8 287 | store i8** %2, i8*** %8, align 8 288 | store i8** %3, i8*** %9, align 8 289 | %12 = call i8* @llvm.objc.autoreleasePoolPush() #2 290 | %13 = load %struct._class_t*, %struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_", align 8 291 | %14 = bitcast %struct._class_t* %13 to i8* 292 | %15 = call i8* @objc_alloc_init(i8* %14) 293 | %16 = bitcast i8* %15 to %1* 294 | store %1* %16, %1** %10, align 8 295 | %17 = load %struct._class_t*, %struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_.23", align 8 296 | %18 = bitcast %struct._class_t* %17 to i8* 297 | %19 = call i8* @objc_alloc(i8* %18) 298 | %20 = bitcast i8* %19 to %2* 299 | %21 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.26, align 8, !invariant.load !17 300 | %22 = bitcast %2* %20 to i8* 301 | %23 = call i8* @"-[ExclaimationGetterer initWithExclaimation:]"(i8* %22, i8* %21, %0* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_.25 to %0*)) 302 | %24 = bitcast i8* %23 to %2* 303 | store %2* %24, %2** %11, align 8 304 | %25 = load %1*, %1** %10, align 8 305 | %26 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.29, align 8, !invariant.load !17 306 | %27 = bitcast %1* %25 to i8* 307 | %28 = call %0* @"-[StringGetterer getStringFor:]"(i8* %27, i8* %26, i64 0) 308 | %29 = bitcast %0* %28 to i8* 309 | %30 = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %29) #2 310 | %31 = bitcast i8* %30 to %0* 311 | %32 = load %struct._class_t*, %struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_.30", align 8 312 | %33 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.31, align 8, !invariant.load !17 313 | %34 = bitcast %struct._class_t* %32 to i8* 314 | %35 = call %0* @"+[SeparatorGetterer getSeparator]"(i8* %34, i8* %33) 315 | %36 = bitcast %0* %35 to i8* 316 | %37 = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %36) #2 317 | %38 = bitcast i8* %37 to %0* 318 | %39 = load %1*, %1** %10, align 8 319 | %40 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.29, align 8, !invariant.load !17 320 | %41 = bitcast %1* %39 to i8* 321 | %42 = call %0* @"-[StringGetterer getStringFor:]"(i8* %41, i8* %40, i64 1) 322 | %43 = bitcast %0* %42 to i8* 323 | %44 = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %43) #2 324 | %45 = bitcast i8* %44 to %0* 325 | %46 = load %2*, %2** %11, align 8 326 | %47 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.32, align 8, !invariant.load !17 327 | %48 = bitcast %2* %46 to i8* 328 | %49 = call %0* @"-[ExclaimationGetterer getExclaimation]"(i8* %48, i8* %47) 329 | %50 = bitcast %0* %49 to i8* 330 | %51 = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %50) #2 331 | %52 = bitcast i8* %51 to %0* 332 | notail call void (i8*, ...) @NSLog(i8* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_.28 to i8*), %0* %31, %0* %38, %0* %45, %0* %52) 333 | %53 = bitcast %0* %52 to i8* 334 | call void @llvm.objc.release(i8* %53) #2, !clang.imprecise_release !17 335 | %54 = bitcast %0* %45 to i8* 336 | call void @llvm.objc.release(i8* %54) #2, !clang.imprecise_release !17 337 | %55 = bitcast %0* %38 to i8* 338 | call void @llvm.objc.release(i8* %55) #2, !clang.imprecise_release !17 339 | %56 = bitcast %0* %31 to i8* 340 | call void @llvm.objc.release(i8* %56) #2, !clang.imprecise_release !17 341 | store i32 0, i32* %5, align 4 342 | %57 = bitcast %2** %11 to i8** 343 | call void @llvm.objc.storeStrong(i8** %57, i8* null) #2 344 | %58 = bitcast %1** %10 to i8** 345 | call void @llvm.objc.storeStrong(i8** %58, i8* null) #2 346 | call void @llvm.objc.autoreleasePoolPop(i8* %12) 347 | %59 = load i32, i32* %5, align 4 348 | ret i32 %59 349 | } 350 | 351 | ; Function Attrs: nounwind 352 | declare i8* @llvm.objc.autoreleasePoolPush() #2 353 | 354 | declare i8* @objc_alloc_init(i8* %0) 355 | 356 | declare i8* @objc_alloc(i8* %0) 357 | 358 | declare void @NSLog(i8* %0, ...) #5 359 | 360 | ; Function Attrs: nounwind 361 | declare void @llvm.objc.autoreleasePoolPop(i8* %0) #2 362 | 363 | ; uselistorder directives 364 | uselistorder i8* (i8*)* @llvm.objc.retain, { 0, 2, 1 } 365 | uselistorder void (i8**, i8*)* @llvm.objc.storeStrong, { 0, 1, 2, 3, 6, 5, 4 } 366 | uselistorder void (%2*, i8*, %0*)* @"-[ExclaimationGetterer setExclaimation:]", { 1, 0 } 367 | 368 | attributes #0 = { "objc_arc_inert" } 369 | attributes #1 = { noinline optnone ssp uwtable "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } 370 | attributes #2 = { nounwind } 371 | attributes #3 = { nonlazybind } 372 | attributes #4 = { noinline optnone ssp uwtable "darwin-stkchk-strong-link" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "probe-stack"="___chkstk_darwin" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } 373 | attributes #5 = { "darwin-stkchk-strong-link" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "probe-stack"="___chkstk_darwin" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } 374 | 375 | !llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7} 376 | !llvm.linker.options = !{!8, !9, !10, !11, !12, !13, !14, !15} 377 | !llvm.ident = !{!16} 378 | 379 | !0 = !{i32 2, !"SDK Version", [2 x i32] [i32 12, i32 1]} 380 | !1 = !{i32 1, !"Objective-C Version", i32 2} 381 | !2 = !{i32 1, !"Objective-C Image Info Version", i32 0} 382 | !3 = !{i32 1, !"Objective-C Image Info Section", !"__DATA,__objc_imageinfo,regular,no_dead_strip"} 383 | !4 = !{i32 1, !"Objective-C Garbage Collection", i8 0} 384 | !5 = !{i32 1, !"Objective-C Class Properties", i32 64} 385 | !6 = !{i32 1, !"wchar_size", i32 4} 386 | !7 = !{i32 7, !"PIC Level", i32 2} 387 | !8 = !{!"-framework", !"Foundation"} 388 | !9 = !{!"-framework", !"CoreGraphics"} 389 | !10 = !{!"-framework", !"CoreServices"} 390 | !11 = !{!"-framework", !"IOKit"} 391 | !12 = !{!"-framework", !"DiskArbitration"} 392 | !13 = !{!"-framework", !"CFNetwork"} 393 | !14 = !{!"-framework", !"Security"} 394 | !15 = !{!"-framework", !"CoreFoundation"} 395 | !16 = !{!"Apple clang version 13.0.0 (clang-1300.0.29.30)"} 396 | !17 = !{} 397 | -------------------------------------------------------------------------------- /test/objc/main.bc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NinjaLikesCheez/bruh/3e3bce65794be58b85cc2283fc01ecc1058575e4/test/objc/main.bc -------------------------------------------------------------------------------- /test/objc/main.ll: -------------------------------------------------------------------------------- 1 | ; ModuleID = 'main.m' 2 | source_filename = "main.m" 3 | target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 4 | target triple = "x86_64-apple-macosx12.0.0" 5 | 6 | %0 = type opaque 7 | %1 = type opaque 8 | %2 = type opaque 9 | %struct.__NSConstantString_tag = type { i32*, i32, i8*, i64 } 10 | %struct._objc_cache = type opaque 11 | %struct._class_t = type { %struct._class_t*, %struct._class_t*, %struct._objc_cache*, i8* (i8*, i8*)**, %struct._class_ro_t* } 12 | %struct._class_ro_t = type { i32, i32, i32, i8*, i8*, %struct.__method_list_t*, %struct._objc_protocol_list*, %struct._ivar_list_t*, i8*, %struct._prop_list_t* } 13 | %struct.__method_list_t = type { i32, i32, [0 x %struct._objc_method] } 14 | %struct._objc_method = type { i8*, i8*, i8* } 15 | %struct._objc_protocol_list = type { i64, [0 x %struct._protocol_t*] } 16 | %struct._protocol_t = type { i8*, i8*, %struct._objc_protocol_list*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct._prop_list_t*, i32, i32, i8**, i8*, %struct._prop_list_t* } 17 | %struct._ivar_list_t = type { i32, i32, [0 x %struct._ivar_t] } 18 | %struct._ivar_t = type { i64*, i8*, i8*, i32, i32 } 19 | %struct._prop_list_t = type { i32, i32, [0 x %struct._prop_t] } 20 | %struct._prop_t = type { i8*, i8* } 21 | %struct._objc_super = type { i8*, i8* } 22 | 23 | @__CFConstantStringClassReference = external global [0 x i32] 24 | @.str = private unnamed_addr constant [6 x i8] c"Hello\00", section "__TEXT,__cstring,cstring_literals", align 1 25 | @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i64 5 }, section "__DATA,__cfstring", align 8 #0 26 | @.str.1 = private unnamed_addr constant [6 x i8] c"World\00", section "__TEXT,__cstring,cstring_literals", align 1 27 | @_unnamed_cfstring_.2 = private global %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i64 5 }, section "__DATA,__cfstring", align 8 #0 28 | @_objc_empty_cache = external global %struct._objc_cache 29 | @"OBJC_METACLASS_$_NSObject" = external global %struct._class_t 30 | @OBJC_CLASS_NAME_ = private unnamed_addr constant [15 x i8] c"StringGetterer\00", section "__TEXT,__objc_classname,cstring_literals", align 1 31 | @"_OBJC_METACLASS_RO_$_StringGetterer" = internal global %struct._class_ro_t { i32 129, i32 40, i32 40, i8* null, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), %struct.__method_list_t* null, %struct._objc_protocol_list* null, %struct._ivar_list_t* null, i8* null, %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8 32 | @"OBJC_METACLASS_$_StringGetterer" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_NSObject", %struct._class_t* @"OBJC_METACLASS_$_NSObject", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"_OBJC_METACLASS_RO_$_StringGetterer" }, section "__DATA, __objc_data", align 8 33 | @"OBJC_CLASS_$_NSObject" = external global %struct._class_t 34 | @OBJC_METH_VAR_NAME_ = private unnamed_addr constant [14 x i8] c"getStringFor:\00", section "__TEXT,__objc_methname,cstring_literals", align 1 35 | @OBJC_METH_VAR_TYPE_ = private unnamed_addr constant [11 x i8] c"@24@0:8Q16\00", section "__TEXT,__objc_methtype,cstring_literals", align 1 36 | @"_OBJC_$_INSTANCE_METHODS_StringGetterer" = internal global { i32, i32, [1 x %struct._objc_method] } { i32 24, i32 1, [1 x %struct._objc_method] [%struct._objc_method { i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* bitcast (%0* (%1*, i8*, i64)* @"\01-[StringGetterer getStringFor:]" to i8*) }] }, section "__DATA, __objc_const", align 8 37 | @"_OBJC_CLASS_RO_$_StringGetterer" = internal global %struct._class_ro_t { i32 128, i32 8, i32 8, i8* null, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), %struct.__method_list_t* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"_OBJC_$_INSTANCE_METHODS_StringGetterer" to %struct.__method_list_t*), %struct._objc_protocol_list* null, %struct._ivar_list_t* null, i8* null, %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8 38 | @"OBJC_CLASS_$_StringGetterer" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_StringGetterer", %struct._class_t* @"OBJC_CLASS_$_NSObject", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"_OBJC_CLASS_RO_$_StringGetterer" }, section "__DATA, __objc_data", align 8 39 | @.str.3 = private unnamed_addr constant [2 x i8] c",\00", section "__TEXT,__cstring,cstring_literals", align 1 40 | @_unnamed_cfstring_.4 = private global %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i64 1 }, section "__DATA,__cfstring", align 8 #0 41 | @OBJC_CLASS_NAME_.5 = private unnamed_addr constant [18 x i8] c"SeparatorGetterer\00", section "__TEXT,__objc_classname,cstring_literals", align 1 42 | @OBJC_METH_VAR_NAME_.6 = private unnamed_addr constant [13 x i8] c"getSeparator\00", section "__TEXT,__objc_methname,cstring_literals", align 1 43 | @OBJC_METH_VAR_TYPE_.7 = private unnamed_addr constant [8 x i8] c"@16@0:8\00", section "__TEXT,__objc_methtype,cstring_literals", align 1 44 | @"_OBJC_$_CLASS_METHODS_SeparatorGetterer" = internal global { i32, i32, [1 x %struct._objc_method] } { i32 24, i32 1, [1 x %struct._objc_method] [%struct._objc_method { i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_METH_VAR_NAME_.6, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_.7, i32 0, i32 0), i8* bitcast (%0* (i8*, i8*)* @"\01+[SeparatorGetterer getSeparator]" to i8*) }] }, section "__DATA, __objc_const", align 8 45 | @"_OBJC_METACLASS_RO_$_SeparatorGetterer" = internal global %struct._class_ro_t { i32 129, i32 40, i32 40, i8* null, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @OBJC_CLASS_NAME_.5, i32 0, i32 0), %struct.__method_list_t* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"_OBJC_$_CLASS_METHODS_SeparatorGetterer" to %struct.__method_list_t*), %struct._objc_protocol_list* null, %struct._ivar_list_t* null, i8* null, %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8 46 | @"OBJC_METACLASS_$_SeparatorGetterer" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_NSObject", %struct._class_t* @"OBJC_METACLASS_$_NSObject", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"_OBJC_METACLASS_RO_$_SeparatorGetterer" }, section "__DATA, __objc_data", align 8 47 | @"_OBJC_CLASS_RO_$_SeparatorGetterer" = internal global %struct._class_ro_t { i32 128, i32 8, i32 8, i8* null, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @OBJC_CLASS_NAME_.5, i32 0, i32 0), %struct.__method_list_t* null, %struct._objc_protocol_list* null, %struct._ivar_list_t* null, i8* null, %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8 48 | @"OBJC_CLASS_$_SeparatorGetterer" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_SeparatorGetterer", %struct._class_t* @"OBJC_CLASS_$_NSObject", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"_OBJC_CLASS_RO_$_SeparatorGetterer" }, section "__DATA, __objc_data", align 8 49 | @"OBJC_CLASS_$_ExclaimationGetterer" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_ExclaimationGetterer", %struct._class_t* @"OBJC_CLASS_$_NSObject", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"_OBJC_CLASS_RO_$_ExclaimationGetterer" }, section "__DATA, __objc_data", align 8 50 | @"OBJC_CLASSLIST_SUP_REFS_$_" = private global %struct._class_t* @"OBJC_CLASS_$_ExclaimationGetterer", section "__DATA,__objc_superrefs,regular,no_dead_strip", align 8 51 | @OBJC_METH_VAR_NAME_.8 = private unnamed_addr constant [5 x i8] c"self\00", section "__TEXT,__objc_methname,cstring_literals", align 1 52 | @OBJC_SELECTOR_REFERENCES_ = internal externally_initialized global i8* getelementptr inbounds ([5 x i8], [5 x i8]* @OBJC_METH_VAR_NAME_.8, i32 0, i32 0), section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8 53 | @OBJC_METH_VAR_NAME_.9 = private unnamed_addr constant [17 x i8] c"setExclaimation:\00", section "__TEXT,__objc_methname,cstring_literals", align 1 54 | @OBJC_SELECTOR_REFERENCES_.10 = internal externally_initialized global i8* getelementptr inbounds ([17 x i8], [17 x i8]* @OBJC_METH_VAR_NAME_.9, i32 0, i32 0), section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8 55 | @OBJC_CLASS_NAME_.11 = private unnamed_addr constant [21 x i8] c"ExclaimationGetterer\00", section "__TEXT,__objc_classname,cstring_literals", align 1 56 | @"_OBJC_METACLASS_RO_$_ExclaimationGetterer" = internal global %struct._class_ro_t { i32 389, i32 40, i32 40, i8* null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @OBJC_CLASS_NAME_.11, i32 0, i32 0), %struct.__method_list_t* null, %struct._objc_protocol_list* null, %struct._ivar_list_t* null, i8* null, %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8 57 | @"OBJC_METACLASS_$_ExclaimationGetterer" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_NSObject", %struct._class_t* @"OBJC_METACLASS_$_NSObject", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"_OBJC_METACLASS_RO_$_ExclaimationGetterer" }, section "__DATA, __objc_data", align 8 58 | @OBJC_CLASS_NAME_.12 = private unnamed_addr constant [2 x i8] c"\01\00", section "__TEXT,__objc_classname,cstring_literals", align 1 59 | @OBJC_METH_VAR_NAME_.13 = private unnamed_addr constant [22 x i8] c"initWithExclaimation:\00", section "__TEXT,__objc_methname,cstring_literals", align 1 60 | @OBJC_METH_VAR_TYPE_.14 = private unnamed_addr constant [11 x i8] c"@24@0:8@16\00", section "__TEXT,__objc_methtype,cstring_literals", align 1 61 | @OBJC_METH_VAR_NAME_.15 = private unnamed_addr constant [16 x i8] c"getExclaimation\00", section "__TEXT,__objc_methname,cstring_literals", align 1 62 | @OBJC_METH_VAR_NAME_.16 = private unnamed_addr constant [13 x i8] c"exclaimation\00", section "__TEXT,__objc_methname,cstring_literals", align 1 63 | @OBJC_METH_VAR_TYPE_.17 = private unnamed_addr constant [11 x i8] c"v24@0:8@16\00", section "__TEXT,__objc_methtype,cstring_literals", align 1 64 | @OBJC_METH_VAR_NAME_.18 = private unnamed_addr constant [14 x i8] c".cxx_destruct\00", section "__TEXT,__objc_methname,cstring_literals", align 1 65 | @OBJC_METH_VAR_TYPE_.19 = private unnamed_addr constant [8 x i8] c"v16@0:8\00", section "__TEXT,__objc_methtype,cstring_literals", align 1 66 | @"_OBJC_$_INSTANCE_METHODS_ExclaimationGetterer" = internal global { i32, i32, [5 x %struct._objc_method] } { i32 24, i32 5, [5 x %struct._objc_method] [%struct._objc_method { i8* getelementptr inbounds ([22 x i8], [22 x i8]* @OBJC_METH_VAR_NAME_.13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @OBJC_METH_VAR_TYPE_.14, i32 0, i32 0), i8* bitcast (i8* (%2*, i8*, %0*)* @"\01-[ExclaimationGetterer initWithExclaimation:]" to i8*) }, %struct._objc_method { i8* getelementptr inbounds ([16 x i8], [16 x i8]* @OBJC_METH_VAR_NAME_.15, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_.7, i32 0, i32 0), i8* bitcast (%0* (%2*, i8*)* @"\01-[ExclaimationGetterer getExclaimation]" to i8*) }, %struct._objc_method { i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_METH_VAR_NAME_.16, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_.7, i32 0, i32 0), i8* bitcast (%0* (%2*, i8*)* @"\01-[ExclaimationGetterer exclaimation]" to i8*) }, %struct._objc_method { i8* getelementptr inbounds ([17 x i8], [17 x i8]* @OBJC_METH_VAR_NAME_.9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @OBJC_METH_VAR_TYPE_.17, i32 0, i32 0), i8* bitcast (void (%2*, i8*, %0*)* @"\01-[ExclaimationGetterer setExclaimation:]" to i8*) }, %struct._objc_method { i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_.18, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_.19, i32 0, i32 0), i8* bitcast (void (%2*, i8*)* @"\01-[ExclaimationGetterer .cxx_destruct]" to i8*) }] }, section "__DATA, __objc_const", align 8 67 | @"OBJC_IVAR_$_ExclaimationGetterer._exclaimation" = hidden constant i64 8, section "__DATA, __objc_ivar", align 8 68 | @OBJC_METH_VAR_NAME_.20 = private unnamed_addr constant [14 x i8] c"_exclaimation\00", section "__TEXT,__objc_methname,cstring_literals", align 1 69 | @OBJC_METH_VAR_TYPE_.21 = private unnamed_addr constant [12 x i8] c"@\22NSString\22\00", section "__TEXT,__objc_methtype,cstring_literals", align 1 70 | @"_OBJC_$_INSTANCE_VARIABLES_ExclaimationGetterer" = internal global { i32, i32, [1 x %struct._ivar_t] } { i32 32, i32 1, [1 x %struct._ivar_t] [%struct._ivar_t { i64* @"OBJC_IVAR_$_ExclaimationGetterer._exclaimation", i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_.20, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_TYPE_.21, i32 0, i32 0), i32 3, i32 8 }] }, section "__DATA, __objc_const", align 8 71 | @OBJC_PROP_NAME_ATTR_ = private unnamed_addr constant [13 x i8] c"exclaimation\00", section "__TEXT,__objc_methname,cstring_literals", align 1 72 | @OBJC_PROP_NAME_ATTR_.22 = private unnamed_addr constant [32 x i8] c"T@\22NSString\22,&,N,V_exclaimation\00", section "__TEXT,__objc_methname,cstring_literals", align 1 73 | @"_OBJC_$_PROP_LIST_ExclaimationGetterer" = internal global { i32, i32, [1 x %struct._prop_t] } { i32 16, i32 1, [1 x %struct._prop_t] [%struct._prop_t { i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_PROP_NAME_ATTR_, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @OBJC_PROP_NAME_ATTR_.22, i32 0, i32 0) }] }, section "__DATA, __objc_const", align 8 74 | @"_OBJC_CLASS_RO_$_ExclaimationGetterer" = internal global %struct._class_ro_t { i32 388, i32 8, i32 16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @OBJC_CLASS_NAME_.12, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @OBJC_CLASS_NAME_.11, i32 0, i32 0), %struct.__method_list_t* bitcast ({ i32, i32, [5 x %struct._objc_method] }* @"_OBJC_$_INSTANCE_METHODS_ExclaimationGetterer" to %struct.__method_list_t*), %struct._objc_protocol_list* null, %struct._ivar_list_t* bitcast ({ i32, i32, [1 x %struct._ivar_t] }* @"_OBJC_$_INSTANCE_VARIABLES_ExclaimationGetterer" to %struct._ivar_list_t*), i8* null, %struct._prop_list_t* bitcast ({ i32, i32, [1 x %struct._prop_t] }* @"_OBJC_$_PROP_LIST_ExclaimationGetterer" to %struct._prop_list_t*) }, section "__DATA, __objc_const", align 8 75 | @"OBJC_CLASSLIST_REFERENCES_$_" = internal global %struct._class_t* @"OBJC_CLASS_$_StringGetterer", section "__DATA,__objc_classrefs,regular,no_dead_strip", align 8 76 | @"OBJC_CLASSLIST_REFERENCES_$_.23" = internal global %struct._class_t* @"OBJC_CLASS_$_ExclaimationGetterer", section "__DATA,__objc_classrefs,regular,no_dead_strip", align 8 77 | @.str.24 = private unnamed_addr constant [2 x i8] c"!\00", section "__TEXT,__cstring,cstring_literals", align 1 78 | @_unnamed_cfstring_.25 = private global %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.24, i32 0, i32 0), i64 1 }, section "__DATA,__cfstring", align 8 #0 79 | @OBJC_SELECTOR_REFERENCES_.26 = internal externally_initialized global i8* getelementptr inbounds ([22 x i8], [22 x i8]* @OBJC_METH_VAR_NAME_.13, i32 0, i32 0), section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8 80 | @.str.27 = private unnamed_addr constant [10 x i8] c"%@%@ %@%@\00", section "__TEXT,__cstring,cstring_literals", align 1 81 | @_unnamed_cfstring_.28 = private global %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.27, i32 0, i32 0), i64 9 }, section "__DATA,__cfstring", align 8 #0 82 | @OBJC_SELECTOR_REFERENCES_.29 = internal externally_initialized global i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8 83 | @"OBJC_CLASSLIST_REFERENCES_$_.30" = internal global %struct._class_t* @"OBJC_CLASS_$_SeparatorGetterer", section "__DATA,__objc_classrefs,regular,no_dead_strip", align 8 84 | @OBJC_SELECTOR_REFERENCES_.31 = internal externally_initialized global i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_METH_VAR_NAME_.6, i32 0, i32 0), section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8 85 | @OBJC_SELECTOR_REFERENCES_.32 = internal externally_initialized global i8* getelementptr inbounds ([16 x i8], [16 x i8]* @OBJC_METH_VAR_NAME_.15, i32 0, i32 0), section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8 86 | @"OBJC_LABEL_CLASS_$" = private global [3 x i8*] [i8* bitcast (%struct._class_t* @"OBJC_CLASS_$_StringGetterer" to i8*), i8* bitcast (%struct._class_t* @"OBJC_CLASS_$_SeparatorGetterer" to i8*), i8* bitcast (%struct._class_t* @"OBJC_CLASS_$_ExclaimationGetterer" to i8*)], section "__DATA,__objc_classlist,regular,no_dead_strip", align 8 87 | @llvm.compiler.used = appending global [37 x i8*] [i8* getelementptr inbounds ([15 x i8], [15 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"_OBJC_$_INSTANCE_METHODS_StringGetterer" to i8*), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @OBJC_CLASS_NAME_.5, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_METH_VAR_NAME_.6, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_.7, i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"_OBJC_$_CLASS_METHODS_SeparatorGetterer" to i8*), i8* bitcast (%struct._class_t** @"OBJC_CLASSLIST_SUP_REFS_$_" to i8*), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @OBJC_METH_VAR_NAME_.8, i32 0, i32 0), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_ to i8*), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @OBJC_METH_VAR_NAME_.9, i32 0, i32 0), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.10 to i8*), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @OBJC_CLASS_NAME_.11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @OBJC_CLASS_NAME_.12, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @OBJC_METH_VAR_NAME_.13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @OBJC_METH_VAR_TYPE_.14, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @OBJC_METH_VAR_NAME_.15, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_METH_VAR_NAME_.16, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @OBJC_METH_VAR_TYPE_.17, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_.18, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_.19, i32 0, i32 0), i8* bitcast ({ i32, i32, [5 x %struct._objc_method] }* @"_OBJC_$_INSTANCE_METHODS_ExclaimationGetterer" to i8*), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_.20, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_TYPE_.21, i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._ivar_t] }* @"_OBJC_$_INSTANCE_VARIABLES_ExclaimationGetterer" to i8*), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @OBJC_PROP_NAME_ATTR_, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @OBJC_PROP_NAME_ATTR_.22, i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._prop_t] }* @"_OBJC_$_PROP_LIST_ExclaimationGetterer" to i8*), i8* bitcast (%struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_" to i8*), i8* bitcast (%struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_.23" to i8*), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.26 to i8*), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.29 to i8*), i8* bitcast (%struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_.30" to i8*), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.31 to i8*), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.32 to i8*), i8* bitcast ([3 x i8*]* @"OBJC_LABEL_CLASS_$" to i8*)], section "llvm.metadata" 88 | 89 | ; Function Attrs: noinline optnone ssp uwtable 90 | define internal %0* @"\01-[StringGetterer getStringFor:]"(%1* %0, i8* %1, i64 %2) #1 { 91 | %4 = alloca %0*, align 8 92 | %5 = alloca %1*, align 8 93 | %6 = alloca i8*, align 8 94 | %7 = alloca i64, align 8 95 | store %1* %0, %1** %5, align 8 96 | store i8* %1, i8** %6, align 8 97 | store i64 %2, i64* %7, align 8 98 | %8 = load i64, i64* %7, align 8 99 | switch i64 %8, label %15 [ 100 | i64 0, label %9 101 | i64 1, label %12 102 | ] 103 | 104 | 9: ; preds = %3 105 | %10 = call i8* @llvm.objc.retain(i8* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_ to i8*)) #2 106 | %11 = bitcast i8* %10 to %0* 107 | store %0* %11, %0** %4, align 8 108 | br label %15 109 | 110 | 12: ; preds = %3 111 | %13 = call i8* @llvm.objc.retain(i8* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_.2 to i8*)) #2 112 | %14 = bitcast i8* %13 to %0* 113 | store %0* %14, %0** %4, align 8 114 | br label %15 115 | 116 | 15: ; preds = %9, %12, %3 117 | %16 = load %0*, %0** %4, align 8 118 | %17 = bitcast %0* %16 to i8* 119 | %18 = tail call i8* @llvm.objc.autoreleaseReturnValue(i8* %17) #2 120 | %19 = bitcast i8* %18 to %0* 121 | ret %0* %19 122 | } 123 | 124 | ; Function Attrs: nounwind 125 | declare i8* @llvm.objc.retain(i8*) #2 126 | 127 | ; Function Attrs: nounwind 128 | declare i8* @llvm.objc.autoreleaseReturnValue(i8*) #2 129 | 130 | ; Function Attrs: noinline optnone ssp uwtable 131 | define internal %0* @"\01+[SeparatorGetterer getSeparator]"(i8* %0, i8* %1) #1 { 132 | %3 = alloca i8*, align 8 133 | %4 = alloca i8*, align 8 134 | store i8* %0, i8** %3, align 8 135 | store i8* %1, i8** %4, align 8 136 | %5 = tail call i8* @llvm.objc.retainAutoreleaseReturnValue(i8* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_.4 to i8*)) #2 137 | %6 = bitcast i8* %5 to %0* 138 | ret %0* %6 139 | } 140 | 141 | ; Function Attrs: nounwind 142 | declare i8* @llvm.objc.retainAutoreleaseReturnValue(i8*) #2 143 | 144 | ; Function Attrs: noinline optnone ssp uwtable 145 | define internal i8* @"\01-[ExclaimationGetterer initWithExclaimation:]"(%2* %0, i8* %1, %0* %2) #1 { 146 | %4 = alloca %2*, align 8 147 | %5 = alloca i8*, align 8 148 | %6 = alloca %0*, align 8 149 | %7 = alloca %struct._objc_super, align 8 150 | store %2* %0, %2** %4, align 8 151 | store i8* %1, i8** %5, align 8 152 | store %0* null, %0** %6, align 8 153 | %8 = bitcast %0** %6 to i8** 154 | %9 = bitcast %0* %2 to i8* 155 | call void @llvm.objc.storeStrong(i8** %8, i8* %9) #2 156 | %10 = load %2*, %2** %4, align 8 157 | %11 = bitcast %2* %10 to i8* 158 | %12 = getelementptr inbounds %struct._objc_super, %struct._objc_super* %7, i32 0, i32 0 159 | store i8* %11, i8** %12, align 8 160 | %13 = load %struct._class_t*, %struct._class_t** @"OBJC_CLASSLIST_SUP_REFS_$_", align 8 161 | %14 = bitcast %struct._class_t* %13 to i8* 162 | %15 = getelementptr inbounds %struct._objc_super, %struct._objc_super* %7, i32 0, i32 1 163 | store i8* %14, i8** %15, align 8 164 | %16 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_, align 8, !invariant.load !17 165 | %17 = call i8* bitcast (i8* (%struct._objc_super*, i8*, ...)* @objc_msgSendSuper2 to i8* (%struct._objc_super*, i8*)*)(%struct._objc_super* %7, i8* %16) 166 | %18 = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %17) #2 167 | %19 = bitcast i8* %18 to %2* 168 | %20 = load %2*, %2** %4, align 8 169 | store %2* %19, %2** %4, align 8 170 | %21 = bitcast %2* %20 to i8* 171 | call void @llvm.objc.release(i8* %21) #2, !clang.imprecise_release !17 172 | %22 = icmp ne %2* %19, null 173 | br i1 %22, label %23, label %28 174 | 175 | 23: ; preds = %3 176 | %24 = load %0*, %0** %6, align 8 177 | %25 = load %2*, %2** %4, align 8 178 | %26 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.10, align 8, !invariant.load !17 179 | %27 = bitcast %2* %25 to i8* 180 | call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %0*)*)(i8* %27, i8* %26, %0* %24) 181 | br label %28 182 | 183 | 28: ; preds = %23, %3 184 | %29 = load %2*, %2** %4, align 8 185 | %30 = bitcast %2* %29 to i8* 186 | %31 = call i8* @llvm.objc.retain(i8* %30) #2 187 | %32 = bitcast i8* %31 to %2* 188 | %33 = bitcast %2* %32 to i8* 189 | %34 = bitcast %0** %6 to i8** 190 | call void @llvm.objc.storeStrong(i8** %34, i8* null) #2 191 | %35 = bitcast %2** %4 to i8** 192 | call void @llvm.objc.storeStrong(i8** %35, i8* null) #2 193 | ret i8* %33 194 | } 195 | 196 | ; Function Attrs: nounwind 197 | declare void @llvm.objc.storeStrong(i8**, i8*) #2 198 | 199 | declare i8* @objc_msgSendSuper2(%struct._objc_super*, i8*, ...) 200 | 201 | ; Function Attrs: nounwind 202 | declare i8* @llvm.objc.retainAutoreleasedReturnValue(i8*) #2 203 | 204 | ; Function Attrs: nounwind 205 | declare void @llvm.objc.release(i8*) #2 206 | 207 | ; Function Attrs: nonlazybind 208 | declare i8* @objc_msgSend(i8*, i8*, ...) #3 209 | 210 | ; Function Attrs: noinline optnone ssp uwtable 211 | define internal %0* @"\01-[ExclaimationGetterer getExclaimation]"(%2* %0, i8* %1) #1 { 212 | %3 = alloca %2*, align 8 213 | %4 = alloca i8*, align 8 214 | store %2* %0, %2** %3, align 8 215 | store i8* %1, i8** %4, align 8 216 | %5 = load %2*, %2** %3, align 8 217 | %6 = bitcast %2* %5 to i8* 218 | %7 = getelementptr inbounds i8, i8* %6, i64 8 219 | %8 = bitcast i8* %7 to %0** 220 | %9 = load %0*, %0** %8, align 8 221 | %10 = bitcast %0* %9 to i8* 222 | %11 = tail call i8* @llvm.objc.retainAutoreleaseReturnValue(i8* %10) #2 223 | %12 = bitcast i8* %11 to %0* 224 | ret %0* %12 225 | } 226 | 227 | ; Function Attrs: noinline optnone ssp uwtable 228 | define internal %0* @"\01-[ExclaimationGetterer exclaimation]"(%2* %0, i8* %1) #1 { 229 | %3 = alloca %2*, align 8 230 | %4 = alloca i8*, align 8 231 | store %2* %0, %2** %3, align 8 232 | store i8* %1, i8** %4, align 8 233 | %5 = load %2*, %2** %3, align 8 234 | %6 = bitcast %2* %5 to i8* 235 | %7 = getelementptr inbounds i8, i8* %6, i64 8 236 | %8 = bitcast i8* %7 to %0** 237 | %9 = load %0*, %0** %8, align 8 238 | ret %0* %9 239 | } 240 | 241 | ; Function Attrs: noinline optnone ssp uwtable 242 | define internal void @"\01-[ExclaimationGetterer setExclaimation:]"(%2* %0, i8* %1, %0* %2) #1 { 243 | %4 = alloca %2*, align 8 244 | %5 = alloca i8*, align 8 245 | %6 = alloca %0*, align 8 246 | store %2* %0, %2** %4, align 8 247 | store i8* %1, i8** %5, align 8 248 | store %0* %2, %0** %6, align 8 249 | %7 = load %0*, %0** %6, align 8 250 | %8 = load %2*, %2** %4, align 8 251 | %9 = bitcast %2* %8 to i8* 252 | %10 = getelementptr inbounds i8, i8* %9, i64 8 253 | %11 = bitcast i8* %10 to %0** 254 | %12 = bitcast %0** %11 to i8** 255 | %13 = bitcast %0* %7 to i8* 256 | call void @llvm.objc.storeStrong(i8** %12, i8* %13) #2 257 | ret void 258 | } 259 | 260 | ; Function Attrs: noinline optnone ssp uwtable 261 | define internal void @"\01-[ExclaimationGetterer .cxx_destruct]"(%2* %0, i8* %1) #1 { 262 | %3 = alloca %2*, align 8 263 | %4 = alloca i8*, align 8 264 | store %2* %0, %2** %3, align 8 265 | store i8* %1, i8** %4, align 8 266 | %5 = load %2*, %2** %3, align 8 267 | %6 = bitcast %2* %5 to i8* 268 | %7 = getelementptr inbounds i8, i8* %6, i64 8 269 | %8 = bitcast i8* %7 to %0** 270 | %9 = bitcast %0** %8 to i8** 271 | call void @llvm.objc.storeStrong(i8** %9, i8* null) #2 272 | ret void 273 | } 274 | 275 | ; Function Attrs: noinline optnone ssp uwtable 276 | define i32 @main(i32 %0, i8** %1, i8** %2, i8** %3) #4 { 277 | %5 = alloca i32, align 4 278 | %6 = alloca i32, align 4 279 | %7 = alloca i8**, align 8 280 | %8 = alloca i8**, align 8 281 | %9 = alloca i8**, align 8 282 | %10 = alloca %1*, align 8 283 | %11 = alloca %2*, align 8 284 | store i32 0, i32* %5, align 4 285 | store i32 %0, i32* %6, align 4 286 | store i8** %1, i8*** %7, align 8 287 | store i8** %2, i8*** %8, align 8 288 | store i8** %3, i8*** %9, align 8 289 | %12 = call i8* @llvm.objc.autoreleasePoolPush() #2 290 | %13 = load %struct._class_t*, %struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_", align 8 291 | %14 = bitcast %struct._class_t* %13 to i8* 292 | %15 = call i8* @objc_alloc_init(i8* %14) 293 | %16 = bitcast i8* %15 to %1* 294 | store %1* %16, %1** %10, align 8 295 | %17 = load %struct._class_t*, %struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_.23", align 8 296 | %18 = bitcast %struct._class_t* %17 to i8* 297 | %19 = call i8* @objc_alloc(i8* %18) 298 | %20 = bitcast i8* %19 to %2* 299 | %21 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.26, align 8, !invariant.load !17 300 | %22 = bitcast %2* %20 to i8* 301 | %23 = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, %0*)*)(i8* %22, i8* %21, %0* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_.25 to %0*)) 302 | %24 = bitcast i8* %23 to %2* 303 | store %2* %24, %2** %11, align 8 304 | %25 = load %1*, %1** %10, align 8 305 | %26 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.29, align 8, !invariant.load !17 306 | %27 = bitcast %1* %25 to i8* 307 | %28 = call %0* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %0* (i8*, i8*, i64)*)(i8* %27, i8* %26, i64 0) 308 | %29 = bitcast %0* %28 to i8* 309 | %30 = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %29) #2 310 | %31 = bitcast i8* %30 to %0* 311 | %32 = load %struct._class_t*, %struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_.30", align 8 312 | %33 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.31, align 8, !invariant.load !17 313 | %34 = bitcast %struct._class_t* %32 to i8* 314 | %35 = call %0* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %0* (i8*, i8*)*)(i8* %34, i8* %33) 315 | %36 = bitcast %0* %35 to i8* 316 | %37 = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %36) #2 317 | %38 = bitcast i8* %37 to %0* 318 | %39 = load %1*, %1** %10, align 8 319 | %40 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.29, align 8, !invariant.load !17 320 | %41 = bitcast %1* %39 to i8* 321 | %42 = call %0* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %0* (i8*, i8*, i64)*)(i8* %41, i8* %40, i64 1) 322 | %43 = bitcast %0* %42 to i8* 323 | %44 = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %43) #2 324 | %45 = bitcast i8* %44 to %0* 325 | %46 = load %2*, %2** %11, align 8 326 | %47 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.32, align 8, !invariant.load !17 327 | %48 = bitcast %2* %46 to i8* 328 | %49 = call %0* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %0* (i8*, i8*)*)(i8* %48, i8* %47) 329 | %50 = bitcast %0* %49 to i8* 330 | %51 = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %50) #2 331 | %52 = bitcast i8* %51 to %0* 332 | notail call void (i8*, ...) @NSLog(i8* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_.28 to i8*), %0* %31, %0* %38, %0* %45, %0* %52) 333 | %53 = bitcast %0* %52 to i8* 334 | call void @llvm.objc.release(i8* %53) #2, !clang.imprecise_release !17 335 | %54 = bitcast %0* %45 to i8* 336 | call void @llvm.objc.release(i8* %54) #2, !clang.imprecise_release !17 337 | %55 = bitcast %0* %38 to i8* 338 | call void @llvm.objc.release(i8* %55) #2, !clang.imprecise_release !17 339 | %56 = bitcast %0* %31 to i8* 340 | call void @llvm.objc.release(i8* %56) #2, !clang.imprecise_release !17 341 | store i32 0, i32* %5, align 4 342 | %57 = bitcast %2** %11 to i8** 343 | call void @llvm.objc.storeStrong(i8** %57, i8* null) #2 344 | %58 = bitcast %1** %10 to i8** 345 | call void @llvm.objc.storeStrong(i8** %58, i8* null) #2 346 | call void @llvm.objc.autoreleasePoolPop(i8* %12) 347 | %59 = load i32, i32* %5, align 4 348 | ret i32 %59 349 | } 350 | 351 | ; Function Attrs: nounwind 352 | declare i8* @llvm.objc.autoreleasePoolPush() #2 353 | 354 | declare i8* @objc_alloc_init(i8*) 355 | 356 | declare i8* @objc_alloc(i8*) 357 | 358 | declare void @NSLog(i8*, ...) #5 359 | 360 | ; Function Attrs: nounwind 361 | declare void @llvm.objc.autoreleasePoolPop(i8*) #2 362 | 363 | attributes #0 = { "objc_arc_inert" } 364 | attributes #1 = { noinline optnone ssp uwtable "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } 365 | attributes #2 = { nounwind } 366 | attributes #3 = { nonlazybind } 367 | attributes #4 = { noinline optnone ssp uwtable "darwin-stkchk-strong-link" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "probe-stack"="___chkstk_darwin" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } 368 | attributes #5 = { "darwin-stkchk-strong-link" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "probe-stack"="___chkstk_darwin" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } 369 | 370 | !llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7} 371 | !llvm.linker.options = !{!8, !9, !10, !11, !12, !13, !14, !15} 372 | !llvm.ident = !{!16} 373 | 374 | !0 = !{i32 2, !"SDK Version", [2 x i32] [i32 12, i32 1]} 375 | !1 = !{i32 1, !"Objective-C Version", i32 2} 376 | !2 = !{i32 1, !"Objective-C Image Info Version", i32 0} 377 | !3 = !{i32 1, !"Objective-C Image Info Section", !"__DATA,__objc_imageinfo,regular,no_dead_strip"} 378 | !4 = !{i32 1, !"Objective-C Garbage Collection", i8 0} 379 | !5 = !{i32 1, !"Objective-C Class Properties", i32 64} 380 | !6 = !{i32 1, !"wchar_size", i32 4} 381 | !7 = !{i32 7, !"PIC Level", i32 2} 382 | !8 = !{!"-framework", !"Foundation"} 383 | !9 = !{!"-framework", !"CoreGraphics"} 384 | !10 = !{!"-framework", !"CoreServices"} 385 | !11 = !{!"-framework", !"IOKit"} 386 | !12 = !{!"-framework", !"DiskArbitration"} 387 | !13 = !{!"-framework", !"CFNetwork"} 388 | !14 = !{!"-framework", !"Security"} 389 | !15 = !{!"-framework", !"CoreFoundation"} 390 | !16 = !{!"Apple clang version 13.0.0 (clang-1300.0.29.30)"} 391 | !17 = !{} 392 | -------------------------------------------------------------------------------- /test/objc/main.m: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | typedef NS_ENUM(NSUInteger, StringType) { 4 | Hello = 0, 5 | World, 6 | }; 7 | 8 | @interface StringGetterer : NSObject 9 | 10 | - (NSString *)getStringFor:(enum StringType)type; 11 | 12 | @end 13 | 14 | @implementation StringGetterer 15 | 16 | - (NSString *)getStringFor:(enum StringType)type { 17 | switch (type) { 18 | case Hello: 19 | return @"Hello"; 20 | break; 21 | case World: 22 | return @"World"; 23 | break; 24 | } 25 | } 26 | 27 | @end 28 | 29 | // end StringGetterer 30 | 31 | @interface SeparatorGetterer : NSObject 32 | 33 | + (NSString *)getSeparator; 34 | 35 | @end 36 | 37 | @implementation SeparatorGetterer 38 | 39 | + (NSString *)getSeparator { 40 | return @","; 41 | } 42 | 43 | @end 44 | 45 | // end SeparatorGetter 46 | 47 | @interface ExclaimationGetterer : NSObject 48 | 49 | @property(nonatomic, strong) NSString *exclaimation; 50 | 51 | - (instancetype)initWithExclaimation:(NSString *)exclaimation; 52 | - (NSString *)getExclaimation; 53 | 54 | @end 55 | 56 | @implementation ExclaimationGetterer 57 | 58 | - (instancetype)initWithExclaimation:(NSString *)exclaimation { 59 | if ((self = [super self])) { 60 | self.exclaimation = exclaimation; 61 | } 62 | 63 | return self; 64 | } 65 | 66 | - (NSString *)getExclaimation { 67 | return _exclaimation; 68 | } 69 | 70 | @end 71 | 72 | 73 | int main(int argc, char **argv, char **envp, char **apple) { 74 | @autoreleasepool { 75 | StringGetterer *stringGetter = [[StringGetterer alloc] init]; 76 | ExclaimationGetterer *exclaimation = [[ExclaimationGetterer alloc] initWithExclaimation: @"!"]; 77 | 78 | NSLog( 79 | @"%@%@ %@%@", 80 | [stringGetter getStringFor:Hello], 81 | [SeparatorGetterer getSeparator], 82 | [stringGetter getStringFor:World], 83 | [exclaimation getExclaimation] 84 | ); 85 | return 0; 86 | } 87 | } -------------------------------------------------------------------------------- /test/rust/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NinjaLikesCheez/bruh/3e3bce65794be58b85cc2283fc01ecc1058575e4/test/rust/main -------------------------------------------------------------------------------- /test/rust/main.bc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NinjaLikesCheez/bruh/3e3bce65794be58b85cc2283fc01ecc1058575e4/test/rust/main.bc -------------------------------------------------------------------------------- /test/rust/main.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | 3 | fn main() { 4 | println!("int: {}", getInt()); 5 | println!("str: {}", getString()); 6 | println!("struct: {}", getStruct()); 7 | } 8 | 9 | fn getInt() -> u32 { 10 | return 32; 11 | } 12 | 13 | fn getString() -> String { 14 | return String::from("Hello, World!"); 15 | } 16 | 17 | struct MyStruct { 18 | x: u32 19 | } 20 | 21 | impl fmt::Display for MyStruct { 22 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 23 | write!(f, "MyStruct(x: {})", self.x) 24 | } 25 | } 26 | 27 | fn getStruct() -> MyStruct { 28 | return MyStruct { x: 32 } 29 | } 30 | -------------------------------------------------------------------------------- /test/swift/main.bc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NinjaLikesCheez/bruh/3e3bce65794be58b85cc2283fc01ecc1058575e4/test/swift/main.bc -------------------------------------------------------------------------------- /test/swift/main.ll: -------------------------------------------------------------------------------- 1 | ; ModuleID = '' 2 | source_filename = "" 3 | target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 4 | target triple = "x86_64-apple-macosx12.0.0" 5 | 6 | %swift.async_func_pointer = type <{ i32, i32 }> 7 | %swift.protocol = type { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i32, i32, i32, i32, i32, i32 } 8 | %swift.full_boxmetadata = type { void (%swift.refcounted*)*, i8**, %swift.type, i32, i8* } 9 | %swift.refcounted = type { %swift.type*, i64 } 10 | %swift.type = type { i64 } 11 | %swift.full_type = type { i8**, %swift.type } 12 | %swift.type_descriptor = type opaque 13 | %swift.protocol_conformance_descriptor = type { i32, i32, i32, i32 } 14 | %swift.vwtable = type { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i64, i64, i32, i32 } 15 | %TScPSg = type <{}> 16 | %swift.opaque = type opaque 17 | %swift.metadata_response = type { %swift.type*, i64 } 18 | %swift.function = type { i8*, %swift.refcounted* } 19 | %swift.context = type { %swift.context*, void (%swift.context*)*, i64 } 20 | %"$s4mainAAyyFyyYaYbKcfU_.Frame" = type { %TSSSg, %TSS, %swift.context*, i8*, %swift.type*, i8**, i8*, %swift.opaque*, i8*, %swift.type*, i8*, i8*, i8*, i8* } 21 | %TSSSg = type <{ [16 x i8] }> 22 | %TSS = type <{ %Ts11_StringGutsV }> 23 | %Ts11_StringGutsV = type <{ %Ts13_StringObjectV }> 24 | %Ts13_StringObjectV = type <{ %Ts6UInt64V, %swift.bridge* }> 25 | %Ts6UInt64V = type <{ i64 }> 26 | %swift.bridge = type opaque 27 | %T10Foundation3URLVSg = type <{}> 28 | %TSq = type <{}> 29 | %swift.error = type opaque 30 | %Any = type { [24 x i8], %swift.type* } 31 | %TSa = type <{ %Ts12_ArrayBufferV }> 32 | %Ts12_ArrayBufferV = type <{ %Ts14_BridgeStorageV }> 33 | %Ts14_BridgeStorageV = type <{ %swift.bridge* }> 34 | %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR.Frame" = type { %swift.context*, i8* } 35 | %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA.Frame" = type { %swift.context*, i8* } 36 | %swift.async_task_and_context = type { %swift.task*, %swift.context* } 37 | %swift.task = type { %swift.refcounted, i8*, i8*, i32, i32, i8*, i8*, i8*, %swift.context*, i64 } 38 | 39 | @"symbolic ScPSg" = linkonce_odr hidden constant <{ [5 x i8], i8 }> <{ [5 x i8] c"ScPSg", i8 0 }>, section "__TEXT,__swift5_typeref, regular, no_dead_strip", align 2 40 | @"$sScPSgMD" = linkonce_odr hidden global { i32, i32 } { i32 trunc (i64 sub (i64 ptrtoint (<{ [5 x i8], i8 }>* @"symbolic ScPSg" to i64), i64 ptrtoint ({ i32, i32 }* @"$sScPSgMD" to i64)) to i32), i32 -5 }, align 8 41 | @"$s4mainAAyyFyyYaYbKcfU_Tu" = internal global %swift.async_func_pointer <{ i32 trunc (i64 sub (i64 ptrtoint (void (%swift.context*)* @"$s4mainAAyyFyyYaYbKcfU_" to i64), i64 ptrtoint (%swift.async_func_pointer* @"$s4mainAAyyFyyYaYbKcfU_Tu" to i64)) to i32), i32 160 }>, section "__TEXT,__const", align 8 42 | @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTu" = linkonce_odr hidden global %swift.async_func_pointer <{ i32 trunc (i64 sub (i64 ptrtoint (void (%swift.opaque*, %swift.context*, i8*, %swift.refcounted*)* @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR" to i64), i64 ptrtoint (%swift.async_func_pointer* @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTu" to i64)) to i32), i32 48 }>, section "__TEXT,__const", align 8 43 | @"$ss5ErrorMp" = external global %swift.protocol, align 4 44 | @"got.$ss5ErrorMp" = private unnamed_addr constant %swift.protocol* @"$ss5ErrorMp" 45 | @"symbolic ______pIeghHzo_ s5ErrorP" = linkonce_odr hidden constant <{ i8, i32, [10 x i8], i8 }> <{ i8 2, i32 trunc (i64 sub (i64 ptrtoint (%swift.protocol** @"got.$ss5ErrorMp" to i64), i64 ptrtoint (i32* getelementptr inbounds (<{ i8, i32, [10 x i8], i8 }>, <{ i8, i32, [10 x i8], i8 }>* @"symbolic ______pIeghHzo_ s5ErrorP", i32 0, i32 1) to i64)) to i32), [10 x i8] c"_pIeghHzo_", i8 0 }>, section "__TEXT,__swift5_typeref, regular, no_dead_strip", align 2 46 | @"\01l__swift5_reflection_descriptor" = private constant { i32, i32, i32, i32 } { i32 1, i32 0, i32 0, i32 trunc (i64 sub (i64 ptrtoint (<{ i8, i32, [10 x i8], i8 }>* @"symbolic ______pIeghHzo_ s5ErrorP" to i64), i64 ptrtoint (i32* getelementptr inbounds ({ i32, i32, i32, i32 }, { i32, i32, i32, i32 }* @"\01l__swift5_reflection_descriptor", i32 0, i32 3) to i64)) to i32) }, section "__TEXT,__swift5_capture, regular, no_dead_strip", align 4 47 | @metadata = private constant %swift.full_boxmetadata { void (%swift.refcounted*)* @objectdestroy, i8** null, %swift.type { i64 1024 }, i32 16, i8* bitcast ({ i32, i32, i32, i32 }* @"\01l__swift5_reflection_descriptor" to i8*) }, align 8 48 | @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTATu" = internal global %swift.async_func_pointer <{ i32 trunc (i64 sub (i64 ptrtoint (void (%swift.opaque*, %swift.context*, %swift.refcounted*)* @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA" to i64), i64 ptrtoint (%swift.async_func_pointer* @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTATu" to i64)) to i32), i32 48 }>, section "__TEXT,__const", align 8 49 | @"$sytN" = external global %swift.full_type 50 | @"\01l_entry_point" = private constant { i32 } { i32 trunc (i64 sub (i64 ptrtoint (i32 (i32, i8**)* @main to i64), i64 ptrtoint ({ i32 }* @"\01l_entry_point" to i64)) to i32) }, section "__TEXT, __swift5_entry, regular, no_dead_strip", align 4 51 | @"_swift_FORCE_LOAD_$_swiftFoundation_$_main" = weak_odr hidden constant void ()* @"_swift_FORCE_LOAD_$_swiftFoundation" 52 | @"_swift_FORCE_LOAD_$_swiftObjectiveC_$_main" = weak_odr hidden constant void ()* @"_swift_FORCE_LOAD_$_swiftObjectiveC" 53 | @"_swift_FORCE_LOAD_$_swiftDarwin_$_main" = weak_odr hidden constant void ()* @"_swift_FORCE_LOAD_$_swiftDarwin" 54 | @"_swift_FORCE_LOAD_$_swiftCoreFoundation_$_main" = weak_odr hidden constant void ()* @"_swift_FORCE_LOAD_$_swiftCoreFoundation" 55 | @"_swift_FORCE_LOAD_$_swiftDispatch_$_main" = weak_odr hidden constant void ()* @"_swift_FORCE_LOAD_$_swiftDispatch" 56 | @"_swift_FORCE_LOAD_$_swiftXPC_$_main" = weak_odr hidden constant void ()* @"_swift_FORCE_LOAD_$_swiftXPC" 57 | @"_swift_FORCE_LOAD_$_swiftIOKit_$_main" = weak_odr hidden constant void ()* @"_swift_FORCE_LOAD_$_swiftIOKit" 58 | @"_swift_FORCE_LOAD_$_swiftCoreGraphics_$_main" = weak_odr hidden constant void ()* @"_swift_FORCE_LOAD_$_swiftCoreGraphics" 59 | @"$s10Foundation17AsyncLineSequenceVMn" = external global %swift.type_descriptor, align 4 60 | @"got.$s10Foundation17AsyncLineSequenceVMn" = private unnamed_addr constant %swift.type_descriptor* @"$s10Foundation17AsyncLineSequenceVMn" 61 | @"$s10Foundation3URLV10AsyncBytesVMn" = external global %swift.type_descriptor, align 4 62 | @"got.$s10Foundation3URLV10AsyncBytesVMn" = private unnamed_addr constant %swift.type_descriptor* @"$s10Foundation3URLV10AsyncBytesVMn" 63 | @"symbolic _____y_____G 10Foundation17AsyncLineSequenceV AA3URLV0B5BytesV" = linkonce_odr hidden constant <{ i8, i32, [1 x i8], i8, i32, [1 x i8], i8 }> <{ i8 2, i32 trunc (i64 sub (i64 ptrtoint (%swift.type_descriptor** @"got.$s10Foundation17AsyncLineSequenceVMn" to i64), i64 ptrtoint (i32* getelementptr inbounds (<{ i8, i32, [1 x i8], i8, i32, [1 x i8], i8 }>, <{ i8, i32, [1 x i8], i8, i32, [1 x i8], i8 }>* @"symbolic _____y_____G 10Foundation17AsyncLineSequenceV AA3URLV0B5BytesV", i32 0, i32 1) to i64)) to i32), [1 x i8] c"y", i8 2, i32 trunc (i64 sub (i64 ptrtoint (%swift.type_descriptor** @"got.$s10Foundation3URLV10AsyncBytesVMn" to i64), i64 ptrtoint (i32* getelementptr inbounds (<{ i8, i32, [1 x i8], i8, i32, [1 x i8], i8 }>, <{ i8, i32, [1 x i8], i8, i32, [1 x i8], i8 }>* @"symbolic _____y_____G 10Foundation17AsyncLineSequenceV AA3URLV0B5BytesV", i32 0, i32 4) to i64)) to i32), [1 x i8] c"G", i8 0 }>, section "__TEXT,__swift5_typeref, regular, no_dead_strip", align 2 64 | @"$s10Foundation17AsyncLineSequenceVyAA3URLV0B5BytesVGMD" = linkonce_odr hidden global { i32, i32 } { i32 trunc (i64 sub (i64 ptrtoint (<{ i8, i32, [1 x i8], i8, i32, [1 x i8], i8 }>* @"symbolic _____y_____G 10Foundation17AsyncLineSequenceV AA3URLV0B5BytesV" to i64), i64 ptrtoint ({ i32, i32 }* @"$s10Foundation17AsyncLineSequenceVyAA3URLV0B5BytesVGMD" to i64)) to i32), i32 -12 }, align 8 65 | @"$s10Foundation17AsyncLineSequenceV0B8IteratorVMn" = external global %swift.type_descriptor, align 4 66 | @"got.$s10Foundation17AsyncLineSequenceV0B8IteratorVMn" = private unnamed_addr constant %swift.type_descriptor* @"$s10Foundation17AsyncLineSequenceV0B8IteratorVMn" 67 | @"symbolic _____y______G 10Foundation17AsyncLineSequenceV0B8IteratorV AA3URLV0B5BytesV" = linkonce_odr hidden constant <{ i8, i32, [1 x i8], i8, i32, [2 x i8], i8 }> <{ i8 2, i32 trunc (i64 sub (i64 ptrtoint (%swift.type_descriptor** @"got.$s10Foundation17AsyncLineSequenceV0B8IteratorVMn" to i64), i64 ptrtoint (i32* getelementptr inbounds (<{ i8, i32, [1 x i8], i8, i32, [2 x i8], i8 }>, <{ i8, i32, [1 x i8], i8, i32, [2 x i8], i8 }>* @"symbolic _____y______G 10Foundation17AsyncLineSequenceV0B8IteratorV AA3URLV0B5BytesV", i32 0, i32 1) to i64)) to i32), [1 x i8] c"y", i8 2, i32 trunc (i64 sub (i64 ptrtoint (%swift.type_descriptor** @"got.$s10Foundation3URLV10AsyncBytesVMn" to i64), i64 ptrtoint (i32* getelementptr inbounds (<{ i8, i32, [1 x i8], i8, i32, [2 x i8], i8 }>, <{ i8, i32, [1 x i8], i8, i32, [2 x i8], i8 }>* @"symbolic _____y______G 10Foundation17AsyncLineSequenceV0B8IteratorV AA3URLV0B5BytesV", i32 0, i32 4) to i64)) to i32), [2 x i8] c"_G", i8 0 }>, section "__TEXT,__swift5_typeref, regular, no_dead_strip", align 2 68 | @"$s10Foundation17AsyncLineSequenceV0B8IteratorVyAA3URLV0B5BytesV_GMD" = linkonce_odr hidden global { i32, i32 } { i32 trunc (i64 sub (i64 ptrtoint (<{ i8, i32, [1 x i8], i8, i32, [2 x i8], i8 }>* @"symbolic _____y______G 10Foundation17AsyncLineSequenceV0B8IteratorV AA3URLV0B5BytesV" to i64), i64 ptrtoint ({ i32, i32 }* @"$s10Foundation17AsyncLineSequenceV0B8IteratorVyAA3URLV0B5BytesV_GMD" to i64)) to i32), i32 -13 }, align 8 69 | @"$s10Foundation3URLVMn" = external global %swift.type_descriptor, align 4 70 | @"got.$s10Foundation3URLVMn" = private unnamed_addr constant %swift.type_descriptor* @"$s10Foundation3URLVMn" 71 | @"symbolic _____Sg 10Foundation3URLV" = linkonce_odr hidden constant <{ i8, i32, [2 x i8], i8 }> <{ i8 2, i32 trunc (i64 sub (i64 ptrtoint (%swift.type_descriptor** @"got.$s10Foundation3URLVMn" to i64), i64 ptrtoint (i32* getelementptr inbounds (<{ i8, i32, [2 x i8], i8 }>, <{ i8, i32, [2 x i8], i8 }>* @"symbolic _____Sg 10Foundation3URLV", i32 0, i32 1) to i64)) to i32), [2 x i8] c"Sg", i8 0 }>, section "__TEXT,__swift5_typeref, regular, no_dead_strip", align 2 72 | @"$s10Foundation3URLVSgMD" = linkonce_odr hidden global { i32, i32 } { i32 trunc (i64 sub (i64 ptrtoint (<{ i8, i32, [2 x i8], i8 }>* @"symbolic _____Sg 10Foundation3URLV" to i64), i64 ptrtoint ({ i32, i32 }* @"$s10Foundation3URLVSgMD" to i64)) to i32), i32 -7 }, align 8 73 | @0 = private unnamed_addr constant [26 x i8] c"https://www.donnywals.com\00" 74 | @1 = private unnamed_addr constant [16 x i8] c"main/main.swift\00" 75 | @2 = private unnamed_addr constant [58 x i8] c"Unexpectedly found nil while unwrapping an Optional value\00" 76 | @3 = private unnamed_addr constant [12 x i8] c"Fatal error\00" 77 | @"$s10Foundation17AsyncLineSequenceVyAA3URLV0B5BytesVGACyxGSciAAWL" = linkonce_odr hidden global i8** null, align 8 78 | @"$s10Foundation17AsyncLineSequenceVyxGSciAAMc" = external global %swift.protocol_conformance_descriptor, align 4 79 | @"$sScI4next7ElementQzSgyYaKFTjTu" = external global %swift.async_func_pointer, align 8 80 | @"$s10Foundation17AsyncLineSequenceV0B8IteratorVyAA3URLV0B5BytesV_GAEyx_GScIAAWL" = linkonce_odr hidden global i8** null, align 8 81 | @"$s10Foundation17AsyncLineSequenceV0B8IteratorVyx_GScIAAMc" = external global %swift.protocol_conformance_descriptor, align 4 82 | @"$sypN" = external global %swift.full_type 83 | @"$sSSN" = external global %swift.type, align 8 84 | @4 = private unnamed_addr constant [2 x i8] c"\0A\00" 85 | @5 = private unnamed_addr constant [2 x i8] c" \00" 86 | @__swift_reflection_version = linkonce_odr hidden constant i16 3 87 | @llvm.used = appending global [12 x i8*] [i8* bitcast (i32 (i32, i8**)* @main to i8*), i8* bitcast ({ i32, i32, i32, i32 }* @"\01l__swift5_reflection_descriptor" to i8*), i8* bitcast ({ i32 }* @"\01l_entry_point" to i8*), i8* bitcast (void ()** @"_swift_FORCE_LOAD_$_swiftFoundation_$_main" to i8*), i8* bitcast (void ()** @"_swift_FORCE_LOAD_$_swiftObjectiveC_$_main" to i8*), i8* bitcast (void ()** @"_swift_FORCE_LOAD_$_swiftDarwin_$_main" to i8*), i8* bitcast (void ()** @"_swift_FORCE_LOAD_$_swiftCoreFoundation_$_main" to i8*), i8* bitcast (void ()** @"_swift_FORCE_LOAD_$_swiftDispatch_$_main" to i8*), i8* bitcast (void ()** @"_swift_FORCE_LOAD_$_swiftXPC_$_main" to i8*), i8* bitcast (void ()** @"_swift_FORCE_LOAD_$_swiftIOKit_$_main" to i8*), i8* bitcast (void ()** @"_swift_FORCE_LOAD_$_swiftCoreGraphics_$_main" to i8*), i8* bitcast (i16* @__swift_reflection_version to i8*)], section "llvm.metadata", align 8 88 | 89 | define i32 @main(i32 %0, i8** %1) #0 { 90 | entry: 91 | %2 = bitcast i8** %1 to i8* 92 | ret i32 0 93 | } 94 | 95 | define hidden swiftcc void @"$s4mainAAyyF"() #0 { 96 | entry: 97 | %0 = call %swift.type* @__swift_instantiateConcreteTypeFromMangledName({ i32, i32 }* @"$sScPSgMD") #7 98 | %1 = bitcast %swift.type* %0 to i8*** 99 | %2 = getelementptr inbounds i8**, i8*** %1, i64 -1 100 | %.valueWitnesses = load i8**, i8*** %2, align 8, !invariant.load !41, !dereferenceable !42 101 | %3 = bitcast i8** %.valueWitnesses to %swift.vwtable* 102 | %4 = getelementptr inbounds %swift.vwtable, %swift.vwtable* %3, i32 0, i32 8 103 | %size = load i64, i64* %4, align 8, !invariant.load !41 104 | %5 = alloca i8, i64 %size, align 16 105 | call void @llvm.lifetime.start.p0i8(i64 -1, i8* %5) 106 | %6 = bitcast i8* %5 to %TScPSg* 107 | %7 = bitcast %TScPSg* %6 to %swift.opaque* 108 | %8 = call swiftcc %swift.metadata_response @"$sScPMa"(i64 0) #7 109 | %9 = extractvalue %swift.metadata_response %8, 0 110 | %10 = bitcast %swift.type* %9 to i8*** 111 | %11 = getelementptr inbounds i8**, i8*** %10, i64 -1 112 | %.valueWitnesses1 = load i8**, i8*** %11, align 8, !invariant.load !41, !dereferenceable !42 113 | %12 = getelementptr inbounds i8*, i8** %.valueWitnesses1, i32 7 114 | %13 = load i8*, i8** %12, align 8, !invariant.load !41 115 | %storeEnumTagSinglePayload = bitcast i8* %13 to void (%swift.opaque*, i32, i32, %swift.type*)* 116 | call void %storeEnumTagSinglePayload(%swift.opaque* noalias %7, i32 1, i32 1, %swift.type* %9) #5 117 | %14 = call noalias %swift.refcounted* @swift_allocObject(%swift.type* getelementptr inbounds (%swift.full_boxmetadata, %swift.full_boxmetadata* @metadata, i32 0, i32 2), i64 32, i64 7) #5 118 | %15 = bitcast %swift.refcounted* %14 to <{ %swift.refcounted, %swift.function }>* 119 | %16 = getelementptr inbounds <{ %swift.refcounted, %swift.function }>, <{ %swift.refcounted, %swift.function }>* %15, i32 0, i32 1 120 | %.fn = getelementptr inbounds %swift.function, %swift.function* %16, i32 0, i32 0 121 | store i8* bitcast (%swift.async_func_pointer* @"$s4mainAAyyFyyYaYbKcfU_Tu" to i8*), i8** %.fn, align 8 122 | %.data = getelementptr inbounds %swift.function, %swift.function* %16, i32 0, i32 1 123 | store %swift.refcounted* null, %swift.refcounted** %.data, align 8 124 | %17 = call swiftcc %swift.refcounted* @"$sScTss5Error_pRs_rlE8priority9operationScTyxsAA_pGScPSg_xyYaYbKcntcfC"(%TScPSg* noalias nocapture %6, i8* bitcast (%swift.async_func_pointer* @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTATu" to i8*), %swift.refcounted* %14, %swift.type* getelementptr inbounds (%swift.full_type, %swift.full_type* @"$sytN", i32 0, i32 1)) 125 | call void @swift_release(%swift.refcounted* %17) #5 126 | %18 = bitcast %TScPSg* %6 to i8* 127 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %18) 128 | ret void 129 | } 130 | 131 | ; Function Attrs: noinline nounwind readnone 132 | define linkonce_odr hidden %swift.type* @__swift_instantiateConcreteTypeFromMangledName({ i32, i32 }* %0) #1 { 133 | entry: 134 | %1 = bitcast { i32, i32 }* %0 to i64* 135 | %2 = load atomic i64, i64* %1 monotonic, align 8 136 | %3 = icmp slt i64 %2, 0 137 | %4 = call i1 @llvm.expect.i1(i1 %3, i1 false) 138 | br i1 %4, label %8, label %5 139 | 140 | 5: ; preds = %8, %entry 141 | %6 = phi i64 [ %2, %entry ], [ %17, %8 ] 142 | %7 = inttoptr i64 %6 to %swift.type* 143 | ret %swift.type* %7 144 | 145 | 8: ; preds = %entry 146 | %9 = ashr i64 %2, 32 147 | %10 = sub i64 0, %9 148 | %11 = trunc i64 %2 to i32 149 | %12 = sext i32 %11 to i64 150 | %13 = ptrtoint { i32, i32 }* %0 to i64 151 | %14 = add i64 %13, %12 152 | %15 = inttoptr i64 %14 to i8* 153 | %16 = call swiftcc %swift.type* @swift_getTypeByMangledNameInContext(i8* %15, i64 %10, %swift.type_descriptor* null, i8** null) #7 154 | %17 = ptrtoint %swift.type* %16 to i64 155 | store atomic i64 %17, i64* %1 monotonic, align 8 156 | br label %5 157 | } 158 | 159 | ; Function Attrs: nofree nosync nounwind readnone willreturn 160 | declare i1 @llvm.expect.i1(i1, i1) #2 161 | 162 | ; Function Attrs: argmemonly nounwind 163 | declare swiftcc %swift.type* @swift_getTypeByMangledNameInContext(i8*, i64, %swift.type_descriptor*, i8**) #3 164 | 165 | ; Function Attrs: argmemonly nofree nosync nounwind willreturn 166 | declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #4 167 | 168 | declare swiftcc %swift.metadata_response @"$sScPMa"(i64) #0 169 | 170 | define internal swifttailcc void @"$s4mainAAyyFyyYaYbKcfU_"(%swift.context* swiftasync %0) #0 { 171 | entry: 172 | call void @coro.devirt.trigger(i8* null) 173 | %1 = bitcast %swift.context* %0 to i8* 174 | %async.ctx.frameptr = getelementptr inbounds i8, i8* %1, i32 24 175 | %FramePtr = bitcast i8* %async.ctx.frameptr to %"$s4mainAAyyFyyYaYbKcfU_.Frame"* 176 | %2 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 2 177 | %3 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 0 178 | %line.debug = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 1 179 | %4 = bitcast %TSS* %line.debug to i8* 180 | call void @llvm.memset.p0i8.i64(i8* align 8 %4, i8 0, i64 16, i1 false) 181 | store %swift.context* %0, %swift.context** %2, align 8 182 | %5 = call %swift.type* @__swift_instantiateConcreteTypeFromMangledName({ i32, i32 }* @"$s10Foundation17AsyncLineSequenceVyAA3URLV0B5BytesVGMD") #7 183 | %6 = bitcast %swift.type* %5 to i8*** 184 | %7 = getelementptr inbounds i8**, i8*** %6, i64 -1 185 | %.valueWitnesses = load i8**, i8*** %7, align 8, !invariant.load !41, !dereferenceable !42 186 | %8 = bitcast i8** %.valueWitnesses to %swift.vwtable* 187 | %9 = getelementptr inbounds %swift.vwtable, %swift.vwtable* %8, i32 0, i32 8 188 | %size = load i64, i64* %9, align 8, !invariant.load !41 189 | %10 = add i64 %size, 15 190 | %11 = and i64 %10, -16 191 | %12 = call swiftcc i8* @swift_task_alloc(i64 %11) #5 192 | %.spill.addr = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 3 193 | store i8* %12, i8** %.spill.addr, align 8 194 | call void @llvm.lifetime.start.p0i8(i64 -1, i8* %12) 195 | %13 = bitcast i8* %12 to %swift.opaque* 196 | %14 = call %swift.type* @__swift_instantiateConcreteTypeFromMangledName({ i32, i32 }* @"$s10Foundation17AsyncLineSequenceV0B8IteratorVyAA3URLV0B5BytesV_GMD") #7 197 | %.spill.addr21 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 4 198 | store %swift.type* %14, %swift.type** %.spill.addr21, align 8 199 | %15 = bitcast %swift.type* %14 to i8*** 200 | %16 = getelementptr inbounds i8**, i8*** %15, i64 -1 201 | %.valueWitnesses1 = load i8**, i8*** %16, align 8, !invariant.load !41, !dereferenceable !42 202 | %.valueWitnesses1.spill.addr = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 5 203 | store i8** %.valueWitnesses1, i8*** %.valueWitnesses1.spill.addr, align 8 204 | %17 = bitcast i8** %.valueWitnesses1 to %swift.vwtable* 205 | %18 = getelementptr inbounds %swift.vwtable, %swift.vwtable* %17, i32 0, i32 8 206 | %size2 = load i64, i64* %18, align 8, !invariant.load !41 207 | %19 = add i64 %size2, 15 208 | %20 = and i64 %19, -16 209 | %21 = call swiftcc i8* @swift_task_alloc(i64 %20) #5 210 | %.spill.addr30 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 6 211 | store i8* %21, i8** %.spill.addr30, align 8 212 | call void @llvm.lifetime.start.p0i8(i64 -1, i8* %21) 213 | %22 = bitcast i8* %21 to %swift.opaque* 214 | %.spill.addr37 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 7 215 | store %swift.opaque* %22, %swift.opaque** %.spill.addr37, align 8 216 | %23 = call %swift.type* @__swift_instantiateConcreteTypeFromMangledName({ i32, i32 }* @"$s10Foundation3URLVSgMD") #7 217 | %24 = bitcast %swift.type* %23 to i8*** 218 | %25 = getelementptr inbounds i8**, i8*** %24, i64 -1 219 | %.valueWitnesses3 = load i8**, i8*** %25, align 8, !invariant.load !41, !dereferenceable !42 220 | %26 = bitcast i8** %.valueWitnesses3 to %swift.vwtable* 221 | %27 = getelementptr inbounds %swift.vwtable, %swift.vwtable* %26, i32 0, i32 8 222 | %size4 = load i64, i64* %27, align 8, !invariant.load !41 223 | %28 = add i64 %size4, 15 224 | %29 = and i64 %28, -16 225 | %30 = call swiftcc i8* @swift_task_alloc(i64 %29) #5 226 | %.spill.addr40 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 8 227 | store i8* %30, i8** %.spill.addr40, align 8 228 | call void @llvm.lifetime.start.p0i8(i64 -1, i8* %30) 229 | %31 = bitcast i8* %30 to %T10Foundation3URLVSg* 230 | %32 = call swiftcc %swift.metadata_response @"$s10Foundation3URLVMa"(i64 0) #7 231 | %33 = extractvalue %swift.metadata_response %32, 0 232 | %.spill.addr47 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 9 233 | store %swift.type* %33, %swift.type** %.spill.addr47, align 8 234 | %34 = bitcast %swift.type* %33 to i8*** 235 | %35 = getelementptr inbounds i8**, i8*** %34, i64 -1 236 | %.valueWitnesses5 = load i8**, i8*** %35, align 8, !invariant.load !41, !dereferenceable !42 237 | %36 = bitcast i8** %.valueWitnesses5 to %swift.vwtable* 238 | %37 = getelementptr inbounds %swift.vwtable, %swift.vwtable* %36, i32 0, i32 8 239 | %size6 = load i64, i64* %37, align 8, !invariant.load !41 240 | %38 = add i64 %size6, 15 241 | %39 = and i64 %38, -16 242 | %40 = call swiftcc i8* @swift_task_alloc(i64 %39) #5 243 | %.spill.addr52 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 10 244 | store i8* %40, i8** %.spill.addr52, align 8 245 | call void @llvm.lifetime.start.p0i8(i64 -1, i8* %40) 246 | %41 = bitcast i8* %40 to %swift.opaque* 247 | %42 = call swiftcc i8* @swift_task_alloc(i64 %39) #5 248 | %.spill.addr59 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 11 249 | store i8* %42, i8** %.spill.addr59, align 8 250 | call void @llvm.lifetime.start.p0i8(i64 -1, i8* %42) 251 | %43 = bitcast i8* %42 to %swift.opaque* 252 | call void asm sideeffect "", "r"(i8* %42) 253 | %44 = call swiftcc { i64, %swift.bridge* } @"$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC"(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @0, i64 0, i64 0), i64 25, i1 true) 254 | %45 = extractvalue { i64, %swift.bridge* } %44, 0 255 | %46 = extractvalue { i64, %swift.bridge* } %44, 1 256 | %47 = bitcast %T10Foundation3URLVSg* %31 to %swift.opaque* 257 | call swiftcc void @"$s10Foundation3URLV6stringACSgSSh_tcfC"(%swift.opaque* noalias nocapture sret(%swift.opaque) %47, i64 %45, %swift.bridge* %46) 258 | call void @swift_bridgeObjectRelease(%swift.bridge* %46) #5 259 | %48 = getelementptr inbounds i8*, i8** %.valueWitnesses5, i32 6 260 | %49 = load i8*, i8** %48, align 8, !invariant.load !41 261 | %getEnumTagSinglePayload = bitcast i8* %49 to i32 (%swift.opaque*, i32, %swift.type*)* 262 | %50 = call i32 %getEnumTagSinglePayload(%swift.opaque* noalias %47, i32 1, %swift.type* %33) #10 263 | %51 = icmp ne i32 %50, 1 264 | br i1 %51, label %CoroSuspend, label %CoroEnd 265 | 266 | CoroEnd: ; preds = %entry 267 | call swiftcc void @"$ss17_assertionFailure__4file4line5flagss5NeverOs12StaticStringV_A2HSus6UInt32VtF"(i64 ptrtoint ([12 x i8]* @3 to i64), i64 11, i8 2, i64 ptrtoint ([58 x i8]* @2 to i64), i64 57, i8 2, i64 ptrtoint ([16 x i8]* @1 to i64), i64 15, i8 2, i64 5, i32 1) 268 | ret void 269 | 270 | CoroSuspend: ; preds = %entry 271 | %52 = getelementptr inbounds i8*, i8** %.valueWitnesses5, i32 4 272 | %53 = load i8*, i8** %52, align 8, !invariant.load !41 273 | %initializeWithTake = bitcast i8* %53 to %swift.opaque* (%swift.opaque*, %swift.opaque*, %swift.type*)* 274 | %54 = call %swift.opaque* %initializeWithTake(%swift.opaque* noalias %43, %swift.opaque* noalias %47, %swift.type* %33) #5 275 | %55 = getelementptr inbounds i8*, i8** %.valueWitnesses5, i32 2 276 | %56 = load i8*, i8** %55, align 8, !invariant.load !41 277 | %initializeWithCopy = bitcast i8* %56 to %swift.opaque* (%swift.opaque*, %swift.opaque*, %swift.type*)* 278 | %57 = call %swift.opaque* %initializeWithCopy(%swift.opaque* noalias %41, %swift.opaque* noalias %43, %swift.type* %33) #5 279 | call swiftcc void @"$s10Foundation3URLV5linesAA17AsyncLineSequenceVyAC0D5BytesVGvg"(%swift.opaque* noalias nocapture sret(%swift.opaque) %13, %swift.opaque* noalias nocapture swiftself %41) 280 | %58 = getelementptr inbounds i8*, i8** %.valueWitnesses5, i32 1 281 | %59 = load i8*, i8** %58, align 8, !invariant.load !41 282 | %.spill.addr66 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 12 283 | store i8* %59, i8** %.spill.addr66, align 8 284 | %destroy = bitcast i8* %59 to void (%swift.opaque*, %swift.type*)* 285 | call void %destroy(%swift.opaque* noalias %41, %swift.type* %33) #5 286 | %60 = call i8** @"$s10Foundation17AsyncLineSequenceVyAA3URLV0B5BytesVGACyxGSciAAWl"() #7 287 | call swiftcc void @"$sSci17makeAsyncIterator0bC0QzyFTj"(%swift.opaque* noalias nocapture sret(%swift.opaque) %22, %swift.opaque* noalias nocapture swiftself %13, %swift.type* %5, i8** %60) 288 | %61 = bitcast %TSSSg* %3 to i8* 289 | call void @llvm.lifetime.start.p0i8(i64 16, i8* %61) 290 | %62 = call i8** @"$s10Foundation17AsyncLineSequenceV0B8IteratorVyAA3URLV0B5BytesV_GAEyx_GScIAAWl"() #7 291 | %63 = load i32, i32* getelementptr inbounds (%swift.async_func_pointer, %swift.async_func_pointer* @"$sScI4next7ElementQzSgyYaKFTjTu", i32 0, i32 1), align 8 292 | %64 = zext i32 %63 to i64 293 | %65 = call swiftcc i8* @swift_task_alloc(i64 %64) #5 294 | %.spill.addr71 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 13 295 | store i8* %65, i8** %.spill.addr71, align 8 296 | call void @llvm.lifetime.start.p0i8(i64 -1, i8* %65) 297 | %66 = bitcast i8* %65 to <{ %swift.context*, void (%swift.context*)*, i32 }>* 298 | %67 = bitcast %TSSSg* %3 to %TSq* 299 | %68 = load %swift.context*, %swift.context** %2, align 8 300 | %69 = getelementptr inbounds <{ %swift.context*, void (%swift.context*)*, i32 }>, <{ %swift.context*, void (%swift.context*)*, i32 }>* %66, i32 0, i32 0 301 | store %swift.context* %68, %swift.context** %69, align 8 302 | %70 = getelementptr inbounds <{ %swift.context*, void (%swift.context*)*, i32 }>, <{ %swift.context*, void (%swift.context*)*, i32 }>* %66, i32 0, i32 1 303 | store void (%swift.context*)* bitcast (void (i8*, %swift.error*)* @"$s4mainAAyyFyyYaYbKcfU_TQ0_" to void (%swift.context*)*), void (%swift.context*)** %70, align 8 304 | %71 = bitcast i8* %65 to %swift.context* 305 | %.reload39 = load %swift.opaque*, %swift.opaque** %.spill.addr37, align 8 306 | %.reload27 = load %swift.type*, %swift.type** %.spill.addr21, align 8 307 | musttail call swifttailcc void @"$sScI4next7ElementQzSgyYaKFTj"(%TSq* noalias nocapture %67, %swift.context* swiftasync %71, %swift.opaque* nocapture swiftself %.reload39, %swift.type* %.reload27, i8** %62) #5 308 | ret void 309 | } 310 | 311 | define internal swifttailcc void @"$s4mainAAyyFyyYaYbKcfU_TQ0_"(i8* swiftasync %0, %swift.error* swiftself %1) #0 { 312 | entryresume.0: 313 | %2 = bitcast i8* %0 to i8** 314 | %3 = load i8*, i8** %2, align 8 315 | %4 = call i8** @llvm.swift.async.context.addr() #5 316 | store i8* %3, i8** %4, align 8 317 | %async.ctx.frameptr1 = getelementptr inbounds i8, i8* %3, i32 24 318 | %FramePtr = bitcast i8* %async.ctx.frameptr1 to %"$s4mainAAyyFyyYaYbKcfU_.Frame"* 319 | %vFrame = bitcast %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr to i8* 320 | %5 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 2 321 | %6 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 0 322 | %line.debug = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 1 323 | %.reload.addr72 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 13 324 | %.reload73 = load i8*, i8** %.reload.addr72, align 8 325 | %7 = bitcast i8* %0 to i8** 326 | %8 = load i8*, i8** %7, align 8 327 | %9 = call i8** @llvm.swift.async.context.addr() #5 328 | store i8* %8, i8** %9, align 8 329 | %10 = bitcast i8* %8 to %swift.context* 330 | store %swift.context* %10, %swift.context** %5, align 8 331 | call swiftcc void @swift_task_dealloc(i8* %.reload73) #5 332 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %.reload73) 333 | %11 = icmp ne %swift.error* %1, null 334 | br i1 %11, label %MustTailCall.Before.CoroEnd13, label %12 335 | 336 | 12: ; preds = %entryresume.0 337 | %13 = bitcast %TSSSg* %6 to { i64, i64 }* 338 | %14 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %13, i32 0, i32 0 339 | %15 = load i64, i64* %14, align 8 340 | %16 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %13, i32 0, i32 1 341 | %17 = load i64, i64* %16, align 8 342 | %18 = bitcast %TSSSg* %6 to i8* 343 | call void @llvm.lifetime.end.p0i8(i64 16, i8* %18) 344 | %19 = icmp eq i64 %17, 0 345 | br i1 %19, label %MustTailCall.Before.CoroEnd, label %CoroSuspend 346 | 347 | CoroSuspend: ; preds = %12 348 | %20 = inttoptr i64 %17 to %swift.bridge* 349 | %21 = bitcast %TSS* %line.debug to i8* 350 | call void @llvm.lifetime.start.p0i8(i64 16, i8* %21) 351 | %line.debug._guts = getelementptr inbounds %TSS, %TSS* %line.debug, i32 0, i32 0 352 | %line.debug._guts._object = getelementptr inbounds %Ts11_StringGutsV, %Ts11_StringGutsV* %line.debug._guts, i32 0, i32 0 353 | %line.debug._guts._object._countAndFlagsBits = getelementptr inbounds %Ts13_StringObjectV, %Ts13_StringObjectV* %line.debug._guts._object, i32 0, i32 0 354 | %line.debug._guts._object._countAndFlagsBits._value = getelementptr inbounds %Ts6UInt64V, %Ts6UInt64V* %line.debug._guts._object._countAndFlagsBits, i32 0, i32 0 355 | store i64 %15, i64* %line.debug._guts._object._countAndFlagsBits._value, align 8 356 | %line.debug._guts._object._object = getelementptr inbounds %Ts13_StringObjectV, %Ts13_StringObjectV* %line.debug._guts._object, i32 0, i32 1 357 | store %swift.bridge* %20, %swift.bridge** %line.debug._guts._object._object, align 8 358 | call void asm sideeffect "", "r"(%TSS* %line.debug) 359 | %22 = call swiftcc { %swift.bridge*, i8* } @"$ss27_allocateUninitializedArrayySayxG_BptBwlF"(i64 1, %swift.type* getelementptr inbounds (%swift.full_type, %swift.full_type* @"$sypN", i32 0, i32 1)) 360 | %23 = extractvalue { %swift.bridge*, i8* } %22, 0 361 | %24 = extractvalue { %swift.bridge*, i8* } %22, 1 362 | %25 = bitcast i8* %24 to %Any* 363 | %26 = call %swift.bridge* @swift_bridgeObjectRetain(%swift.bridge* returned %20) #5 364 | %27 = getelementptr inbounds %Any, %Any* %25, i32 0, i32 1 365 | store %swift.type* @"$sSSN", %swift.type** %27, align 8 366 | %28 = getelementptr inbounds %Any, %Any* %25, i32 0, i32 0 367 | %29 = getelementptr inbounds %Any, %Any* %25, i32 0, i32 0 368 | %30 = bitcast [24 x i8]* %29 to %TSS* 369 | %._guts = getelementptr inbounds %TSS, %TSS* %30, i32 0, i32 0 370 | %._guts._object = getelementptr inbounds %Ts11_StringGutsV, %Ts11_StringGutsV* %._guts, i32 0, i32 0 371 | %._guts._object._countAndFlagsBits = getelementptr inbounds %Ts13_StringObjectV, %Ts13_StringObjectV* %._guts._object, i32 0, i32 0 372 | %._guts._object._countAndFlagsBits._value = getelementptr inbounds %Ts6UInt64V, %Ts6UInt64V* %._guts._object._countAndFlagsBits, i32 0, i32 0 373 | store i64 %15, i64* %._guts._object._countAndFlagsBits._value, align 8 374 | %._guts._object._object = getelementptr inbounds %Ts13_StringObjectV, %Ts13_StringObjectV* %._guts._object, i32 0, i32 1 375 | store %swift.bridge* %20, %swift.bridge** %._guts._object._object, align 8 376 | %31 = call swiftcc %swift.bridge* @"$ss27_finalizeUninitializedArrayySayxGABnlF"(%swift.bridge* %23, %swift.type* getelementptr inbounds (%swift.full_type, %swift.full_type* @"$sypN", i32 0, i32 1)) 377 | %32 = call swiftcc { i64, %swift.bridge* } @"$ss5print_9separator10terminatoryypd_S2StFfA0_"() 378 | %33 = extractvalue { i64, %swift.bridge* } %32, 0 379 | %34 = extractvalue { i64, %swift.bridge* } %32, 1 380 | %35 = call swiftcc { i64, %swift.bridge* } @"$ss5print_9separator10terminatoryypd_S2StFfA1_"() 381 | %36 = extractvalue { i64, %swift.bridge* } %35, 0 382 | %37 = extractvalue { i64, %swift.bridge* } %35, 1 383 | call swiftcc void @"$ss5print_9separator10terminatoryypd_S2StF"(%swift.bridge* %31, i64 %33, %swift.bridge* %34, i64 %36, %swift.bridge* %37) 384 | call void @swift_bridgeObjectRelease(%swift.bridge* %37) #5 385 | call void @swift_bridgeObjectRelease(%swift.bridge* %34) #5 386 | call void @swift_bridgeObjectRelease(%swift.bridge* %31) #5 387 | call void @swift_bridgeObjectRelease(%swift.bridge* %20) #5 388 | %38 = bitcast %TSSSg* %6 to i8* 389 | call void @llvm.lifetime.start.p0i8(i64 16, i8* %38) 390 | %39 = call i8** @"$s10Foundation17AsyncLineSequenceV0B8IteratorVyAA3URLV0B5BytesV_GAEyx_GScIAAWl"() #7 391 | %40 = load i32, i32* getelementptr inbounds (%swift.async_func_pointer, %swift.async_func_pointer* @"$sScI4next7ElementQzSgyYaKFTjTu", i32 0, i32 1), align 8 392 | %41 = zext i32 %40 to i64 393 | %42 = call swiftcc i8* @swift_task_alloc(i64 %41) #5 394 | %.spill.addr71 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 13 395 | store i8* %42, i8** %.spill.addr71, align 8 396 | call void @llvm.lifetime.start.p0i8(i64 -1, i8* %42) 397 | %43 = bitcast i8* %42 to <{ %swift.context*, void (%swift.context*)*, i32 }>* 398 | %44 = bitcast %TSSSg* %6 to %TSq* 399 | %45 = load %swift.context*, %swift.context** %5, align 8 400 | %46 = getelementptr inbounds <{ %swift.context*, void (%swift.context*)*, i32 }>, <{ %swift.context*, void (%swift.context*)*, i32 }>* %43, i32 0, i32 0 401 | store %swift.context* %45, %swift.context** %46, align 8 402 | %47 = bitcast i8* bitcast (void (i8*, %swift.error*)* @"$s4mainAAyyFyyYaYbKcfU_TQ0_" to i8*) to void (%swift.context*)* 403 | %48 = getelementptr inbounds <{ %swift.context*, void (%swift.context*)*, i32 }>, <{ %swift.context*, void (%swift.context*)*, i32 }>* %43, i32 0, i32 1 404 | store void (%swift.context*)* %47, void (%swift.context*)** %48, align 8 405 | %49 = bitcast i8* %42 to %swift.context* 406 | %.reload.addr38 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 7 407 | %.reload39 = load %swift.opaque*, %swift.opaque** %.reload.addr38, align 8 408 | %.reload.addr26 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 4 409 | %.reload27 = load %swift.type*, %swift.type** %.reload.addr26, align 8 410 | musttail call swifttailcc void @"$sScI4next7ElementQzSgyYaKFTj"(%TSq* noalias nocapture %44, %swift.context* swiftasync %49, %swift.opaque* nocapture swiftself %.reload39, %swift.type* %.reload27, i8** %39) #5 411 | ret void 412 | 413 | MustTailCall.Before.CoroEnd: ; preds = %12 414 | %.reload.addr69 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 12 415 | %.reload70 = load i8*, i8** %.reload.addr69, align 8 416 | %.reload.addr62 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 11 417 | %.reload63 = load i8*, i8** %.reload.addr62, align 8 418 | %.reload.addr55 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 10 419 | %.reload56 = load i8*, i8** %.reload.addr55, align 8 420 | %.reload.addr48 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 9 421 | %.reload49 = load %swift.type*, %swift.type** %.reload.addr48, align 8 422 | %.reload.addr43 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 8 423 | %.reload44 = load i8*, i8** %.reload.addr43, align 8 424 | %.reload.addr33 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 6 425 | %.reload34 = load i8*, i8** %.reload.addr33, align 8 426 | %.valueWitnesses1.reload.addr = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 5 427 | %.valueWitnesses1.reload = load i8**, i8*** %.valueWitnesses1.reload.addr, align 8 428 | %.reload.addr22 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 4 429 | %.reload23 = load %swift.type*, %swift.type** %.reload.addr22, align 8 430 | %.reload.addr17 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 3 431 | %.reload18 = load i8*, i8** %.reload.addr17, align 8 432 | %destroy15 = bitcast i8* %.reload70 to void (%swift.opaque*, %swift.type*)* 433 | %50 = bitcast i8* %.reload63 to %swift.opaque* 434 | %51 = bitcast i8* %.reload56 to %swift.opaque* 435 | %52 = bitcast i8* %.reload44 to %T10Foundation3URLVSg* 436 | %53 = bitcast i8* %.reload34 to %swift.opaque* 437 | %54 = bitcast i8* %.reload18 to %swift.opaque* 438 | %55 = getelementptr inbounds i8*, i8** %.valueWitnesses1.reload, i32 1 439 | %56 = load i8*, i8** %55, align 8, !invariant.load !41 440 | %destroy8 = bitcast i8* %56 to void (%swift.opaque*, %swift.type*)* 441 | call void %destroy8(%swift.opaque* noalias %53, %swift.type* %.reload23) #5 442 | call void %destroy15(%swift.opaque* noalias %50, %swift.type* %.reload49) #5 443 | %57 = bitcast %swift.opaque* %50 to i8* 444 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %57) 445 | call swiftcc void @swift_task_dealloc(i8* %.reload63) #5 446 | %58 = bitcast %swift.opaque* %51 to i8* 447 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %58) 448 | call swiftcc void @swift_task_dealloc(i8* %.reload56) #5 449 | %59 = bitcast %T10Foundation3URLVSg* %52 to i8* 450 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %59) 451 | call swiftcc void @swift_task_dealloc(i8* %.reload44) #5 452 | %60 = bitcast %swift.opaque* %53 to i8* 453 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %60) 454 | call swiftcc void @swift_task_dealloc(i8* %.reload34) #5 455 | %61 = bitcast %swift.opaque* %54 to i8* 456 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %61) 457 | call swiftcc void @swift_task_dealloc(i8* %.reload18) #5 458 | %62 = load %swift.context*, %swift.context** %5, align 8 459 | %63 = bitcast %swift.context* %62 to <{ %swift.context*, void (%swift.context*)*, i32 }>* 460 | %64 = getelementptr inbounds <{ %swift.context*, void (%swift.context*)*, i32 }>, <{ %swift.context*, void (%swift.context*)*, i32 }>* %63, i32 0, i32 1 461 | %65 = load void (%swift.context*)*, void (%swift.context*)** %64, align 8 462 | %66 = bitcast void (%swift.context*)* %65 to void (%swift.context*, %swift.error*)* 463 | %67 = load %swift.context*, %swift.context** %5, align 8 464 | %68 = bitcast void (%swift.context*, %swift.error*)* %66 to i8* 465 | musttail call swifttailcc void %66(%swift.context* swiftasync %67, %swift.error* swiftself null) #5 466 | ret void 467 | 468 | MustTailCall.Before.CoroEnd13: ; preds = %entryresume.0 469 | %69 = phi %swift.error* [ %1, %entryresume.0 ] 470 | %.reload.addr67 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 12 471 | %.reload68 = load i8*, i8** %.reload.addr67, align 8 472 | %.reload.addr64 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 11 473 | %.reload65 = load i8*, i8** %.reload.addr64, align 8 474 | %.reload.addr60 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 11 475 | %.reload61 = load i8*, i8** %.reload.addr60, align 8 476 | %.reload.addr57 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 10 477 | %.reload58 = load i8*, i8** %.reload.addr57, align 8 478 | %.reload.addr53 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 10 479 | %.reload54 = load i8*, i8** %.reload.addr53, align 8 480 | %.reload.addr50 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 9 481 | %.reload51 = load %swift.type*, %swift.type** %.reload.addr50, align 8 482 | %.reload.addr45 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 8 483 | %.reload46 = load i8*, i8** %.reload.addr45, align 8 484 | %.reload.addr41 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 8 485 | %.reload42 = load i8*, i8** %.reload.addr41, align 8 486 | %.reload.addr35 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 6 487 | %.reload36 = load i8*, i8** %.reload.addr35, align 8 488 | %.reload.addr31 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 6 489 | %.reload32 = load i8*, i8** %.reload.addr31, align 8 490 | %.valueWitnesses1.reload.addr28 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 5 491 | %.valueWitnesses1.reload29 = load i8**, i8*** %.valueWitnesses1.reload.addr28, align 8 492 | %.reload.addr24 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 4 493 | %.reload25 = load %swift.type*, %swift.type** %.reload.addr24, align 8 494 | %.reload.addr19 = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 3 495 | %.reload20 = load i8*, i8** %.reload.addr19, align 8 496 | %.reload.addr = getelementptr inbounds %"$s4mainAAyyFyyYaYbKcfU_.Frame", %"$s4mainAAyyFyyYaYbKcfU_.Frame"* %FramePtr, i32 0, i32 3 497 | %.reload = load i8*, i8** %.reload.addr, align 8 498 | %destroy16 = bitcast i8* %.reload68 to void (%swift.opaque*, %swift.type*)* 499 | %70 = bitcast i8* %.reload61 to %swift.opaque* 500 | %71 = bitcast i8* %.reload54 to %swift.opaque* 501 | %72 = bitcast i8* %.reload42 to %T10Foundation3URLVSg* 502 | %73 = bitcast i8* %.reload32 to %swift.opaque* 503 | %74 = bitcast i8* %.reload to %swift.opaque* 504 | %75 = bitcast %TSSSg* %6 to i8* 505 | call void @llvm.lifetime.end.p0i8(i64 16, i8* %75) 506 | %76 = getelementptr inbounds i8*, i8** %.valueWitnesses1.reload29, i32 1 507 | %77 = load i8*, i8** %76, align 8, !invariant.load !41 508 | %destroy7 = bitcast i8* %77 to void (%swift.opaque*, %swift.type*)* 509 | call void %destroy7(%swift.opaque* noalias %73, %swift.type* %.reload25) #5 510 | call void %destroy16(%swift.opaque* noalias %70, %swift.type* %.reload51) #5 511 | %78 = bitcast %swift.opaque* %70 to i8* 512 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %78) 513 | call swiftcc void @swift_task_dealloc(i8* %.reload65) #5 514 | %79 = bitcast %swift.opaque* %71 to i8* 515 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %79) 516 | call swiftcc void @swift_task_dealloc(i8* %.reload58) #5 517 | %80 = bitcast %T10Foundation3URLVSg* %72 to i8* 518 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %80) 519 | call swiftcc void @swift_task_dealloc(i8* %.reload46) #5 520 | %81 = bitcast %swift.opaque* %73 to i8* 521 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %81) 522 | call swiftcc void @swift_task_dealloc(i8* %.reload36) #5 523 | %82 = bitcast %swift.opaque* %74 to i8* 524 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %82) 525 | call swiftcc void @swift_task_dealloc(i8* %.reload20) #5 526 | %83 = load %swift.context*, %swift.context** %5, align 8 527 | %84 = bitcast %swift.context* %83 to <{ %swift.context*, void (%swift.context*)*, i32 }>* 528 | %85 = getelementptr inbounds <{ %swift.context*, void (%swift.context*)*, i32 }>, <{ %swift.context*, void (%swift.context*)*, i32 }>* %84, i32 0, i32 1 529 | %86 = load void (%swift.context*)*, void (%swift.context*)** %85, align 8 530 | %87 = bitcast void (%swift.context*)* %86 to void (%swift.context*, %swift.error*)* 531 | %88 = load %swift.context*, %swift.context** %5, align 8 532 | %89 = bitcast void (%swift.context*, %swift.error*)* %87 to i8* 533 | musttail call swifttailcc void %87(%swift.context* swiftasync %88, %swift.error* swiftself %1) #5 534 | ret void 535 | } 536 | 537 | define linkonce_odr hidden swiftcc %swift.bridge* @"$ss27_finalizeUninitializedArrayySayxGABnlF"(%swift.bridge* %0, %swift.type* %Element) #0 { 538 | entry: 539 | %Element1 = alloca %swift.type*, align 8 540 | %1 = alloca %TSa, align 8 541 | store %swift.type* %Element, %swift.type** %Element1, align 8 542 | %2 = bitcast %TSa* %1 to i8* 543 | call void @llvm.lifetime.start.p0i8(i64 8, i8* %2) 544 | %._buffer = getelementptr inbounds %TSa, %TSa* %1, i32 0, i32 0 545 | %._buffer._storage = getelementptr inbounds %Ts12_ArrayBufferV, %Ts12_ArrayBufferV* %._buffer, i32 0, i32 0 546 | %._buffer._storage.rawValue = getelementptr inbounds %Ts14_BridgeStorageV, %Ts14_BridgeStorageV* %._buffer._storage, i32 0, i32 0 547 | store %swift.bridge* %0, %swift.bridge** %._buffer._storage.rawValue, align 8 548 | %3 = call swiftcc %swift.metadata_response @"$sSaMa"(i64 0, %swift.type* %Element) #7 549 | %4 = extractvalue %swift.metadata_response %3, 0 550 | call swiftcc void @"$sSa12_endMutationyyF"(%swift.type* %4, %TSa* nocapture swiftself dereferenceable(8) %1) 551 | %._buffer2 = getelementptr inbounds %TSa, %TSa* %1, i32 0, i32 0 552 | %._buffer2._storage = getelementptr inbounds %Ts12_ArrayBufferV, %Ts12_ArrayBufferV* %._buffer2, i32 0, i32 0 553 | %._buffer2._storage.rawValue = getelementptr inbounds %Ts14_BridgeStorageV, %Ts14_BridgeStorageV* %._buffer2._storage, i32 0, i32 0 554 | %5 = load %swift.bridge*, %swift.bridge** %._buffer2._storage.rawValue, align 8 555 | %6 = bitcast %TSa* %1 to i8* 556 | call void @llvm.lifetime.end.p0i8(i64 8, i8* %6) 557 | ret %swift.bridge* %5 558 | } 559 | 560 | define linkonce_odr hidden swiftcc { i64, %swift.bridge* } @"$ss5print_9separator10terminatoryypd_S2StFfA0_"() #0 { 561 | entry: 562 | %0 = call swiftcc { i64, %swift.bridge* } @"$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC"(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @5, i64 0, i64 0), i64 1, i1 true) 563 | %1 = extractvalue { i64, %swift.bridge* } %0, 0 564 | %2 = extractvalue { i64, %swift.bridge* } %0, 1 565 | %3 = insertvalue { i64, %swift.bridge* } undef, i64 %1, 0 566 | %4 = insertvalue { i64, %swift.bridge* } %3, %swift.bridge* %2, 1 567 | ret { i64, %swift.bridge* } %4 568 | } 569 | 570 | define linkonce_odr hidden swiftcc { i64, %swift.bridge* } @"$ss5print_9separator10terminatoryypd_S2StFfA1_"() #0 { 571 | entry: 572 | %0 = call swiftcc { i64, %swift.bridge* } @"$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC"(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i64 0, i64 0), i64 1, i1 true) 573 | %1 = extractvalue { i64, %swift.bridge* } %0, 0 574 | %2 = extractvalue { i64, %swift.bridge* } %0, 1 575 | %3 = insertvalue { i64, %swift.bridge* } undef, i64 %1, 0 576 | %4 = insertvalue { i64, %swift.bridge* } %3, %swift.bridge* %2, 1 577 | ret { i64, %swift.bridge* } %4 578 | } 579 | 580 | define linkonce_odr hidden swifttailcc void @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR"(%swift.opaque* noalias nocapture %0, %swift.context* swiftasync %1, i8* %2, %swift.refcounted* %3) #0 { 581 | entry: 582 | call void @coro.devirt.trigger(i8* null) 583 | %4 = bitcast %swift.context* %1 to i8* 584 | %async.ctx.frameptr = getelementptr inbounds i8, i8* %4, i32 24 585 | %FramePtr = bitcast i8* %async.ctx.frameptr to %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR.Frame"* 586 | %5 = getelementptr inbounds %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR.Frame", %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR.Frame"* %FramePtr, i32 0, i32 0 587 | store %swift.context* %1, %swift.context** %5, align 8 588 | %6 = bitcast i8* %2 to void (%swift.context*, %swift.refcounted*)* 589 | %7 = bitcast void (%swift.context*, %swift.refcounted*)* %6 to %swift.async_func_pointer* 590 | %8 = getelementptr inbounds %swift.async_func_pointer, %swift.async_func_pointer* %7, i32 0, i32 0 591 | %9 = load i32, i32* %8, align 8 592 | %10 = sext i32 %9 to i64 593 | %11 = ptrtoint i32* %8 to i64 594 | %12 = add i64 %11, %10 595 | %13 = inttoptr i64 %12 to i8* 596 | %14 = bitcast i8* %13 to void (%swift.context*, %swift.refcounted*)* 597 | %15 = getelementptr inbounds %swift.async_func_pointer, %swift.async_func_pointer* %7, i32 0, i32 1 598 | %16 = load i32, i32* %15, align 8 599 | %17 = zext i32 %16 to i64 600 | %18 = call swiftcc i8* @swift_task_alloc(i64 %17) #5 601 | %.spill.addr = getelementptr inbounds %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR.Frame", %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR.Frame"* %FramePtr, i32 0, i32 1 602 | store i8* %18, i8** %.spill.addr, align 8 603 | call void @llvm.lifetime.start.p0i8(i64 -1, i8* %18) 604 | %19 = bitcast i8* %18 to <{ %swift.context*, void (%swift.context*)*, i32 }>* 605 | %20 = load %swift.context*, %swift.context** %5, align 8 606 | %21 = getelementptr inbounds <{ %swift.context*, void (%swift.context*)*, i32 }>, <{ %swift.context*, void (%swift.context*)*, i32 }>* %19, i32 0, i32 0 607 | store %swift.context* %20, %swift.context** %21, align 8 608 | %22 = getelementptr inbounds <{ %swift.context*, void (%swift.context*)*, i32 }>, <{ %swift.context*, void (%swift.context*)*, i32 }>* %19, i32 0, i32 1 609 | store void (%swift.context*)* bitcast (void (i8*, %swift.error*)* @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTQ0_" to void (%swift.context*)*), void (%swift.context*)** %22, align 8 610 | %23 = bitcast i8* %18 to %swift.context* 611 | musttail call swifttailcc void %14(%swift.context* swiftasync %23, %swift.refcounted* swiftself %3) #5 612 | ret void 613 | } 614 | 615 | define internal swifttailcc void @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTQ0_"(i8* swiftasync %0, %swift.error* swiftself %1) #0 { 616 | entryresume.0: 617 | %2 = bitcast i8* %0 to i8** 618 | %3 = load i8*, i8** %2, align 8 619 | %4 = call i8** @llvm.swift.async.context.addr() #5 620 | store i8* %3, i8** %4, align 8 621 | %async.ctx.frameptr1 = getelementptr inbounds i8, i8* %3, i32 24 622 | %FramePtr = bitcast i8* %async.ctx.frameptr1 to %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR.Frame"* 623 | %vFrame = bitcast %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR.Frame"* %FramePtr to i8* 624 | %5 = getelementptr inbounds %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR.Frame", %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR.Frame"* %FramePtr, i32 0, i32 0 625 | %.reload.addr = getelementptr inbounds %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR.Frame", %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR.Frame"* %FramePtr, i32 0, i32 1 626 | %.reload = load i8*, i8** %.reload.addr, align 8 627 | %6 = bitcast i8* %0 to i8** 628 | %7 = load i8*, i8** %6, align 8 629 | %8 = call i8** @llvm.swift.async.context.addr() #5 630 | store i8* %7, i8** %8, align 8 631 | %9 = bitcast i8* %7 to %swift.context* 632 | store %swift.context* %9, %swift.context** %5, align 8 633 | call swiftcc void @swift_task_dealloc(i8* %.reload) #5 634 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %.reload) 635 | %10 = icmp ne %swift.error* %1, null 636 | br i1 %10, label %MustTailCall.Before.CoroEnd2, label %MustTailCall.Before.CoroEnd 637 | 638 | MustTailCall.Before.CoroEnd: ; preds = %entryresume.0 639 | %11 = load %swift.context*, %swift.context** %5, align 8 640 | %12 = bitcast %swift.context* %11 to <{ %swift.context*, void (%swift.context*)*, i32 }>* 641 | %13 = getelementptr inbounds <{ %swift.context*, void (%swift.context*)*, i32 }>, <{ %swift.context*, void (%swift.context*)*, i32 }>* %12, i32 0, i32 1 642 | %14 = load void (%swift.context*)*, void (%swift.context*)** %13, align 8 643 | %15 = bitcast void (%swift.context*)* %14 to void (%swift.context*, %swift.error*)* 644 | %16 = load %swift.context*, %swift.context** %5, align 8 645 | %17 = bitcast void (%swift.context*, %swift.error*)* %15 to i8* 646 | musttail call swifttailcc void %15(%swift.context* swiftasync %16, %swift.error* swiftself null) #5 647 | ret void 648 | 649 | MustTailCall.Before.CoroEnd2: ; preds = %entryresume.0 650 | %18 = phi %swift.error* [ %1, %entryresume.0 ] 651 | %19 = load %swift.context*, %swift.context** %5, align 8 652 | %20 = bitcast %swift.context* %19 to <{ %swift.context*, void (%swift.context*)*, i32 }>* 653 | %21 = getelementptr inbounds <{ %swift.context*, void (%swift.context*)*, i32 }>, <{ %swift.context*, void (%swift.context*)*, i32 }>* %20, i32 0, i32 1 654 | %22 = load void (%swift.context*)*, void (%swift.context*)** %21, align 8 655 | %23 = bitcast void (%swift.context*)* %22 to void (%swift.context*, %swift.error*)* 656 | %24 = load %swift.context*, %swift.context** %5, align 8 657 | %25 = bitcast void (%swift.context*, %swift.error*)* %23 to i8* 658 | musttail call swifttailcc void %23(%swift.context* swiftasync %24, %swift.error* swiftself %1) #5 659 | ret void 660 | } 661 | 662 | define private swiftcc void @objectdestroy(%swift.refcounted* swiftself %0) #0 { 663 | entry: 664 | %1 = bitcast %swift.refcounted* %0 to <{ %swift.refcounted, %swift.function }>* 665 | %2 = getelementptr inbounds <{ %swift.refcounted, %swift.function }>, <{ %swift.refcounted, %swift.function }>* %1, i32 0, i32 1 666 | %.data = getelementptr inbounds %swift.function, %swift.function* %2, i32 0, i32 1 667 | %3 = load %swift.refcounted*, %swift.refcounted** %.data, align 8 668 | call void @swift_release(%swift.refcounted* %3) #5 669 | call void @swift_deallocObject(%swift.refcounted* %0, i64 32, i64 7) 670 | ret void 671 | } 672 | 673 | ; Function Attrs: nounwind 674 | declare void @swift_release(%swift.refcounted*) #5 675 | 676 | ; Function Attrs: nounwind 677 | declare void @swift_deallocObject(%swift.refcounted*, i64, i64) #5 678 | 679 | ; Function Attrs: nounwind 680 | declare %swift.refcounted* @swift_allocObject(%swift.type*, i64, i64) #5 681 | 682 | define internal swifttailcc void @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA"(%swift.opaque* noalias nocapture %0, %swift.context* swiftasync %1, %swift.refcounted* swiftself %2) #0 { 683 | entry: 684 | call void @coro.devirt.trigger(i8* null) 685 | %3 = bitcast %swift.context* %1 to i8* 686 | %async.ctx.frameptr = getelementptr inbounds i8, i8* %3, i32 24 687 | %FramePtr = bitcast i8* %async.ctx.frameptr to %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA.Frame"* 688 | %4 = getelementptr inbounds %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA.Frame", %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA.Frame"* %FramePtr, i32 0, i32 0 689 | store %swift.context* %1, %swift.context** %4, align 8 690 | %5 = bitcast %swift.refcounted* %2 to <{ %swift.refcounted, %swift.function }>* 691 | %6 = getelementptr inbounds <{ %swift.refcounted, %swift.function }>, <{ %swift.refcounted, %swift.function }>* %5, i32 0, i32 1 692 | %.fn = getelementptr inbounds %swift.function, %swift.function* %6, i32 0, i32 0 693 | %7 = load i8*, i8** %.fn, align 8 694 | %.data = getelementptr inbounds %swift.function, %swift.function* %6, i32 0, i32 1 695 | %8 = load %swift.refcounted*, %swift.refcounted** %.data, align 8 696 | %9 = load i32, i32* getelementptr inbounds (%swift.async_func_pointer, %swift.async_func_pointer* @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTu", i32 0, i32 1), align 8 697 | %10 = zext i32 %9 to i64 698 | %11 = call swiftcc i8* @swift_task_alloc(i64 %10) #5 699 | %.spill.addr = getelementptr inbounds %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA.Frame", %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA.Frame"* %FramePtr, i32 0, i32 1 700 | store i8* %11, i8** %.spill.addr, align 8 701 | call void @llvm.lifetime.start.p0i8(i64 -1, i8* %11) 702 | %12 = bitcast i8* %11 to <{ %swift.context*, void (%swift.context*)*, i32 }>* 703 | %13 = bitcast i8* %11 to %swift.context* 704 | %14 = load %swift.context*, %swift.context** %4, align 8 705 | %15 = getelementptr inbounds <{ %swift.context*, void (%swift.context*)*, i32 }>, <{ %swift.context*, void (%swift.context*)*, i32 }>* %12, i32 0, i32 0 706 | store %swift.context* %14, %swift.context** %15, align 8 707 | %16 = getelementptr inbounds <{ %swift.context*, void (%swift.context*)*, i32 }>, <{ %swift.context*, void (%swift.context*)*, i32 }>* %12, i32 0, i32 1 708 | store void (%swift.context*)* bitcast (void (i8*, %swift.error*)* @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTATQ0_" to void (%swift.context*)*), void (%swift.context*)** %16, align 8 709 | musttail call swifttailcc void @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TR"(%swift.opaque* noalias nocapture %0, %swift.context* swiftasync %13, i8* %7, %swift.refcounted* %8) #5 710 | ret void 711 | } 712 | 713 | define internal swifttailcc void @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTATQ0_"(i8* swiftasync %0, %swift.error* swiftself %1) #0 { 714 | entryresume.0: 715 | %2 = bitcast i8* %0 to i8** 716 | %3 = load i8*, i8** %2, align 8 717 | %4 = call i8** @llvm.swift.async.context.addr() #5 718 | store i8* %3, i8** %4, align 8 719 | %async.ctx.frameptr1 = getelementptr inbounds i8, i8* %3, i32 24 720 | %FramePtr = bitcast i8* %async.ctx.frameptr1 to %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA.Frame"* 721 | %vFrame = bitcast %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA.Frame"* %FramePtr to i8* 722 | %5 = getelementptr inbounds %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA.Frame", %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA.Frame"* %FramePtr, i32 0, i32 0 723 | %.reload.addr = getelementptr inbounds %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA.Frame", %"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTA.Frame"* %FramePtr, i32 0, i32 1 724 | %.reload = load i8*, i8** %.reload.addr, align 8 725 | %6 = bitcast i8* %0 to i8** 726 | %7 = load i8*, i8** %6, align 8 727 | %8 = call i8** @llvm.swift.async.context.addr() #5 728 | store i8* %7, i8** %8, align 8 729 | %9 = bitcast i8* %7 to %swift.context* 730 | store %swift.context* %9, %swift.context** %5, align 8 731 | call swiftcc void @swift_task_dealloc(i8* %.reload) #5 732 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %.reload) 733 | %10 = load %swift.context*, %swift.context** %5, align 8 734 | %11 = bitcast %swift.context* %10 to <{ %swift.context*, void (%swift.context*)*, i32 }>* 735 | %12 = getelementptr inbounds <{ %swift.context*, void (%swift.context*)*, i32 }>, <{ %swift.context*, void (%swift.context*)*, i32 }>* %11, i32 0, i32 1 736 | %13 = load void (%swift.context*)*, void (%swift.context*)** %12, align 8 737 | %14 = bitcast void (%swift.context*)* %13 to void (%swift.context*, %swift.error*)* 738 | %15 = load %swift.context*, %swift.context** %5, align 8 739 | %16 = bitcast void (%swift.context*, %swift.error*)* %14 to i8* 740 | musttail call swifttailcc void %14(%swift.context* swiftasync %15, %swift.error* swiftself %1) #5 741 | ret void 742 | } 743 | 744 | ; Function Attrs: nounwind 745 | declare token @llvm.coro.id.async(i32, i32, i32, i8*) #5 746 | 747 | ; Function Attrs: nounwind 748 | declare i8* @llvm.coro.begin(token, i8* writeonly) #5 749 | 750 | ; Function Attrs: argmemonly nounwind 751 | declare swiftcc i8* @swift_task_alloc(i64) #3 752 | 753 | ; Function Attrs: nounwind 754 | declare i8* @llvm.coro.async.resume() #5 755 | 756 | ; Function Attrs: alwaysinline nounwind 757 | define linkonce_odr hidden i8* @__swift_async_resume_project_context(i8* %0) #6 { 758 | entry: 759 | %1 = bitcast i8* %0 to i8** 760 | %2 = load i8*, i8** %1, align 8 761 | %3 = call i8** @llvm.swift.async.context.addr() 762 | store i8* %2, i8** %3, align 8 763 | ret i8* %2 764 | } 765 | 766 | ; Function Attrs: nounwind readnone 767 | declare i8** @llvm.swift.async.context.addr() #7 768 | 769 | ; Function Attrs: nounwind 770 | define internal swifttailcc void @__swift_suspend_dispatch_4(i8* %0, %swift.opaque* %1, %swift.context* %2, i8* %3, %swift.refcounted* %4) #5 { 771 | entry: 772 | %5 = bitcast i8* %0 to void (%swift.opaque*, %swift.context*, i8*, %swift.refcounted*)* 773 | musttail call swifttailcc void %5(%swift.opaque* noalias nocapture %1, %swift.context* swiftasync %2, i8* %3, %swift.refcounted* %4) 774 | ret void 775 | } 776 | 777 | ; Function Attrs: nounwind 778 | declare { i8*, %swift.error* } @llvm.coro.suspend.async.sl_p0i8p0s_swift.errorss(i32, i8*, i8*, ...) #5 779 | 780 | ; Function Attrs: argmemonly nounwind 781 | declare swiftcc void @swift_task_dealloc(i8*) #3 782 | 783 | ; Function Attrs: argmemonly nofree nosync nounwind willreturn 784 | declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #4 785 | 786 | ; Function Attrs: nounwind 787 | define internal swifttailcc void @__swift_suspend_dispatch_2(i8* %0, %swift.context* %1, %swift.error* %2) #5 { 788 | entry: 789 | %3 = bitcast i8* %0 to void (%swift.context*, %swift.error*)* 790 | musttail call swifttailcc void %3(%swift.context* swiftasync %1, %swift.error* swiftself %2) 791 | ret void 792 | } 793 | 794 | ; Function Attrs: nounwind 795 | declare i1 @llvm.coro.end.async(i8*, i1, ...) #5 796 | 797 | define linkonce_odr hidden swiftcc %swift.refcounted* @"$sScTss5Error_pRs_rlE8priority9operationScTyxsAA_pGScPSg_xyYaYbKcntcfC"(%TScPSg* noalias nocapture %0, i8* %1, %swift.refcounted* %2, %swift.type* %Success) #0 { 798 | entry: 799 | %Success1 = alloca %swift.type*, align 8 800 | store %swift.type* %Success, %swift.type** %Success1, align 8 801 | %3 = call %swift.type* @__swift_instantiateConcreteTypeFromMangledName({ i32, i32 }* @"$sScPSgMD") #7 802 | %4 = bitcast %swift.type* %3 to i8*** 803 | %5 = getelementptr inbounds i8**, i8*** %4, i64 -1 804 | %.valueWitnesses = load i8**, i8*** %5, align 8, !invariant.load !41, !dereferenceable !42 805 | %6 = bitcast i8** %.valueWitnesses to %swift.vwtable* 806 | %7 = getelementptr inbounds %swift.vwtable, %swift.vwtable* %6, i32 0, i32 8 807 | %size = load i64, i64* %7, align 8, !invariant.load !41 808 | %8 = alloca i8, i64 %size, align 16 809 | call void @llvm.lifetime.start.p0i8(i64 -1, i8* %8) 810 | %9 = bitcast i8* %8 to %TScPSg* 811 | %10 = call %TScPSg* @"$sScPSgWOc"(%TScPSg* %0, %TScPSg* %9) 812 | %11 = bitcast %TScPSg* %9 to %swift.opaque* 813 | %12 = call swiftcc %swift.metadata_response @"$sScPMa"(i64 0) #7 814 | %13 = extractvalue %swift.metadata_response %12, 0 815 | %14 = bitcast %swift.type* %13 to i8*** 816 | %15 = getelementptr inbounds i8**, i8*** %14, i64 -1 817 | %.valueWitnesses2 = load i8**, i8*** %15, align 8, !invariant.load !41, !dereferenceable !42 818 | %16 = getelementptr inbounds i8*, i8** %.valueWitnesses2, i32 6 819 | %17 = load i8*, i8** %16, align 8, !invariant.load !41 820 | %getEnumTagSinglePayload = bitcast i8* %17 to i32 (%swift.opaque*, i32, %swift.type*)* 821 | %18 = call i32 %getEnumTagSinglePayload(%swift.opaque* noalias %11, i32 1, %swift.type* %13) #10 822 | %19 = icmp ne i32 %18, 1 823 | br i1 %19, label %23, label %21 824 | 825 | 20: ; No predecessors! 826 | unreachable 827 | 828 | 21: ; preds = %entry 829 | %22 = call %TScPSg* @"$sScPSgWOh"(%TScPSg* %9) 830 | br label %29 831 | 832 | 23: ; preds = %entry 833 | %24 = bitcast %TScPSg* %9 to %swift.opaque* 834 | %25 = call swiftcc i8 @"$sScP8rawValues5UInt8Vvg"(%swift.opaque* noalias nocapture swiftself %24) 835 | %26 = getelementptr inbounds i8*, i8** %.valueWitnesses2, i32 1 836 | %27 = load i8*, i8** %26, align 8, !invariant.load !41 837 | %destroy = bitcast i8* %27 to void (%swift.opaque*, %swift.type*)* 838 | call void %destroy(%swift.opaque* noalias %24, %swift.type* %13) #5 839 | %28 = zext i8 %25 to i64 840 | br label %29 841 | 842 | 29: ; preds = %23, %21 843 | %30 = phi i64 [ 0, %21 ], [ %28, %23 ] 844 | %31 = or i64 %30, 7168 845 | %32 = call %TScPSg* @"$sScPSgWOh"(%TScPSg* %0) 846 | %33 = call swiftcc %swift.async_task_and_context @swift_task_create(i64 %31, i64 0, %swift.type* %Success, i8* %1, %swift.refcounted* %2) #5 847 | %34 = extractvalue %swift.async_task_and_context %33, 0 848 | %35 = bitcast %swift.task* %34 to %swift.refcounted* 849 | %36 = extractvalue %swift.async_task_and_context %33, 1 850 | %37 = bitcast %swift.context* %36 to i8* 851 | %38 = bitcast %TScPSg* %9 to i8* 852 | call void @llvm.lifetime.end.p0i8(i64 -1, i8* %38) 853 | ret %swift.refcounted* %35 854 | } 855 | 856 | declare extern_weak void @"_swift_FORCE_LOAD_$_swiftFoundation"() 857 | 858 | declare extern_weak void @"_swift_FORCE_LOAD_$_swiftObjectiveC"() 859 | 860 | declare extern_weak void @"_swift_FORCE_LOAD_$_swiftDarwin"() 861 | 862 | declare extern_weak void @"_swift_FORCE_LOAD_$_swiftCoreFoundation"() 863 | 864 | declare extern_weak void @"_swift_FORCE_LOAD_$_swiftDispatch"() 865 | 866 | declare extern_weak void @"_swift_FORCE_LOAD_$_swiftXPC"() 867 | 868 | declare extern_weak void @"_swift_FORCE_LOAD_$_swiftIOKit"() 869 | 870 | declare extern_weak void @"_swift_FORCE_LOAD_$_swiftCoreGraphics"() 871 | 872 | ; Function Attrs: noinline nounwind 873 | define linkonce_odr hidden %TScPSg* @"$sScPSgWOc"(%TScPSg* %0, %TScPSg* %1) #8 { 874 | entry: 875 | %2 = bitcast %TScPSg* %1 to %swift.opaque* 876 | %3 = bitcast %TScPSg* %0 to %swift.opaque* 877 | %4 = bitcast %TScPSg* %0 to %swift.opaque* 878 | %5 = call swiftcc %swift.metadata_response @"$sScPMa"(i64 0) #7 879 | %6 = extractvalue %swift.metadata_response %5, 0 880 | %7 = bitcast %swift.type* %6 to i8*** 881 | %8 = getelementptr inbounds i8**, i8*** %7, i64 -1 882 | %.valueWitnesses = load i8**, i8*** %8, align 8, !invariant.load !41, !dereferenceable !42 883 | %9 = getelementptr inbounds i8*, i8** %.valueWitnesses, i32 6 884 | %10 = load i8*, i8** %9, align 8, !invariant.load !41 885 | %getEnumTagSinglePayload = bitcast i8* %10 to i32 (%swift.opaque*, i32, %swift.type*)* 886 | %11 = call i32 %getEnumTagSinglePayload(%swift.opaque* noalias %4, i32 1, %swift.type* %6) #10 887 | %12 = icmp eq i32 %11, 0 888 | br i1 %12, label %13, label %20 889 | 890 | 13: ; preds = %entry 891 | %14 = getelementptr inbounds i8*, i8** %.valueWitnesses, i32 2 892 | %15 = load i8*, i8** %14, align 8, !invariant.load !41 893 | %initializeWithCopy = bitcast i8* %15 to %swift.opaque* (%swift.opaque*, %swift.opaque*, %swift.type*)* 894 | %16 = call %swift.opaque* %initializeWithCopy(%swift.opaque* noalias %2, %swift.opaque* noalias %3, %swift.type* %6) #5 895 | %17 = bitcast %TScPSg* %1 to %swift.opaque* 896 | %18 = getelementptr inbounds i8*, i8** %.valueWitnesses, i32 7 897 | %19 = load i8*, i8** %18, align 8, !invariant.load !41 898 | %storeEnumTagSinglePayload = bitcast i8* %19 to void (%swift.opaque*, i32, i32, %swift.type*)* 899 | call void %storeEnumTagSinglePayload(%swift.opaque* noalias %17, i32 0, i32 1, %swift.type* %6) #5 900 | br label %28 901 | 902 | 20: ; preds = %entry 903 | %21 = call %swift.type* @__swift_instantiateConcreteTypeFromMangledName({ i32, i32 }* @"$sScPSgMD") #7 904 | %22 = bitcast %swift.type* %21 to i8*** 905 | %23 = getelementptr inbounds i8**, i8*** %22, i64 -1 906 | %.valueWitnesses1 = load i8**, i8*** %23, align 8, !invariant.load !41, !dereferenceable !42 907 | %24 = bitcast i8** %.valueWitnesses1 to %swift.vwtable* 908 | %25 = getelementptr inbounds %swift.vwtable, %swift.vwtable* %24, i32 0, i32 8 909 | %size = load i64, i64* %25, align 8, !invariant.load !41 910 | %26 = bitcast %TScPSg* %1 to i8* 911 | %27 = bitcast %TScPSg* %0 to i8* 912 | call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %26, i8* align 1 %27, i64 %size, i1 false) 913 | br label %28 914 | 915 | 28: ; preds = %20, %13 916 | ret %TScPSg* %1 917 | } 918 | 919 | ; Function Attrs: argmemonly nofree nosync nounwind willreturn 920 | declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #4 921 | 922 | ; Function Attrs: noinline nounwind 923 | define linkonce_odr hidden %TScPSg* @"$sScPSgWOh"(%TScPSg* %0) #8 { 924 | entry: 925 | %1 = bitcast %TScPSg* %0 to %swift.opaque* 926 | %2 = call swiftcc %swift.metadata_response @"$sScPMa"(i64 0) #7 927 | %3 = extractvalue %swift.metadata_response %2, 0 928 | %4 = bitcast %swift.type* %3 to i8*** 929 | %5 = getelementptr inbounds i8**, i8*** %4, i64 -1 930 | %.valueWitnesses = load i8**, i8*** %5, align 8, !invariant.load !41, !dereferenceable !42 931 | %6 = getelementptr inbounds i8*, i8** %.valueWitnesses, i32 6 932 | %7 = load i8*, i8** %6, align 8, !invariant.load !41 933 | %getEnumTagSinglePayload = bitcast i8* %7 to i32 (%swift.opaque*, i32, %swift.type*)* 934 | %8 = call i32 %getEnumTagSinglePayload(%swift.opaque* noalias %1, i32 1, %swift.type* %3) #10 935 | %9 = icmp eq i32 %8, 0 936 | br i1 %9, label %10, label %14 937 | 938 | 10: ; preds = %entry 939 | %11 = bitcast %TScPSg* %0 to %swift.opaque* 940 | %12 = getelementptr inbounds i8*, i8** %.valueWitnesses, i32 1 941 | %13 = load i8*, i8** %12, align 8, !invariant.load !41 942 | %destroy = bitcast i8* %13 to void (%swift.opaque*, %swift.type*)* 943 | call void %destroy(%swift.opaque* noalias %11, %swift.type* %3) #5 944 | br label %14 945 | 946 | 14: ; preds = %10, %entry 947 | ret %TScPSg* %0 948 | } 949 | 950 | ; Function Attrs: argmemonly nounwind 951 | declare swiftcc %swift.async_task_and_context @swift_task_create(i64, i64, %swift.type*, i8*, %swift.refcounted*) #3 952 | 953 | declare swiftcc i8 @"$sScP8rawValues5UInt8Vvg"(%swift.opaque* noalias nocapture swiftself) #0 954 | 955 | ; Function Attrs: nounwind 956 | define internal swifttailcc void @__swift_suspend_dispatch_2.1(i8* %0, %swift.context* %1, %swift.refcounted* %2) #5 { 957 | entry: 958 | %3 = bitcast i8* %0 to void (%swift.context*, %swift.refcounted*)* 959 | musttail call swifttailcc void %3(%swift.context* swiftasync %1, %swift.refcounted* swiftself %2) 960 | ret void 961 | } 962 | 963 | ; Function Attrs: nounwind 964 | define internal swifttailcc void @__swift_suspend_dispatch_2.2(i8* %0, %swift.context* %1, %swift.error* %2) #5 { 965 | entry: 966 | %3 = bitcast i8* %0 to void (%swift.context*, %swift.error*)* 967 | musttail call swifttailcc void %3(%swift.context* swiftasync %1, %swift.error* swiftself %2) 968 | ret void 969 | } 970 | 971 | ; Function Attrs: nounwind 972 | define internal swifttailcc void @__swift_suspend_dispatch_2.3(i8* %0, %swift.context* %1, %swift.error* %2) #5 { 973 | entry: 974 | %3 = bitcast i8* %0 to void (%swift.context*, %swift.error*)* 975 | musttail call swifttailcc void %3(%swift.context* swiftasync %1, %swift.error* swiftself %2) 976 | ret void 977 | } 978 | 979 | declare swiftcc %swift.metadata_response @"$s10Foundation3URLVMa"(i64) #0 980 | 981 | declare swiftcc { i64, %swift.bridge* } @"$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC"(i8*, i64, i1) #0 982 | 983 | declare swiftcc void @"$s10Foundation3URLV6stringACSgSSh_tcfC"(%swift.opaque* noalias nocapture sret(%swift.opaque), i64, %swift.bridge*) #0 984 | 985 | ; Function Attrs: nounwind 986 | declare void @swift_bridgeObjectRelease(%swift.bridge*) #5 987 | 988 | ; Function Attrs: noinline 989 | declare swiftcc void @"$ss17_assertionFailure__4file4line5flagss5NeverOs12StaticStringV_A2HSus6UInt32VtF"(i64, i64, i8, i64, i64, i8, i64, i64, i8, i64, i32) #9 990 | 991 | declare swiftcc void @"$s10Foundation3URLV5linesAA17AsyncLineSequenceVyAC0D5BytesVGvg"(%swift.opaque* noalias nocapture sret(%swift.opaque), %swift.opaque* noalias nocapture swiftself) #0 992 | 993 | declare swiftcc void @"$sSci17makeAsyncIterator0bC0QzyFTj"(%swift.opaque* noalias nocapture sret(%swift.opaque), %swift.opaque* noalias nocapture swiftself, %swift.type*, i8**) #0 994 | 995 | ; Function Attrs: noinline nounwind readnone 996 | define linkonce_odr hidden i8** @"$s10Foundation17AsyncLineSequenceVyAA3URLV0B5BytesVGACyxGSciAAWl"() #1 { 997 | entry: 998 | %0 = load i8**, i8*** @"$s10Foundation17AsyncLineSequenceVyAA3URLV0B5BytesVGACyxGSciAAWL", align 8 999 | %1 = icmp eq i8** %0, null 1000 | br i1 %1, label %cacheIsNull, label %cont 1001 | 1002 | cacheIsNull: ; preds = %entry 1003 | %2 = call %swift.type* @__swift_instantiateConcreteTypeFromMangledNameAbstract({ i32, i32 }* @"$s10Foundation17AsyncLineSequenceVyAA3URLV0B5BytesVGMD") #7 1004 | %3 = call i8** @swift_getWitnessTable(%swift.protocol_conformance_descriptor* @"$s10Foundation17AsyncLineSequenceVyxGSciAAMc", %swift.type* %2, i8*** undef) #5 1005 | store atomic i8** %3, i8*** @"$s10Foundation17AsyncLineSequenceVyAA3URLV0B5BytesVGACyxGSciAAWL" release, align 8 1006 | br label %cont 1007 | 1008 | cont: ; preds = %cacheIsNull, %entry 1009 | %4 = phi i8** [ %0, %entry ], [ %3, %cacheIsNull ] 1010 | ret i8** %4 1011 | } 1012 | 1013 | ; Function Attrs: noinline nounwind readnone 1014 | define linkonce_odr hidden %swift.type* @__swift_instantiateConcreteTypeFromMangledNameAbstract({ i32, i32 }* %0) #1 { 1015 | entry: 1016 | %1 = bitcast { i32, i32 }* %0 to i64* 1017 | %2 = load atomic i64, i64* %1 monotonic, align 8 1018 | %3 = icmp slt i64 %2, 0 1019 | %4 = call i1 @llvm.expect.i1(i1 %3, i1 false) 1020 | br i1 %4, label %8, label %5 1021 | 1022 | 5: ; preds = %8, %entry 1023 | %6 = phi i64 [ %2, %entry ], [ %17, %8 ] 1024 | %7 = inttoptr i64 %6 to %swift.type* 1025 | ret %swift.type* %7 1026 | 1027 | 8: ; preds = %entry 1028 | %9 = ashr i64 %2, 32 1029 | %10 = sub i64 0, %9 1030 | %11 = trunc i64 %2 to i32 1031 | %12 = sext i32 %11 to i64 1032 | %13 = ptrtoint { i32, i32 }* %0 to i64 1033 | %14 = add i64 %13, %12 1034 | %15 = inttoptr i64 %14 to i8* 1035 | %16 = call swiftcc %swift.type* @swift_getTypeByMangledNameInContextInMetadataState(i64 255, i8* %15, i64 %10, %swift.type_descriptor* null, i8** null) #7 1036 | %17 = ptrtoint %swift.type* %16 to i64 1037 | store atomic i64 %17, i64* %1 monotonic, align 8 1038 | br label %5 1039 | } 1040 | 1041 | ; Function Attrs: argmemonly nounwind 1042 | declare swiftcc %swift.type* @swift_getTypeByMangledNameInContextInMetadataState(i64, i8*, i64, %swift.type_descriptor*, i8**) #3 1043 | 1044 | ; Function Attrs: nounwind readonly 1045 | declare i8** @swift_getWitnessTable(%swift.protocol_conformance_descriptor*, %swift.type*, i8***) #10 1046 | 1047 | declare swifttailcc void @"$sScI4next7ElementQzSgyYaKFTj"(%TSq* noalias nocapture, %swift.context* swiftasync, %swift.opaque* nocapture swiftself, %swift.type*, i8**) #0 1048 | 1049 | ; Function Attrs: noinline nounwind readnone 1050 | define linkonce_odr hidden i8** @"$s10Foundation17AsyncLineSequenceV0B8IteratorVyAA3URLV0B5BytesV_GAEyx_GScIAAWl"() #1 { 1051 | entry: 1052 | %0 = load i8**, i8*** @"$s10Foundation17AsyncLineSequenceV0B8IteratorVyAA3URLV0B5BytesV_GAEyx_GScIAAWL", align 8 1053 | %1 = icmp eq i8** %0, null 1054 | br i1 %1, label %cacheIsNull, label %cont 1055 | 1056 | cacheIsNull: ; preds = %entry 1057 | %2 = call %swift.type* @__swift_instantiateConcreteTypeFromMangledNameAbstract({ i32, i32 }* @"$s10Foundation17AsyncLineSequenceV0B8IteratorVyAA3URLV0B5BytesV_GMD") #7 1058 | %3 = call i8** @swift_getWitnessTable(%swift.protocol_conformance_descriptor* @"$s10Foundation17AsyncLineSequenceV0B8IteratorVyx_GScIAAMc", %swift.type* %2, i8*** undef) #5 1059 | store atomic i8** %3, i8*** @"$s10Foundation17AsyncLineSequenceV0B8IteratorVyAA3URLV0B5BytesV_GAEyx_GScIAAWL" release, align 8 1060 | br label %cont 1061 | 1062 | cont: ; preds = %cacheIsNull, %entry 1063 | %4 = phi i8** [ %0, %entry ], [ %3, %cacheIsNull ] 1064 | ret i8** %4 1065 | } 1066 | 1067 | ; Function Attrs: nounwind 1068 | define internal swifttailcc void @__swift_suspend_dispatch_5(i8* %0, %TSq* %1, %swift.context* %2, %swift.opaque* %3, %swift.type* %4, i8** %5) #5 { 1069 | entry: 1070 | %6 = bitcast i8* %0 to void (%TSq*, %swift.context*, %swift.opaque*, %swift.type*, i8**)* 1071 | musttail call swifttailcc void %6(%TSq* noalias nocapture %1, %swift.context* swiftasync %2, %swift.opaque* nocapture swiftself %3, %swift.type* %4, i8** %5) 1072 | ret void 1073 | } 1074 | 1075 | ; Function Attrs: nounwind 1076 | define internal swifttailcc void @__swift_suspend_dispatch_2.4(i8* %0, %swift.context* %1, %swift.error* %2) #5 { 1077 | entry: 1078 | %3 = bitcast i8* %0 to void (%swift.context*, %swift.error*)* 1079 | musttail call swifttailcc void %3(%swift.context* swiftasync %1, %swift.error* swiftself %2) 1080 | ret void 1081 | } 1082 | 1083 | ; Function Attrs: nounwind 1084 | define internal swifttailcc void @__swift_suspend_dispatch_2.5(i8* %0, %swift.context* %1, %swift.error* %2) #5 { 1085 | entry: 1086 | %3 = bitcast i8* %0 to void (%swift.context*, %swift.error*)* 1087 | musttail call swifttailcc void %3(%swift.context* swiftasync %1, %swift.error* swiftself %2) 1088 | ret void 1089 | } 1090 | 1091 | ; Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly 1092 | declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #11 1093 | 1094 | declare swiftcc { %swift.bridge*, i8* } @"$ss27_allocateUninitializedArrayySayxG_BptBwlF"(i64, %swift.type*) #0 1095 | 1096 | ; Function Attrs: nounwind 1097 | declare %swift.bridge* @swift_bridgeObjectRetain(%swift.bridge* returned) #5 1098 | 1099 | declare swiftcc void @"$ss5print_9separator10terminatoryypd_S2StF"(%swift.bridge*, i64, %swift.bridge*, i64, %swift.bridge*) #0 1100 | 1101 | define linkonce_odr hidden swiftcc void @"$sSa12_endMutationyyF"(%swift.type* %"Array", %TSa* nocapture swiftself dereferenceable(8) %0) #0 { 1102 | entry: 1103 | %._buffer = getelementptr inbounds %TSa, %TSa* %0, i32 0, i32 0 1104 | %._buffer._storage = getelementptr inbounds %Ts12_ArrayBufferV, %Ts12_ArrayBufferV* %._buffer, i32 0, i32 0 1105 | %._buffer._storage.rawValue = getelementptr inbounds %Ts14_BridgeStorageV, %Ts14_BridgeStorageV* %._buffer._storage, i32 0, i32 0 1106 | %1 = load %swift.bridge*, %swift.bridge** %._buffer._storage.rawValue, align 8 1107 | %._buffer1 = getelementptr inbounds %TSa, %TSa* %0, i32 0, i32 0 1108 | %._buffer1._storage = getelementptr inbounds %Ts12_ArrayBufferV, %Ts12_ArrayBufferV* %._buffer1, i32 0, i32 0 1109 | %._buffer1._storage.rawValue = getelementptr inbounds %Ts14_BridgeStorageV, %Ts14_BridgeStorageV* %._buffer1._storage, i32 0, i32 0 1110 | store %swift.bridge* %1, %swift.bridge** %._buffer1._storage.rawValue, align 8 1111 | ret void 1112 | } 1113 | 1114 | declare swiftcc %swift.metadata_response @"$sSaMa"(i64, %swift.type*) #0 1115 | 1116 | ; Function Attrs: alwaysinline 1117 | define private void @coro.devirt.trigger(i8* %0) #12 { 1118 | entry: 1119 | ret void 1120 | } 1121 | 1122 | ; Function Attrs: argmemonly nounwind readonly 1123 | declare i8* @llvm.coro.subfn.addr(i8* nocapture readonly, i8) #13 1124 | 1125 | attributes #0 = { "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "probe-stack"="__chkstk_darwin" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } 1126 | attributes #1 = { noinline nounwind readnone "frame-pointer"="none" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "probe-stack"="__chkstk_darwin" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } 1127 | attributes #2 = { nofree nosync nounwind readnone willreturn } 1128 | attributes #3 = { argmemonly nounwind } 1129 | attributes #4 = { argmemonly nofree nosync nounwind willreturn } 1130 | attributes #5 = { nounwind } 1131 | attributes #6 = { alwaysinline nounwind "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "probe-stack"="__chkstk_darwin" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } 1132 | attributes #7 = { nounwind readnone } 1133 | attributes #8 = { noinline nounwind "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "probe-stack"="__chkstk_darwin" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } 1134 | attributes #9 = { noinline "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "probe-stack"="__chkstk_darwin" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } 1135 | attributes #10 = { nounwind readonly } 1136 | attributes #11 = { argmemonly nofree nosync nounwind willreturn writeonly } 1137 | attributes #12 = { alwaysinline } 1138 | attributes #13 = { argmemonly nounwind readonly } 1139 | 1140 | !llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8} 1141 | !swift.module.flags = !{!9} 1142 | !llvm.asan.globals = !{!10, !11, !12, !13, !14, !15, !16, !17, !18, !19} 1143 | !llvm.linker.options = !{!20, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37, !38, !39, !40} 1144 | 1145 | !0 = !{i32 2, !"SDK Version", [3 x i32] [i32 12, i32 1, i32 0]} 1146 | !1 = !{i32 1, !"Objective-C Version", i32 2} 1147 | !2 = !{i32 1, !"Objective-C Image Info Version", i32 0} 1148 | !3 = !{i32 1, !"Objective-C Image Info Section", !"__DATA,__objc_imageinfo,regular,no_dead_strip"} 1149 | !4 = !{i32 4, !"Objective-C Garbage Collection", i32 84215552} 1150 | !5 = !{i32 1, !"Objective-C Class Properties", i32 64} 1151 | !6 = !{i32 1, !"wchar_size", i32 4} 1152 | !7 = !{i32 7, !"PIC Level", i32 2} 1153 | !8 = !{i32 1, !"Swift Version", i32 7} 1154 | !9 = !{!"standard-library", i1 false} 1155 | !10 = !{<{ [5 x i8], i8 }>* @"symbolic ScPSg", null, null, i1 false, i1 true} 1156 | !11 = !{<{ i8, i32, [10 x i8], i8 }>* @"symbolic ______pIeghHzo_ s5ErrorP", null, null, i1 false, i1 true} 1157 | !12 = !{{ i32, i32, i32, i32 }* @"\01l__swift5_reflection_descriptor", null, null, i1 false, i1 true} 1158 | !13 = !{%swift.async_func_pointer* @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTATu", null, null, i1 false, i1 true} 1159 | !14 = !{%swift.async_func_pointer* @"$ss5Error_pIeghHzo_ytsAA_pIeghHrzo_TRTu", null, null, i1 false, i1 true} 1160 | !15 = !{%swift.async_func_pointer* @"$s4mainAAyyFyyYaYbKcfU_Tu", null, null, i1 false, i1 true} 1161 | !16 = !{<{ i8, i32, [1 x i8], i8, i32, [1 x i8], i8 }>* @"symbolic _____y_____G 10Foundation17AsyncLineSequenceV AA3URLV0B5BytesV", null, null, i1 false, i1 true} 1162 | !17 = !{<{ i8, i32, [1 x i8], i8, i32, [2 x i8], i8 }>* @"symbolic _____y______G 10Foundation17AsyncLineSequenceV0B8IteratorV AA3URLV0B5BytesV", null, null, i1 false, i1 true} 1163 | !18 = !{<{ i8, i32, [2 x i8], i8 }>* @"symbolic _____Sg 10Foundation3URLV", null, null, i1 false, i1 true} 1164 | !19 = !{[12 x i8*]* @llvm.used, null, null, i1 false, i1 true} 1165 | !20 = !{!"-lswiftFoundation"} 1166 | !21 = !{!"-lswiftCore"} 1167 | !22 = !{!"-lswift_Concurrency"} 1168 | !23 = !{!"-lswiftObjectiveC"} 1169 | !24 = !{!"-lswiftDarwin"} 1170 | !25 = !{!"-framework", !"Foundation"} 1171 | !26 = !{!"-lswiftCoreFoundation"} 1172 | !27 = !{!"-framework", !"CoreFoundation"} 1173 | !28 = !{!"-lswiftDispatch"} 1174 | !29 = !{!"-framework", !"Combine"} 1175 | !30 = !{!"-framework", !"CoreServices"} 1176 | !31 = !{!"-framework", !"Security"} 1177 | !32 = !{!"-lswiftXPC"} 1178 | !33 = !{!"-framework", !"CFNetwork"} 1179 | !34 = !{!"-framework", !"DiskArbitration"} 1180 | !35 = !{!"-lswiftIOKit"} 1181 | !36 = !{!"-framework", !"IOKit"} 1182 | !37 = !{!"-lswiftCoreGraphics"} 1183 | !38 = !{!"-framework", !"CoreGraphics"} 1184 | !39 = !{!"-lswiftSwiftOnoneSupport"} 1185 | !40 = !{!"-lobjc"} 1186 | !41 = !{} 1187 | !42 = !{i64 88} 1188 | -------------------------------------------------------------------------------- /test/swift/main.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | func main() { 4 | Task { 5 | let url = URL(string: "https://www.donnywals.com")! 6 | for try await line in url.lines { 7 | print(line) 8 | } 9 | 10 | }} 11 | --------------------------------------------------------------------------------