; ModuleID = 'extern-c.cpp' target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.10.0" %"class.std::__1::basic_string" = type { %"class.std::__1::__compressed_pair" } %"class.std::__1::__compressed_pair" = type { %"class.std::__1::__libcpp_compressed_pair_imp" } %"class.std::__1::__libcpp_compressed_pair_imp" = type { %"struct.std::__1::basic_string, std::__1::allocator >::__rep" } %"struct.std::__1::basic_string, std::__1::allocator >::__rep" = type { %union.anon } %union.anon = type { %"struct.std::__1::basic_string, std::__1::allocator >::__long" } %"struct.std::__1::basic_string, std::__1::allocator >::__long" = type { i64, i64, i8* } %"class.std::__1::basic_ostream" = type { i32 (...)**, %"class.std::__1::basic_ios" } %"class.std::__1::basic_ios" = type { %"class.std::__1::ios_base", %"class.std::__1::basic_ostream"*, i32 } %"class.std::__1::ios_base" = type { i32 (...)**, i32, i64, i64, i32, i32, i8*, i8*, void (i32, %"class.std::__1::ios_base"*, i32)**, i32*, i64, i64, i64*, i64, i64, i8**, i64, i64 } %"class.std::__1::locale::id" = type { %"struct.std::__1::once_flag", i32 } %"struct.std::__1::once_flag" = type { i64 } %"class.std::__1::locale" = type { %"class.std::__1::locale::__imp"* } %"class.std::__1::locale::__imp" = type opaque %"class.std::__1::locale::facet" = type { %"class.std::__1::__shared_count" } %"class.std::__1::__shared_count" = type { i32 (...)**, i64 } %"class.std::__1::ctype" = type { %"class.std::__1::locale::facet", i32*, i8 } %"class.std::__1::basic_ostream >::sentry" = type { i8, %"class.std::__1::basic_ostream"* } %"class.std::__1::basic_streambuf" = type { i32 (...)**, %"class.std::__1::locale", i8*, i8*, i8*, i8*, i8*, i8* } %"struct.std::__1::basic_string, std::__1::allocator >::__short" = type { %union.anon.0, [23 x i8] } %union.anon.0 = type { i8 } @regularVar = global i32 0, align 4 @regularConst = constant i32 7, align 4 @_ZL29implicitlyStaticConstWithInit = internal global %"class.std::__1::basic_string" zeroinitializer, align 8 @.str = private unnamed_addr constant [12 x i8] c"some string\00", align 1 @__dso_handle = external unnamed_addr global i8 @implicitlyStaticWithInit = global %"class.std::__1::basic_string" zeroinitializer, align 8 @.str2 = private unnamed_addr constant [18 x i8] c"some other string\00", align 1 @_ZNSt3__14coutE = external global %"class.std::__1::basic_ostream" @.str3 = private unnamed_addr constant [14 x i8] c"regularMethod\00", align 1 @externVar = global i32 0, align 4 @.str4 = private unnamed_addr constant [13 x i8] c"externMethod\00", align 1 @.str5 = private unnamed_addr constant [3 x i8] c"x=\00", align 1 @_ZNSt3__15ctypeIcE2idE = external global %"class.std::__1::locale::id" @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] define internal fastcc void @__cxx_global_var_init() section "__TEXT,__StaticInit,regular,pure_instructions" { tail call void @_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(%"class.std::__1::basic_string"* @_ZL29implicitlyStaticConstWithInit, i8* getelementptr inbounds ([12 x i8]* @.str, i64 0, i64 0), i64 11) %1 = tail call i32 @__cxa_atexit(void (i8*)* bitcast (void (%"class.std::__1::basic_string"*)* @_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev to void (i8*)*), i8* bitcast (%"class.std::__1::basic_string"* @_ZL29implicitlyStaticConstWithInit to i8*), i8* @__dso_handle) #1 ret void } ; Function Attrs: nounwind declare void @_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev(%"class.std::__1::basic_string"*) #0 ; Function Attrs: nounwind declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*) #1 define internal fastcc void @__cxx_global_var_init1() section "__TEXT,__StaticInit,regular,pure_instructions" { tail call void @_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(%"class.std::__1::basic_string"* @implicitlyStaticWithInit, i8* getelementptr inbounds ([18 x i8]* @.str2, i64 0, i64 0), i64 17) %1 = tail call i32 @__cxa_atexit(void (i8*)* bitcast (void (%"class.std::__1::basic_string"*)* @_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev to void (i8*)*), i8* bitcast (%"class.std::__1::basic_string"* @implicitlyStaticWithInit to i8*), i8* @__dso_handle) #1 ret void } ; Function Attrs: noinline uwtable define void @_Z13regularMethodv() #2 { %1 = alloca %"class.std::__1::locale", align 8 %2 = call %"class.std::__1::basic_ostream"* @_ZNSt3__1lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(%"class.std::__1::basic_ostream"* @_ZNSt3__14coutE, i8* getelementptr inbounds ([14 x i8]* @.str3, i64 0, i64 0)) %3 = bitcast %"class.std::__1::basic_ostream"* %2 to i8** %4 = load i8** %3, align 8, !tbaa !1 %5 = getelementptr i8* %4, i64 -24 %6 = bitcast i8* %5 to i64* %7 = load i64* %6, align 8 %8 = bitcast %"class.std::__1::basic_ostream"* %2 to i8* %9 = getelementptr inbounds i8* %8, i64 %7 %10 = bitcast %"class.std::__1::locale"* %1 to i8* call void @llvm.lifetime.start(i64 8, i8* %10) %11 = bitcast i8* %9 to %"class.std::__1::ios_base"* call void @_ZNKSt3__18ios_base6getlocEv(%"class.std::__1::locale"* sret %1, %"class.std::__1::ios_base"* %11) %12 = invoke %"class.std::__1::locale::facet"* @_ZNKSt3__16locale9use_facetERNS0_2idE(%"class.std::__1::locale"* %1, %"class.std::__1::locale::id"* @_ZNSt3__15ctypeIcE2idE) to label %13 unwind label %20 ;