Skip to content

Instantly share code, notes, and snippets.

@pnkfelix
Created June 24, 2019 14:40
Show Gist options
  • Save pnkfelix/8df4508294069f1e5963c5fac7f8f825 to your computer and use it in GitHub Desktop.
Save pnkfelix/8df4508294069f1e5963c5fac7f8f825 to your computer and use it in GitHub Desktop.
; ModuleID = 'narrowed_48310.7rcbfp3g-cgu.0'
source_filename = "narrowed_48310.7rcbfp3g-cgu.0"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%Bar = type {}
%"unwind::libunwind::_Unwind_Exception" = type { [0 x i64], i64, [0 x i64], void (i32, %"unwind::libunwind::_Unwind_Exception"*)*, [0 x i64], [6 x i64], [0 x i64] }
%"unwind::libunwind::_Unwind_Context" = type { [0 x i8] }
@vtable.0 = private unnamed_addr constant { void (i8**)*, i64, i64, i32 (i8**)*, i32 (i8**)*, i32 (i8**)* } { void (i8**)* @_ZN4core3ptr18real_drop_in_place17hf1585915bccdce38E, i64 8, i64 8, i32 (i8**)* @"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h1bfb4bdbe0294225E", i32 (i8**)* @"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h1bfb4bdbe0294225E", i32 (i8**)* @"_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h9db209afdd733109E" }, align 8
@vtable.1 = private unnamed_addr constant { void (%Bar*)*, i64, i64, void (%Bar*)* } { void (%Bar*)* @_ZN4core3ptr18real_drop_in_place17hf8d9784fffbe065eE, i64 0, i64 1, void (%Bar*)* @"_ZN59_$LT$narrowed_48310..Bar$u20$as$u20$narrowed_48310..Foo$GT$6borrow17hdd495dfcc8d99ffcE" }, align 8
; std::rt::lang_start
; Function Attrs: nonlazybind uwtable
define hidden i64 @_ZN3std2rt10lang_start17h1705df231abfd42fE(void ()* nonnull %main, i64 %argc, i8** %argv) unnamed_addr #0 {
start:
%_7 = alloca i8*, align 8
%0 = bitcast i8** %_7 to void ()**
store void ()* %main, void ()** %0, align 8
%1 = bitcast i8** %_7 to {}*
; call std::rt::lang_start_internal
%2 = call i64 @_ZN3std2rt19lang_start_internal17h2cdd60760f380778E({}* nonnull align 1 %1, [3 x i64]* noalias readonly align 8 dereferenceable(24) bitcast ({ void (i8**)*, i64, i64, i32 (i8**)*, i32 (i8**)*, i32 (i8**)* }* @vtable.0 to [3 x i64]*), i64 %argc, i8** %argv)
br label %bb1
bb1: ; preds = %start
ret i64 %2
}
; std::rt::lang_start::{{closure}}
; Function Attrs: nonlazybind uwtable
define internal i32 @"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h1bfb4bdbe0294225E"(i8** noalias readonly align 8 dereferenceable(8) %arg0) unnamed_addr #0 {
start:
%0 = bitcast i8** %arg0 to void ()**
%1 = load void ()*, void ()** %0, align 8, !nonnull !2
call void %1()
br label %bb1
bb1: ; preds = %start
; call <() as std::process::Termination>::report
%2 = call i32 @"_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h549e3ca7a4f25194E"()
br label %bb2
bb2: ; preds = %bb1
ret i32 %2
}
; std::sys::unix::process::process_common::ExitCode::as_i32
; Function Attrs: inlinehint nonlazybind uwtable
define internal i32 @_ZN3std3sys4unix7process14process_common8ExitCode6as_i3217h113b444ecefc4831E(i8* noalias readonly align 1 dereferenceable(1) %self) unnamed_addr #1 {
start:
%0 = load i8, i8* %self, align 1
%1 = zext i8 %0 to i32
ret i32 %1
}
; core::num::NonZeroUsize::new_unchecked
; Function Attrs: inlinehint nonlazybind uwtable
define internal i64 @_ZN4core3num12NonZeroUsize13new_unchecked17h8b65c19f2a0e8010E(i64 %n) unnamed_addr #1 {
start:
%_0 = alloca i64, align 8
store i64 %n, i64* %_0, align 8
%0 = load i64, i64* %_0, align 8, !range !3
ret i64 %0
}
; core::num::NonZeroUsize::get
; Function Attrs: inlinehint nonlazybind uwtable
define internal i64 @_ZN4core3num12NonZeroUsize3get17h60b2516ec0f0586eE(i64 %self) unnamed_addr #1 {
start:
ret i64 %self
}
; core::ops::function::FnOnce::call_once{{vtable.shim}}
; Function Attrs: nonlazybind uwtable
define internal i32 @"_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h9db209afdd733109E"(i8** %arg0) unnamed_addr #0 {
start:
%arg1 = alloca {}, align 1
%0 = load i8*, i8** %arg0, align 8, !nonnull !2
; call core::ops::function::FnOnce::call_once
%1 = call i32 @_ZN4core3ops8function6FnOnce9call_once17h555938cad92f1e52E(i8* nonnull %0)
br label %bb1
bb1: ; preds = %start
ret i32 %1
}
; core::ops::function::FnOnce::call_once
; Function Attrs: nonlazybind uwtable
define internal i32 @_ZN4core3ops8function6FnOnce9call_once17h555938cad92f1e52E(i8* nonnull) unnamed_addr #0 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
start:
%personalityslot = alloca { i8*, i32 }, align 8
%arg1 = alloca {}, align 1
%arg0 = alloca i8*, align 8
store i8* %0, i8** %arg0, align 8
; invoke std::rt::lang_start::{{closure}}
%1 = invoke i32 @"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h1bfb4bdbe0294225E"(i8** align 8 dereferenceable(8) %arg0)
to label %bb1 unwind label %cleanup
bb1: ; preds = %start
br label %bb2
bb2: ; preds = %bb1
ret i32 %1
bb3: ; preds = %cleanup
br label %bb4
bb4: ; preds = %bb3
%2 = bitcast { i8*, i32 }* %personalityslot to i8**
%3 = load i8*, i8** %2, align 8
%4 = getelementptr inbounds { i8*, i32 }, { i8*, i32 }* %personalityslot, i32 0, i32 1
%5 = load i32, i32* %4, align 8
%6 = insertvalue { i8*, i32 } undef, i8* %3, 0
%7 = insertvalue { i8*, i32 } %6, i32 %5, 1
resume { i8*, i32 } %7
cleanup: ; preds = %start
%8 = landingpad { i8*, i32 }
cleanup
%9 = extractvalue { i8*, i32 } %8, 0
%10 = extractvalue { i8*, i32 } %8, 1
%11 = getelementptr inbounds { i8*, i32 }, { i8*, i32 }* %personalityslot, i32 0, i32 0
store i8* %9, i8** %11, align 8
%12 = getelementptr inbounds { i8*, i32 }, { i8*, i32 }* %personalityslot, i32 0, i32 1
store i32 %10, i32* %12, align 8
br label %bb3
}
; core::ptr::real_drop_in_place
; Function Attrs: nonlazybind uwtable
define internal void @_ZN4core3ptr18real_drop_in_place17h18f3e3e59b750d0cE({ {}*, [3 x i64]* }* align 8 dereferenceable(16)) unnamed_addr #0 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
start:
%personalityslot = alloca { i8*, i32 }, align 8
%arg0 = alloca { {}*, [3 x i64]* }*, align 8
store { {}*, [3 x i64]* }* %0, { {}*, [3 x i64]* }** %arg0, align 8
%1 = load { {}*, [3 x i64]* }*, { {}*, [3 x i64]* }** %arg0, align 8, !nonnull !2
%2 = getelementptr inbounds { {}*, [3 x i64]* }, { {}*, [3 x i64]* }* %1, i32 0, i32 0
%3 = load {}*, {}** %2, align 8, !nonnull !2
%4 = getelementptr inbounds { {}*, [3 x i64]* }, { {}*, [3 x i64]* }* %1, i32 0, i32 1
%5 = load [3 x i64]*, [3 x i64]** %4, align 8, !nonnull !2
%6 = bitcast [3 x i64]* %5 to void ({}*)**
%7 = getelementptr inbounds void ({}*)*, void ({}*)** %6, i64 0
%8 = load void ({}*)*, void ({}*)** %7, align 8, !invariant.load !2, !nonnull !2
invoke void %8({}* align 1 %3)
to label %bb3 unwind label %cleanup
bb1: ; preds = %bb3
ret void
bb2: ; preds = %bb4
%9 = bitcast { i8*, i32 }* %personalityslot to i8**
%10 = load i8*, i8** %9, align 8
%11 = getelementptr inbounds { i8*, i32 }, { i8*, i32 }* %personalityslot, i32 0, i32 1
%12 = load i32, i32* %11, align 8
%13 = insertvalue { i8*, i32 } undef, i8* %10, 0
%14 = insertvalue { i8*, i32 } %13, i32 %12, 1
resume { i8*, i32 } %14
bb3: ; preds = %start
%15 = load { {}*, [3 x i64]* }*, { {}*, [3 x i64]* }** %arg0, align 8, !nonnull !2
%16 = bitcast { {}*, [3 x i64]* }* %15 to { i8*, i64* }*
%17 = getelementptr inbounds { i8*, i64* }, { i8*, i64* }* %16, i32 0, i32 0
%18 = load i8*, i8** %17, align 8, !nonnull !2
%19 = getelementptr inbounds { i8*, i64* }, { i8*, i64* }* %16, i32 0, i32 1
%20 = load i64*, i64** %19, align 8, !nonnull !2
; call alloc::alloc::box_free
call void @_ZN5alloc5alloc8box_free17h3373bb87d0149726E(i8* nonnull %18, i64* noalias readonly align 8 dereferenceable(24) %20)
br label %bb1
bb4: ; preds = %cleanup
%21 = load { {}*, [3 x i64]* }*, { {}*, [3 x i64]* }** %arg0, align 8, !nonnull !2
%22 = bitcast { {}*, [3 x i64]* }* %21 to { i8*, i64* }*
%23 = getelementptr inbounds { i8*, i64* }, { i8*, i64* }* %22, i32 0, i32 0
%24 = load i8*, i8** %23, align 8, !nonnull !2
%25 = getelementptr inbounds { i8*, i64* }, { i8*, i64* }* %22, i32 0, i32 1
%26 = load i64*, i64** %25, align 8, !nonnull !2
; call alloc::alloc::box_free
call void @_ZN5alloc5alloc8box_free17h3373bb87d0149726E(i8* nonnull %24, i64* noalias readonly align 8 dereferenceable(24) %26) #6
br label %bb2
cleanup: ; preds = %start
%27 = landingpad { i8*, i32 }
cleanup
%28 = extractvalue { i8*, i32 } %27, 0
%29 = extractvalue { i8*, i32 } %27, 1
%30 = getelementptr inbounds { i8*, i32 }, { i8*, i32 }* %personalityslot, i32 0, i32 0
store i8* %28, i8** %30, align 8
%31 = getelementptr inbounds { i8*, i32 }, { i8*, i32 }* %personalityslot, i32 0, i32 1
store i32 %29, i32* %31, align 8
br label %bb4
}
; core::ptr::real_drop_in_place
; Function Attrs: nonlazybind uwtable
define internal void @_ZN4core3ptr18real_drop_in_place17habccb1e2c1468ad2E({}* nonnull align 1 %arg0.0, [3 x i64]* noalias readonly align 8 dereferenceable(24) %arg0.1) unnamed_addr #0 {
start:
%0 = bitcast [3 x i64]* %arg0.1 to void ({}*)**
%1 = getelementptr inbounds void ({}*)*, void ({}*)** %0, i64 0
%2 = load void ({}*)*, void ({}*)** %1, align 8, !invariant.load !2, !nonnull !2
call void %2({}* align 1 %arg0.0)
br label %bb1
bb1: ; preds = %start
ret void
}
; core::ptr::real_drop_in_place
; Function Attrs: nonlazybind uwtable
define internal void @_ZN4core3ptr18real_drop_in_place17hf1585915bccdce38E(i8** align 8 dereferenceable(8) %arg0) unnamed_addr #0 {
start:
ret void
}
; core::ptr::real_drop_in_place
; Function Attrs: nonlazybind uwtable
define internal void @_ZN4core3ptr18real_drop_in_place17hf8d9784fffbe065eE(%Bar* nonnull align 1 %arg0) unnamed_addr #0 {
start:
ret void
}
; core::ptr::<impl *mut T>::is_null
; Function Attrs: inlinehint nonlazybind uwtable
define internal zeroext i1 @"_ZN4core3ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h7b0c03af10fbb124E"(i8* %self) unnamed_addr #1 {
start:
; call core::ptr::null_mut
%0 = call i8* @_ZN4core3ptr8null_mut17h282973cedc8c0518E()
br label %bb1
bb1: ; preds = %start
%1 = icmp eq i8* %self, %0
ret i1 %1
}
; core::ptr::unique::Unique<T>::as_ptr
; Function Attrs: inlinehint nonlazybind uwtable
define internal { {}*, [3 x i64]* } @"_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h95b6aa7a99129e14E"(i8* nonnull %self.0, i64* noalias readonly align 8 dereferenceable(24) %self.1) unnamed_addr #1 {
start:
%0 = bitcast i8* %self.0 to {}*
%1 = bitcast i64* %self.1 to [3 x i64]*
%2 = insertvalue { {}*, [3 x i64]* } undef, {}* %0, 0
%3 = insertvalue { {}*, [3 x i64]* } %2, [3 x i64]* %1, 1
ret { {}*, [3 x i64]* } %3
}
; core::ptr::null_mut
; Function Attrs: inlinehint nonlazybind uwtable
define internal i8* @_ZN4core3ptr8null_mut17h282973cedc8c0518E() unnamed_addr #1 {
start:
ret i8* null
}
; core::alloc::Layout::from_size_align_unchecked
; Function Attrs: inlinehint nonlazybind uwtable
define internal { i64, i64 } @_ZN4core5alloc6Layout25from_size_align_unchecked17h3758c70b6b82a095E(i64 %size, i64 %align) unnamed_addr #1 {
start:
%_0 = alloca { i64, i64 }, align 8
; call core::num::NonZeroUsize::new_unchecked
%0 = call i64 @_ZN4core3num12NonZeroUsize13new_unchecked17h8b65c19f2a0e8010E(i64 %align), !range !3
br label %bb1
bb1: ; preds = %start
%1 = bitcast { i64, i64 }* %_0 to i64*
store i64 %size, i64* %1, align 8
%2 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %_0, i32 0, i32 1
store i64 %0, i64* %2, align 8
%3 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %_0, i32 0, i32 0
%4 = load i64, i64* %3, align 8
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %_0, i32 0, i32 1
%6 = load i64, i64* %5, align 8, !range !3
%7 = insertvalue { i64, i64 } undef, i64 %4, 0
%8 = insertvalue { i64, i64 } %7, i64 %6, 1
ret { i64, i64 } %8
}
; core::alloc::Layout::size
; Function Attrs: inlinehint nonlazybind uwtable
define internal i64 @_ZN4core5alloc6Layout4size17he29f49c9810eeb77E({ i64, i64 }* noalias readonly align 8 dereferenceable(16) %self) unnamed_addr #1 {
start:
%0 = bitcast { i64, i64 }* %self to i64*
%1 = load i64, i64* %0, align 8
ret i64 %1
}
; core::alloc::Layout::align
; Function Attrs: inlinehint nonlazybind uwtable
define internal i64 @_ZN4core5alloc6Layout5align17h4a44bea579b30ac1E({ i64, i64 }* noalias readonly align 8 dereferenceable(16) %self) unnamed_addr #1 {
start:
%0 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %self, i32 0, i32 1
%1 = load i64, i64* %0, align 8, !range !3
; call core::num::NonZeroUsize::get
%2 = call i64 @_ZN4core3num12NonZeroUsize3get17h60b2516ec0f0586eE(i64 %1)
br label %bb1
bb1: ; preds = %start
ret i64 %2
}
; <() as std::process::Termination>::report
; Function Attrs: inlinehint nonlazybind uwtable
define internal i32 @"_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h549e3ca7a4f25194E"() unnamed_addr #1 {
start:
; call <std::process::ExitCode as std::process::Termination>::report
%0 = call i32 @"_ZN68_$LT$std..process..ExitCode$u20$as$u20$std..process..Termination$GT$6report17h360b1d93d01e75d4E"(i8 0)
br label %bb1
bb1: ; preds = %start
ret i32 %0
}
; alloc::alloc::exchange_malloc
; Function Attrs: inlinehint nonlazybind uwtable
define internal i8* @_ZN5alloc5alloc15exchange_malloc17h5adbf930b98ac4d0E(i64 %size, i64 %align) unnamed_addr #1 {
start:
%_0 = alloca i8*, align 8
%0 = icmp eq i64 %size, 0
br i1 %0, label %bb2, label %bb1
bb1: ; preds = %start
; call core::alloc::Layout::from_size_align_unchecked
%1 = call { i64, i64 } @_ZN4core5alloc6Layout25from_size_align_unchecked17h3758c70b6b82a095E(i64 %size, i64 %align)
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
br label %bb3
bb2: ; preds = %start
%4 = inttoptr i64 %align to i8*
store i8* %4, i8** %_0, align 8
br label %bb8
bb3: ; preds = %bb1
; call alloc::alloc::alloc
%5 = call i8* @_ZN5alloc5alloc5alloc17h516ab402b7247149E(i64 %2, i64 %3)
br label %bb4
bb4: ; preds = %bb3
; call core::ptr::<impl *mut T>::is_null
%6 = call zeroext i1 @"_ZN4core3ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h7b0c03af10fbb124E"(i8* %5)
br label %bb5
bb5: ; preds = %bb4
%7 = xor i1 %6, true
br i1 %7, label %bb7, label %bb6
bb6: ; preds = %bb5
; call alloc::alloc::handle_alloc_error
call void @_ZN5alloc5alloc18handle_alloc_error17he23e40b0bf3b895fE(i64 %2, i64 %3)
unreachable
bb7: ; preds = %bb5
store i8* %5, i8** %_0, align 8
br label %bb8
bb8: ; preds = %bb7, %bb2
%8 = load i8*, i8** %_0, align 8
ret i8* %8
}
; alloc::alloc::alloc
; Function Attrs: inlinehint nonlazybind uwtable
define internal i8* @_ZN5alloc5alloc5alloc17h516ab402b7247149E(i64, i64) unnamed_addr #1 {
start:
%layout = alloca { i64, i64 }, align 8
%2 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %layout, i32 0, i32 0
store i64 %0, i64* %2, align 8
%3 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %layout, i32 0, i32 1
store i64 %1, i64* %3, align 8
; call core::alloc::Layout::size
%4 = call i64 @_ZN4core5alloc6Layout4size17he29f49c9810eeb77E({ i64, i64 }* noalias readonly align 8 dereferenceable(16) %layout)
br label %bb1
bb1: ; preds = %start
; call core::alloc::Layout::align
%5 = call i64 @_ZN4core5alloc6Layout5align17h4a44bea579b30ac1E({ i64, i64 }* noalias readonly align 8 dereferenceable(16) %layout)
br label %bb2
bb2: ; preds = %bb1
%6 = call i8* @__rust_alloc(i64 %4, i64 %5)
br label %bb3
bb3: ; preds = %bb2
ret i8* %6
}
; alloc::alloc::dealloc
; Function Attrs: inlinehint nonlazybind uwtable
define internal void @_ZN5alloc5alloc7dealloc17h5d9d559336082297E(i8* %ptr, i64, i64) unnamed_addr #1 {
start:
%layout = alloca { i64, i64 }, align 8
%2 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %layout, i32 0, i32 0
store i64 %0, i64* %2, align 8
%3 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %layout, i32 0, i32 1
store i64 %1, i64* %3, align 8
; call core::alloc::Layout::size
%4 = call i64 @_ZN4core5alloc6Layout4size17he29f49c9810eeb77E({ i64, i64 }* noalias readonly align 8 dereferenceable(16) %layout)
br label %bb1
bb1: ; preds = %start
; call core::alloc::Layout::align
%5 = call i64 @_ZN4core5alloc6Layout5align17h4a44bea579b30ac1E({ i64, i64 }* noalias readonly align 8 dereferenceable(16) %layout)
br label %bb2
bb2: ; preds = %bb1
call void @__rust_dealloc(i8* %ptr, i64 %4, i64 %5)
br label %bb3
bb3: ; preds = %bb2
ret void
}
; alloc::alloc::box_free
; Function Attrs: inlinehint nonlazybind uwtable
define internal void @_ZN5alloc5alloc8box_free17h3373bb87d0149726E(i8* nonnull %ptr.0, i64* noalias readonly align 8 dereferenceable(24) %ptr.1) unnamed_addr #1 {
start:
%tmp_ret1 = alloca i64, align 8
%tmp_ret = alloca i64, align 8
; call core::ptr::unique::Unique<T>::as_ptr
%0 = call { {}*, [3 x i64]* } @"_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h95b6aa7a99129e14E"(i8* nonnull %ptr.0, i64* noalias readonly align 8 dereferenceable(24) %ptr.1)
%1 = extractvalue { {}*, [3 x i64]* } %0, 0
%2 = extractvalue { {}*, [3 x i64]* } %0, 1
br label %bb1
bb1: ; preds = %start
%3 = bitcast [3 x i64]* %2 to i64*
%4 = getelementptr inbounds i64, i64* %3, i64 1
%5 = load i64, i64* %4, align 8, !invariant.load !2
%6 = bitcast [3 x i64]* %2 to i64*
%7 = getelementptr inbounds i64, i64* %6, i64 2
%8 = load i64, i64* %7, align 8, !invariant.load !2
store i64 %5, i64* %tmp_ret, align 8
%9 = load i64, i64* %tmp_ret, align 8
br label %bb2
bb2: ; preds = %bb1
%10 = bitcast [3 x i64]* %2 to i64*
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11, align 8, !invariant.load !2
%13 = bitcast [3 x i64]* %2 to i64*
%14 = getelementptr inbounds i64, i64* %13, i64 2
%15 = load i64, i64* %14, align 8, !invariant.load !2
store i64 %15, i64* %tmp_ret1, align 8
%16 = load i64, i64* %tmp_ret1, align 8
br label %bb3
bb3: ; preds = %bb2
%17 = icmp ne i64 %9, 0
br i1 %17, label %bb4, label %bb7
bb4: ; preds = %bb3
; call core::alloc::Layout::from_size_align_unchecked
%18 = call { i64, i64 } @_ZN4core5alloc6Layout25from_size_align_unchecked17h3758c70b6b82a095E(i64 %9, i64 %16)
%19 = extractvalue { i64, i64 } %18, 0
%20 = extractvalue { i64, i64 } %18, 1
br label %bb5
bb5: ; preds = %bb4
%21 = bitcast {}* %1 to i8*
; call alloc::alloc::dealloc
call void @_ZN5alloc5alloc7dealloc17h5d9d559336082297E(i8* %21, i64 %19, i64 %20)
br label %bb6
bb6: ; preds = %bb5
br label %bb7
bb7: ; preds = %bb6, %bb3
ret void
}
; alloc::boxed::Box<T>::new
; Function Attrs: alwaysinline nonlazybind uwtable
define internal noalias nonnull align 1 %Bar* @"_ZN5alloc5boxed12Box$LT$T$GT$3new17hfce076f088fa6082E"() unnamed_addr #2 {
start:
; call alloc::alloc::exchange_malloc
%0 = call i8* @_ZN5alloc5alloc15exchange_malloc17h5adbf930b98ac4d0E(i64 0, i64 1)
%1 = bitcast i8* %0 to %Bar*
ret %Bar* %1
}
; <std::process::ExitCode as std::process::Termination>::report
; Function Attrs: inlinehint nonlazybind uwtable
define internal i32 @"_ZN68_$LT$std..process..ExitCode$u20$as$u20$std..process..Termination$GT$6report17h360b1d93d01e75d4E"(i8) unnamed_addr #1 {
start:
%self = alloca i8, align 1
store i8 %0, i8* %self, align 1
; call std::sys::unix::process::process_common::ExitCode::as_i32
%1 = call i32 @_ZN3std3sys4unix7process14process_common8ExitCode6as_i3217h113b444ecefc4831E(i8* noalias readonly align 1 dereferenceable(1) %self)
br label %bb1
bb1: ; preds = %start
ret i32 %1
}
; <narrowed_48310::Bar as narrowed_48310::Foo>::borrow
; Function Attrs: nounwind nonlazybind uwtable
define internal void @"_ZN59_$LT$narrowed_48310..Bar$u20$as$u20$narrowed_48310..Foo$GT$6borrow17hdd495dfcc8d99ffcE"(%Bar* noalias nonnull readonly align 1 %self) unnamed_addr #3 {
start:
ret void
}
; narrowed_48310::main
; Function Attrs: nonlazybind uwtable
define internal void @_ZN14narrowed_483104main17h87595477e683006cE() unnamed_addr #0 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
start:
%personalityslot = alloca { i8*, i32 }, align 8
%_3 = alloca %Bar, align 1
%foo = alloca { {}*, [3 x i64]* }, align 8
; call alloc::boxed::Box<T>::new
%0 = call noalias nonnull align 1 %Bar* @"_ZN5alloc5boxed12Box$LT$T$GT$3new17hfce076f088fa6082E"()
br label %bb2
bb1: ; preds = %bb4
%1 = bitcast { i8*, i32 }* %personalityslot to i8**
%2 = load i8*, i8** %1, align 8
%3 = getelementptr inbounds { i8*, i32 }, { i8*, i32 }* %personalityslot, i32 0, i32 1
%4 = load i32, i32* %3, align 8
%5 = insertvalue { i8*, i32 } undef, i8* %2, 0
%6 = insertvalue { i8*, i32 } %5, i32 %4, 1
resume { i8*, i32 } %6
bb2: ; preds = %start
%7 = bitcast %Bar* %0 to {}*
%8 = getelementptr inbounds { {}*, [3 x i64]* }, { {}*, [3 x i64]* }* %foo, i32 0, i32 0
store {}* %7, {}** %8, align 8
%9 = getelementptr inbounds { {}*, [3 x i64]* }, { {}*, [3 x i64]* }* %foo, i32 0, i32 1
store [3 x i64]* bitcast ({ void (%Bar*)*, i64, i64, void (%Bar*)* }* @vtable.1 to [3 x i64]*), [3 x i64]** %9, align 8
%10 = getelementptr inbounds { {}*, [3 x i64]* }, { {}*, [3 x i64]* }* %foo, i32 0, i32 0
%11 = load {}*, {}** %10, align 8, !nonnull !2
%12 = getelementptr inbounds { {}*, [3 x i64]* }, { {}*, [3 x i64]* }* %foo, i32 0, i32 1
%13 = load [3 x i64]*, [3 x i64]** %12, align 8, !nonnull !2
%14 = bitcast [3 x i64]* %13 to void ({}*)**
%15 = getelementptr inbounds void ({}*)*, void ({}*)** %14, i64 3
%16 = load void ({}*)*, void ({}*)** %15, align 8, !invariant.load !2, !nonnull !2
invoke void %16({}* align 1 %11)
to label %bb3 unwind label %cleanup
bb3: ; preds = %bb2
; call core::ptr::real_drop_in_place
call void @_ZN4core3ptr18real_drop_in_place17h18f3e3e59b750d0cE({ {}*, [3 x i64]* }* align 8 dereferenceable(16) %foo)
br label %bb5
bb4: ; preds = %cleanup
; call core::ptr::real_drop_in_place
call void @_ZN4core3ptr18real_drop_in_place17h18f3e3e59b750d0cE({ {}*, [3 x i64]* }* align 8 dereferenceable(16) %foo) #6
br label %bb1
bb5: ; preds = %bb3
ret void
cleanup: ; preds = %bb2
%17 = landingpad { i8*, i32 }
cleanup
%18 = extractvalue { i8*, i32 } %17, 0
%19 = extractvalue { i8*, i32 } %17, 1
%20 = getelementptr inbounds { i8*, i32 }, { i8*, i32 }* %personalityslot, i32 0, i32 0
store i8* %18, i8** %20, align 8
%21 = getelementptr inbounds { i8*, i32 }, { i8*, i32 }* %personalityslot, i32 0, i32 1
store i32 %19, i32* %21, align 8
br label %bb4
}
; std::rt::lang_start_internal
; Function Attrs: nonlazybind uwtable
declare i64 @_ZN3std2rt19lang_start_internal17h2cdd60760f380778E({}* nonnull align 1, [3 x i64]* noalias readonly align 8 dereferenceable(24), i64, i8**) unnamed_addr #0
; Function Attrs: nounwind nonlazybind uwtable
declare i32 @rust_eh_personality(i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*) unnamed_addr #3
; alloc::alloc::handle_alloc_error
; Function Attrs: noreturn nounwind nonlazybind uwtable
declare void @_ZN5alloc5alloc18handle_alloc_error17he23e40b0bf3b895fE(i64, i64) unnamed_addr #4
; Function Attrs: nounwind nonlazybind uwtable
declare noalias i8* @__rust_alloc(i64, i64) unnamed_addr #3
; Function Attrs: nounwind nonlazybind uwtable
declare void @__rust_dealloc(i8*, i64, i64) unnamed_addr #3
; Function Attrs: nonlazybind
define i32 @main(i32, i8**) unnamed_addr #5 {
top:
%2 = sext i32 %0 to i64
; call std::rt::lang_start
%3 = call i64 @_ZN3std2rt10lang_start17h1705df231abfd42fE(void ()* @_ZN14narrowed_483104main17h87595477e683006cE, i64 %2, i8** %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
attributes #0 = { nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #1 = { inlinehint nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #2 = { alwaysinline nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #3 = { nounwind nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #4 = { noreturn nounwind nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #5 = { nonlazybind "target-cpu"="x86-64" }
attributes #6 = { noinline }
!llvm.module.flags = !{!0, !1}
!0 = !{i32 7, !"PIE Level", i32 2}
!1 = !{i32 2, !"RtLibUseGOT", i32 1}
!2 = !{}
!3 = !{i64 1, i64 0}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment