; ModuleID = 'type_error.cpp'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-unknown-linux-gnu"

%0 = type { i8*, i8* }
%1 = type { i8*, i8*, i8* }
%2 = type { i32, void ()* }
%class.UES = type { [8 x i8] }
%class.vBase1 = type { i32 (...)** }
%class.vBase2 = type { i32 (...)** }

@u = global %class.UES zeroinitializer, align 8   ; <%class.UES*> [#uses=1]
@_ZTV3UES = weak_odr constant [3 x i8*] [i8* null, i8* bitcast (%1* @_ZTI3UES to i8*), i8* bitcast (void (%class.vBase1*)* @_ZN6vBase23DEFEv to i8*)] ; <[3 x i8*]*> [#uses=1]
@_ZTVN10__cxxabiv120__si_class_type_infoE = external global i8* ; <i8**> [#uses=1]
@_ZTS3UES = weak_odr constant [5 x i8] c"3UES\00" ; <[5 x i8]*> [#uses=1]
@_ZTVN10__cxxabiv117__class_type_infoE = external global i8* ; <i8**> [#uses=1]
@_ZTS6vBase2 = weak_odr constant [8 x i8] c"6vBase2\00" ; <[8 x i8]*> [#uses=1]
@_ZTI6vBase2 = weak_odr constant %0 { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([8 x i8]* @_ZTS6vBase2, i32 0, i32 0) } ; <%0*> [#uses=1]
@_ZTI3UES = weak_odr constant %1 { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([5 x i8]* @_ZTS3UES, i32 0, i32 0), i8* bitcast (%0* @_ZTI6vBase2 to i8*) } ; <%1*> [#uses=1]
@_ZTV6vBase1 = weak_odr constant [3 x i8*] [i8* null, i8* bitcast (%0* @_ZTI6vBase1 to i8*), i8* bitcast (void (%class.vBase1*)* @_ZN6vBase13ABCEv to i8*)] ; <[3 x i8*]*> [#uses=1]
@_ZTS6vBase1 = weak_odr constant [8 x i8] c"6vBase1\00" ; <[8 x i8]*> [#uses=1]
@_ZTI6vBase1 = weak_odr constant %0 { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([8 x i8]* @_ZTS6vBase1, i32 0, i32 0) } ; <%0*> [#uses=1]
@_ZTV6vBase2 = weak_odr constant [3 x i8*] [i8* null, i8* bitcast (%0* @_ZTI6vBase2 to i8*), i8* bitcast (void (%class.vBase1*)* @_ZN6vBase23DEFEv to i8*)] ; <[3 x i8*]*> [#uses=1]
@llvm.global_ctors = appending global [1 x %2] [%2 { i32 65535, void ()* @_GLOBAL__I_a }] ; <[1 x %2]*> [#uses=0]

define internal void @__cxx_global_var_init() {
entry:
  call void @_ZN3UESC1Ev(%class.UES* @u)
  ret void
}

define linkonce_odr void @_ZN3UESC1Ev(%class.UES* %this) align 2 {
entry:
  %this.addr = alloca %class.UES*, align 8        ; <%class.UES**> [#uses=2]
  store %class.UES* %this, %class.UES** %this.addr
  call void @llvm.dbg.declare(metadata !{%class.UES** %this.addr}, metadata !26), !dbg !30
  %this1 = load %class.UES** %this.addr           ; <%class.UES*> [#uses=1]
  call void @_ZN3UESC2Ev(%class.UES* %this1)
  ret void, !dbg !31
}

declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone

define linkonce_odr void @_ZN3UESC2Ev(%class.UES* %this) align 2 {
entry:
  %this.addr = alloca %class.UES*, align 8        ; <%class.UES**> [#uses=2]
  %vb1 = alloca %class.vBase1, align 8            ; <%class.vBase1*> [#uses=1]
  store %class.UES* %this, %class.UES** %this.addr
  call void @llvm.dbg.declare(metadata !{%class.UES** %this.addr}, metadata !32), !dbg !34
  %this1 = load %class.UES** %this.addr           ; <%class.UES*> [#uses=4]
  %0 = bitcast %class.UES* %this1 to %class.vBase1* ; <%class.vBase1*> [#uses=1]
  call void @_ZN6vBase2C2Ev(%class.vBase1* %0)
  %1 = bitcast %class.UES* %this1 to i8***        ; <i8***> [#uses=1]
  store i8** getelementptr inbounds ([3 x i8*]* @_ZTV3UES, i64 0, i64 2), i8*** %1
  call void @llvm.dbg.declare(metadata !{%class.vBase1* %vb1}, metadata !35), !dbg !45
  call void @_ZN6vBase1C1Ev(%class.vBase1* %vb1), !dbg !46
  %2 = bitcast %class.UES* %this1 to %class.vBase1*, !dbg !47 ; <%class.vBase1*> [#uses=1]
  call void @_ZN3UES4TestEP6vBase2(%class.UES* %this1, %class.vBase1* %2), !dbg !47
  ret void, !dbg !48
}

define linkonce_odr void @_ZN6vBase2C2Ev(%class.vBase1* %this) inlinehint align 2 {
entry:
  %this.addr = alloca %class.vBase1*, align 8     ; <%class.vBase1**> [#uses=2]
  store %class.vBase1* %this, %class.vBase1** %this.addr
  call void @llvm.dbg.declare(metadata !{%class.vBase1** %this.addr}, metadata !49), !dbg !51
  %this1 = load %class.vBase1** %this.addr        ; <%class.vBase1*> [#uses=1]
  %0 = bitcast %class.vBase1* %this1 to i8***     ; <i8***> [#uses=1]
  store i8** getelementptr inbounds ([3 x i8*]* @_ZTV6vBase2, i64 0, i64 2), i8*** %0
  ret void, !dbg !51
}

define linkonce_odr void @_ZN6vBase1C1Ev(%class.vBase1* %this) inlinehint align 2 {
entry:
  %this.addr = alloca %class.vBase1*, align 8     ; <%class.vBase1**> [#uses=2]
  store %class.vBase1* %this, %class.vBase1** %this.addr
  call void @llvm.dbg.declare(metadata !{%class.vBase1** %this.addr}, metadata !52), !dbg !54
  %this1 = load %class.vBase1** %this.addr        ; <%class.vBase1*> [#uses=1]
  call void @_ZN6vBase1C2Ev(%class.vBase1* %this1)
  ret void, !dbg !54
}

define linkonce_odr void @_ZN3UES4TestEP6vBase2(%class.UES* %this, %class.vBase1* %ptr) align 2 {
entry:
  %this.addr = alloca %class.UES*, align 8        ; <%class.UES**> [#uses=2]
  %ptr.addr = alloca %class.vBase1*, align 8      ; <%class.vBase1**> [#uses=1]
  store %class.UES* %this, %class.UES** %this.addr
  call void @llvm.dbg.declare(metadata !{%class.UES** %this.addr}, metadata !55), !dbg !56
  store %class.vBase1* %ptr, %class.vBase1** %ptr.addr
  call void @llvm.dbg.declare(metadata !{%class.vBase1** %ptr.addr}, metadata !57), !dbg !58
  %this1 = load %class.UES** %this.addr           ; <%class.UES*> [#uses=0]
  ret void, !dbg !59
}

define linkonce_odr void @_ZN6vBase23DEFEv(%class.vBase1* %this) align 2 {
entry:
  %this.addr = alloca %class.vBase1*, align 8     ; <%class.vBase1**> [#uses=2]
  store %class.vBase1* %this, %class.vBase1** %this.addr
  call void @llvm.dbg.declare(metadata !{%class.vBase1** %this.addr}, metadata !61), !dbg !62
  %this1 = load %class.vBase1** %this.addr        ; <%class.vBase1*> [#uses=0]
  ret void, !dbg !63
}

define linkonce_odr void @_ZN6vBase1C2Ev(%class.vBase1* %this) inlinehint align 2 {
entry:
  %this.addr = alloca %class.vBase1*, align 8     ; <%class.vBase1**> [#uses=2]
  store %class.vBase1* %this, %class.vBase1** %this.addr
  call void @llvm.dbg.declare(metadata !{%class.vBase1** %this.addr}, metadata !65), !dbg !67
  %this1 = load %class.vBase1** %this.addr        ; <%class.vBase1*> [#uses=1]
  %0 = bitcast %class.vBase1* %this1 to i8***     ; <i8***> [#uses=1]
  store i8** getelementptr inbounds ([3 x i8*]* @_ZTV6vBase1, i64 0, i64 2), i8*** %0
  ret void, !dbg !67
}

define linkonce_odr void @_ZN6vBase13ABCEv(%class.vBase1* %this) align 2 {
entry:
  %this.addr = alloca %class.vBase1*, align 8     ; <%class.vBase1**> [#uses=2]
  store %class.vBase1* %this, %class.vBase1** %this.addr
  call void @llvm.dbg.declare(metadata !{%class.vBase1** %this.addr}, metadata !68), !dbg !69
  %this1 = load %class.vBase1** %this.addr        ; <%class.vBase1*> [#uses=0]
  ret void, !dbg !70
}

define internal void @_GLOBAL__I_a() {
entry:
  call void @__cxx_global_var_init()
  ret void
}

!llvm.dbg.gv = !{!0}

!0 = metadata !{i32 524340, i32 0, metadata !1, metadata !"u", metadata !"u", metadata !"u", metadata !1, i32 26, metadata !3, i1 false, i1 true, %class.UES* @u} ; [ DW_TAG_variable ]
!1 = metadata !{i32 524329, metadata !"small.cpp", metadata !"/home/aherz/svn/personal/NSN/llvm/beans_sim/in", metadata !2} ; [ DW_TAG_file_type ]
!2 = metadata !{i32 524305, i32 0, i32 4, metadata !"small.cpp", metadata !".", metadata !"clang 2.0", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ]
!3 = metadata !{i32 524290, metadata !1, metadata !"UES", metadata !1, i32 13, i64 64, i64 64, i64 0, i32 0, null, metadata !4, i32 0, metadata !6} ; [ DW_TAG_class_type ]
!4 = metadata !{metadata !5, metadata !19, metadata !23}
!5 = metadata !{i32 524316, metadata !3, metadata !"", metadata !1, i32 0, i64 0, i64 0, i64 0, i32 0, metadata !6} ; [ DW_TAG_inheritance ]
!6 = metadata !{i32 524290, metadata !1, metadata !"vBase2", metadata !1, i32 7, i64 64, i64 64, i64 0, i32 0, null, metadata !7, i32 0, metadata !6} ; [ DW_TAG_class_type ]
!7 = metadata !{metadata !8, metadata !14, metadata !18}
!8 = metadata !{i32 524301, metadata !1, metadata !"_vptr$vBase2", metadata !1, i32 0, i64 64, i64 0, i64 0, i32 0, metadata !9} ; [ DW_TAG_member ]
!9 = metadata !{i32 524303, metadata !1, metadata !"", metadata !1, i32 0, i64 64, i64 0, i64 0, i32 0, metadata !10} ; [ DW_TAG_pointer_type ]
!10 = metadata !{i32 524303, metadata !1, metadata !"__vtbl_ptr_type", metadata !1, i32 0, i64 64, i64 0, i64 0, i32 0, metadata !11} ; [ DW_TAG_pointer_type ]
!11 = metadata !{i32 524309, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !12, i32 0, null} ; [ DW_TAG_subroutine_type ]
!12 = metadata !{metadata !13}
!13 = metadata !{i32 524324, metadata !1, metadata !"int", metadata !1, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]
!14 = metadata !{i32 524334, i32 0, metadata !6, metadata !"DEF", metadata !"DEF", metadata !"_ZN6vBase23DEFEv", metadata !1, i32 10, metadata !15, i1 false, i1 true, i32 1, i32 0, metadata !6, i1 false, i1 false} ; [ DW_TAG_subprogram ]
!15 = metadata !{i32 524309, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !16, i32 0, null} ; [ DW_TAG_subroutine_type ]
!16 = metadata !{null, metadata !17}
!17 = metadata !{i32 524303, metadata !1, metadata !"", metadata !1, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !6} ; [ DW_TAG_pointer_type ]
!18 = metadata !{i32 524334, i32 0, metadata !6, metadata !"vBase2", metadata !"vBase2", metadata !"", metadata !1, i32 7, metadata !15, i1 false, i1 false, i32 0, i32 0, null, i1 false, i1 false} ; [ DW_TAG_subprogram ]
!19 = metadata !{i32 524334, i32 0, metadata !3, metadata !"Test", metadata !"Test", metadata !"_ZN3UES4TestEP6vBase2", metadata !1, i32 15, metadata !20, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false} ; [ DW_TAG_subprogram ]
!20 = metadata !{i32 524309, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i64 0, i32 1, null, metadata !21, i32 0, null} ; [ DW_TAG_subroutine_type ]
!21 = metadata !{null, metadata !22, metadata !17}
!22 = metadata !{i32 524303, metadata !1, metadata !"", metadata !1, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !3} ; [ DW_TAG_pointer_type ]
!23 = metadata !{i32 524334, i32 0, metadata !3, metadata !"UES", metadata !"UES", metadata !"", metadata !1, i32 18, metadata !24, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false} ; [ DW_TAG_subprogram ]
!24 = metadata !{i32 524309, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !25, i32 0, null} ; [ DW_TAG_subroutine_type ]
!25 = metadata !{null, metadata !22}
!26 = metadata !{i32 524545, metadata !27, metadata !"this", metadata !1, i32 18, metadata !22} ; [ DW_TAG_arg_variable ]
!27 = metadata !{i32 524334, i32 0, metadata !1, metadata !"UES", metadata !"UES", metadata !"_ZN3UESC1Ev", metadata !1, i32 19, metadata !28, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false} ; [ DW_TAG_subprogram ]
!28 = metadata !{i32 524309, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !29, i32 0, null} ; [ DW_TAG_subroutine_type ]
!29 = metadata !{null}
!30 = metadata !{i32 18, i32 2, metadata !27, null}
!31 = metadata !{i32 22, i32 2, metadata !27, null}
!32 = metadata !{i32 524545, metadata !33, metadata !"this", metadata !1, i32 18, metadata !22} ; [ DW_TAG_arg_variable ]
!33 = metadata !{i32 524334, i32 0, metadata !1, metadata !"UES", metadata !"UES", metadata !"_ZN3UESC2Ev", metadata !1, i32 19, metadata !28, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false} ; [ DW_TAG_subprogram ]
!34 = metadata !{i32 18, i32 2, metadata !33, null}
!35 = metadata !{i32 524544, metadata !36, metadata !"vb1", metadata !1, i32 20, metadata !37} ; [ DW_TAG_auto_variable ]
!36 = metadata !{i32 524299, metadata !33, i32 19, i32 2} ; [ DW_TAG_lexical_block ]
!37 = metadata !{i32 524290, metadata !1, metadata !"vBase1", metadata !1, i32 1, i64 64, i64 64, i64 0, i32 0, null, metadata !38, i32 0, metadata !37} ; [ DW_TAG_class_type ]
!38 = metadata !{metadata !39, metadata !40, metadata !44}
!39 = metadata !{i32 524301, metadata !1, metadata !"_vptr$vBase1", metadata !1, i32 0, i64 64, i64 0, i64 0, i32 0, metadata !9} ; [ DW_TAG_member ]
!40 = metadata !{i32 524334, i32 0, metadata !37, metadata !"ABC", metadata !"ABC", metadata !"_ZN6vBase13ABCEv", metadata !1, i32 4, metadata !41, i1 false, i1 true, i32 1, i32 0, metadata !37, i1 false, i1 false} ; [ DW_TAG_subprogram ]
!41 = metadata !{i32 524309, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !42, i32 0, null} ; [ DW_TAG_subroutine_type ]
!42 = metadata !{null, metadata !43}
!43 = metadata !{i32 524303, metadata !1, metadata !"", metadata !1, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !37} ; [ DW_TAG_pointer_type ]
!44 = metadata !{i32 524334, i32 0, metadata !37, metadata !"vBase1", metadata !"vBase1", metadata !"", metadata !1, i32 1, metadata !41, i1 false, i1 false, i32 0, i32 0, null, i1 false, i1 false} ; [ DW_TAG_subprogram ]
!45 = metadata !{i32 20, i32 10, metadata !36, null}
!46 = metadata !{i32 20, i32 13, metadata !36, null}
!47 = metadata !{i32 21, i32 3, metadata !36, null}
!48 = metadata !{i32 22, i32 2, metadata !36, null}
!49 = metadata !{i32 524545, metadata !50, metadata !"this", metadata !1, i32 7, metadata !17} ; [ DW_TAG_arg_variable ]
!50 = metadata !{i32 524334, i32 0, metadata !1, metadata !"vBase2", metadata !"vBase2", metadata !"_ZN6vBase2C2Ev", metadata !1, i32 4, metadata !28, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false} ; [ DW_TAG_subprogram ]
!51 = metadata !{i32 7, i32 7, metadata !50, null}
!52 = metadata !{i32 524545, metadata !53, metadata !"this", metadata !1, i32 1, metadata !43} ; [ DW_TAG_arg_variable ]
!53 = metadata !{i32 524334, i32 0, metadata !1, metadata !"vBase1", metadata !"vBase1", metadata !"_ZN6vBase1C1Ev", metadata !1, i32 15, metadata !28, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false} ; [ DW_TAG_subprogram ]
!54 = metadata !{i32 1, i32 7, metadata !53, null}
!55 = metadata !{i32 524545, metadata !19, metadata !"this", metadata !1, i32 15, metadata !22} ; [ DW_TAG_arg_variable ]
!56 = metadata !{i32 15, i32 7, metadata !19, null}
!57 = metadata !{i32 524545, metadata !19, metadata !"ptr", metadata !1, i32 15, metadata !17} ; [ DW_TAG_arg_variable ]
!58 = metadata !{i32 15, i32 20, metadata !19, null}
!59 = metadata !{i32 15, i32 25, metadata !60, null}
!60 = metadata !{i32 524299, metadata !19, i32 15, i32 24} ; [ DW_TAG_lexical_block ]
!61 = metadata !{i32 524545, metadata !14, metadata !"this", metadata !1, i32 10, metadata !17} ; [ DW_TAG_arg_variable ]
!62 = metadata !{i32 10, i32 15, metadata !14, null}
!63 = metadata !{i32 10, i32 21, metadata !64, null}
!64 = metadata !{i32 524299, metadata !14, i32 10, i32 20} ; [ DW_TAG_lexical_block ]
!65 = metadata !{i32 524545, metadata !66, metadata !"this", metadata !1, i32 1, metadata !43} ; [ DW_TAG_arg_variable ]
!66 = metadata !{i32 524334, i32 0, metadata !1, metadata !"vBase1", metadata !"vBase1", metadata !"_ZN6vBase1C2Ev", metadata !1, i32 1, metadata !28, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false} ; [ DW_TAG_subprogram ]
!67 = metadata !{i32 1, i32 7, metadata !66, null}
!68 = metadata !{i32 524545, metadata !40, metadata !"this", metadata !1, i32 4, metadata !43} ; [ DW_TAG_arg_variable ]
!69 = metadata !{i32 4, i32 15, metadata !40, null}
!70 = metadata !{i32 4, i32 21, metadata !71, null}
!71 = metadata !{i32 524299, metadata !40, i32 4, i32 20} ; [ DW_TAG_lexical_block ]

