Skip to content

Instantly share code, notes, and snippets.

@comex
Created May 5, 2021 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save comex/490edb708682370dcc40c059b761811f to your computer and use it in GitHub Desktop.
Save comex/490edb708682370dcc40c059b761811f to your computer and use it in GitHub Desktop.
; ModuleID = 'main.7rcbfp3g-cgu.0'
source_filename = "main.7rcbfp3g-cgu.0"
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.7.0"
%Reader = type { [0 x i64], { i8*, i64 }, [0 x i64], i64, [0 x i64] }
%"fmt::Arguments" = type { [0 x i64], { [0 x { [0 x i8]*, i64 }]*, i64 }, [0 x i64], { i64*, i64 }, [0 x i64], { [0 x { i8*, i64* }]*, i64 }, [0 x i64] }
define internal fastcc { i8*, i64 } @_ZN3lib5Slice10into_value17hd068c2a4c36b2989E(i8* nonnull align 1 %0, i64 %1) unnamed_addr #6 {
%3 = insertvalue { i8*, i64 } undef, i8* %0, 0
%4 = insertvalue { i8*, i64 } %3, i64 %1, 1
ret { i8*, i64 } %4
}
@alloc6 = private unnamed_addr constant <{ [43 x i8] }> <{ [43 x i8] c"called `Option::unwrap()` on a `None` value" }>, align 1
@alloc7 = private unnamed_addr constant <{ [7 x i8] }> <{ [7 x i8] c"main.rs" }>, align 1
@alloc8 = private unnamed_addr constant <{ i8*, [16 x i8] }> <{ i8* getelementptr inbounds (<{ [7 x i8] }>, <{ [7 x i8] }>* @alloc7, i32 0, i32 0, i32 0), [16 x i8] c"\07\00\00\00\00\00\00\00\1C\00\00\00%\00\00\00" }>, align 8
@alloc2 = private unnamed_addr constant <{ [1 x i8] }> zeroinitializer, align 1
@anon.8e7f8663c95d25ee62087ffb0566f556.10 = private unnamed_addr constant <{ [0 x i8] }> zeroinitializer, align 8
; Function Attrs: nofree noinline norecurse nounwind uwtable willreturn
define internal fastcc { i8*, i64 } @_ZN4main22read_single_byte_value17h6a8946d030728332E(%Reader* nocapture align 8 dereferenceable(24) %input) unnamed_addr #0 {
start:
%0 = getelementptr inbounds %Reader, %Reader* %input, i64 0, i32 3
store i64 1, i64* %0, align 8
%1 = bitcast %Reader* %input to i8**
%2 = load i8*, i8** %1, align 8, !nonnull !6
%3 = getelementptr inbounds %Reader, %Reader* %input, i64 0, i32 1, i32 1
%4 = load i64, i64* %3, align 8
%5 = insertvalue { i8*, i64 } undef, i8* %2, 0
%6 = insertvalue { i8*, i64 } %5, i64 %4, 1
ret { i8*, i64 } %6
}
; Function Attrs: nofree nounwind uwtable
define dso_local zeroext i1 @main(i64 %_argc, i8** nocapture readnone %_argv) unnamed_addr #1 {
start:
%input = alloca %Reader, align 8
%0 = bitcast %Reader* %input to i8*
call void @llvm.lifetime.start.p0i8(i64 24, i8* nonnull %0)
%1 = bitcast %Reader* %input to i8**
store i8* getelementptr inbounds (<{ [1 x i8] }>, <{ [1 x i8] }>* @alloc2, i64 0, i32 0, i64 0), i8** %1, align 8
%2 = getelementptr inbounds %Reader, %Reader* %input, i64 0, i32 1, i32 1
%3 = bitcast i64* %2 to <2 x i64>*
store <2 x i64> <i64 1, i64 0>, <2 x i64>* %3, align 8
tail call void @llvm.experimental.noalias.scope.decl(metadata !9)
%4 = call fastcc { i8*, i64 } @_ZN4main22read_single_byte_value17h6a8946d030728332E(%Reader* nonnull align 8 dereferenceable(24) %input) #7
%value.0.i = extractvalue { i8*, i64 } %4, 0
%value.1.i = extractvalue { i8*, i64 } %4, 1
%5 = tail call fastcc { i8*, i64 } @_ZN3lib5Slice10into_value17hd068c2a4c36b2989E(i8* noalias nonnull readonly align 1 %value.0.i, i64 %value.1.i) #7, !noalias !9
%_7.0.i = extractvalue { i8*, i64 } %5, 0
%_7.1.i = extractvalue { i8*, i64 } %5, 1
%_3.not.i.i.i = icmp eq i64 %_7.1.i, 0
%6 = icmp eq i8* %_7.0.i, null
%7 = or i1 %_3.not.i.i.i, %6
br i1 %7, label %bb1.i.i, label %_ZN4main4read17h93c8d2eed9df0265E.exit
bb1.i.i: ; preds = %start
tail call fastcc void @_ZN4core9panicking5panic17he65ad651ff2e7951E() #7
unreachable
_ZN4main4read17h93c8d2eed9df0265E.exit: ; preds = %start
%8 = getelementptr inbounds %Reader, %Reader* %input, i64 0, i32 3
%val.i = load i64, i64* %8, align 8, !alias.scope !9
%9 = icmp eq i64 %val.i, 1
call void @llvm.lifetime.end.p0i8(i64 24, i8* nonnull %0)
ret i1 %9
}
; Function Attrs: argmemonly nofree nosync nounwind willreturn
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #2
; Function Attrs: argmemonly nofree nosync nounwind willreturn
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #2
; Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn
declare void @llvm.experimental.noalias.scope.decl(metadata) #3
; Function Attrs: cold noinline noreturn nounwind readnone uwtable
declare fastcc void @_ZN4core9panicking5panic17he65ad651ff2e7951E()
attributes #0 = { nofree noinline norecurse nounwind uwtable willreturn "frame-pointer"="all" "probe-stack"="inline-asm" "target-cpu"="core2" }
attributes #1 = { nofree nounwind uwtable "frame-pointer"="all" "probe-stack"="inline-asm" "target-cpu"="core2" }
attributes #2 = { argmemonly nofree nosync nounwind willreturn }
attributes #3 = { inaccessiblememonly nofree nosync nounwind willreturn }
attributes #4 = { cold noinline noreturn nounwind readnone uwtable "frame-pointer"="all" "probe-stack"="inline-asm" "target-cpu"="core2" }
attributes #5 = { inlinehint norecurse nounwind readnone uwtable willreturn "frame-pointer"="all" "probe-stack"="inline-asm" "target-cpu"="core2" }
attributes #6 = { norecurse nounwind readnone uwtable willreturn "frame-pointer"="all" "probe-stack"="inline-asm" "target-cpu"="core2" }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.dbg.cu = !{!4, !7}
!0 = !{i32 7, !"PIC Level", i32 2}
!1 = !{i32 7, !"PIE Level", i32 2}
!2 = !{i32 2, !"Dwarf Version", i32 2}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = distinct !DICompileUnit(language: DW_LANG_Rust, file: !5, producer: "clang LLVM (rustc version 1.53.0-nightly (42816d61e 2021-04-24))", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !6)
!5 = !DIFile(filename: "library/core/src/lib.rs/@/core.1c3m0c0r-cgu.0", directory: "/rustc/42816d61ead7e46d462df997958ccfd514f8c21c/")
!6 = !{}
!7 = distinct !DICompileUnit(language: DW_LANG_Rust, file: !8, producer: "clang LLVM (rustc version 1.53.0-nightly (42816d61e 2021-04-24))", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !6)
!8 = !DIFile(filename: "library/rustc-std-workspace-core/lib.rs/@/rustc_std_workspace_core.8e1ik1sj-cgu.0", directory: "/rustc/42816d61ead7e46d462df997958ccfd514f8c21c/")
!9 = !{!10}
!10 = distinct !{!10, !11, !"_ZN4main4read17h93c8d2eed9df0265E: %input"}
!11 = distinct !{!11, !"_ZN4main4read17h93c8d2eed9df0265E"}
!12 = distinct !DISubprogram(name: "panic", linkageName: "_ZN4core9panicking5panic17he65ad651ff2e7951E", scope: !14, file: !13, line: 39, type: !16, scopeLine: 39, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !4, templateParams: !6, retainedNodes: !6)
!13 = !DIFile(filename: "library/core/src/panicking.rs", directory: "/rustc/42816d61ead7e46d462df997958ccfd514f8c21c/", checksumkind: CSK_MD5, checksum: "89a0bd991f9229715b611d3140e6238a")
!14 = !DINamespace(name: "panicking", scope: !15)
!15 = !DINamespace(name: "core", scope: null)
!16 = !DISubroutineType(types: !6)
!17 = !DILocation(line: 50, column: 15, scope: !12)
!18 = !DILocation(line: 50, column: 39, scope: !12)
!19 = !DILocation(line: 316, column: 9, scope: !20, inlinedAt: !24)
!20 = distinct !DISubprogram(name: "new_v1", linkageName: "_ZN4core3fmt9Arguments6new_v117hfb24cbf9ee5be7fdE", scope: !22, file: !21, line: 315, type: !16, scopeLine: 315, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !4, templateParams: !6, retainedNodes: !6)
!21 = !DIFile(filename: "library/core/src/fmt/mod.rs", directory: "/rustc/42816d61ead7e46d462df997958ccfd514f8c21c/", checksumkind: CSK_MD5, checksum: "9c9213b7718caa3e78ca3ee2b7c95039")
!22 = !DINamespace(name: "Arguments", scope: !23)
!23 = !DINamespace(name: "fmt", scope: !15)
!24 = distinct !DILocation(line: 50, column: 15, scope: !12)
!25 = !{!26}
!26 = distinct !{!26, !27, !"_ZN4core3fmt9Arguments6new_v117hfb24cbf9ee5be7fdE: argument 0"}
!27 = distinct !{!27, !"_ZN4core3fmt9Arguments6new_v117hfb24cbf9ee5be7fdE"}
!28 = !{!29, !30}
!29 = distinct !{!29, !27, !"_ZN4core3fmt9Arguments6new_v117hfb24cbf9ee5be7fdE: argument 1"}
!30 = distinct !{!30, !27, !"_ZN4core3fmt9Arguments6new_v117hfb24cbf9ee5be7fdE: argument 2"}
!31 = !DILocation(line: 50, column: 5, scope: !12)
!32 = distinct !DISubprogram(name: "panic_fmt", linkageName: "_ZN4core9panicking9panic_fmt17h6b7498085d32aaeeE", scope: !14, file: !13, line: 77, type: !16, scopeLine: 77, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !4, templateParams: !6, retainedNodes: !6)
!33 = !DILocation(line: 92, column: 14, scope: !32)
!34 = distinct !DISubprogram(name: "drop_in_place<&core::iter::adapters::copied::Copied<core::slice::iter::Iter<u8>>>", linkageName: "_ZN4core3ptr102drop_in_place$LT$$RF$core..iter..adapters..copied..Copied$LT$core..slice..iter..Iter$LT$u8$GT$$GT$$GT$17hed2dfd6f2c85e579E", scope: !36, file: !35, line: 192, type: !16, scopeLine: 192, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !4, templateParams: !6, retainedNodes: !6)
!35 = !DIFile(filename: "library/core/src/ptr/mod.rs", directory: "/rustc/42816d61ead7e46d462df997958ccfd514f8c21c/", checksumkind: CSK_MD5, checksum: "3e716868cb8c74f325240010534df065")
!36 = !DINamespace(name: "ptr", scope: !15)
!37 = !DILocation(line: 192, column: 1, scope: !34)
!38 = distinct !DISubprogram(name: "type_id<core::panic::{{impl}}::internal_constructor::NoPayload>", linkageName: "_ZN36_$LT$T$u20$as$u20$core..any..Any$GT$7type_id17h2f0bd2a66df2fbe5E", scope: !40, file: !39, line: 132, type: !16, scopeLine: 132, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !4, templateParams: !6, retainedNodes: !6)
!39 = !DIFile(filename: "library/core/src/any.rs", directory: "/rustc/42816d61ead7e46d462df997958ccfd514f8c21c/", checksumkind: CSK_MD5, checksum: "1af0bffed4f7a1d049ce027a21458f5b")
!40 = !DINamespace(name: "{{impl}}", scope: !41)
!41 = !DINamespace(name: "any", scope: !15)
!42 = !DILocation(line: 134, column: 6, scope: !38)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment