; LLVM IR from Simple-XX/SimpleKernel :: src/drv/dtb/dtb.ll (ZlsRSt7ostreamRKN3DTB11iter_data_tE)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.DTB::node_t" = type { %"struct.DTB::path_t", ptr, ptr, ptr, i32, i32, i32, i32, i8, [16 x %"struct.DTB::prop_t"], i64 }
%"struct.DTB::path_t" = type { [16 x ptr], i64 }
%"struct.DTB::prop_t" = type { ptr, i64, i64 }
%"struct.DTB::iter_data_t" = type { %"struct.DTB::path_t", ptr, i32, ptr, i32, ptr, i8 }

@_ZN3DTB5nodesE = external dso_local global [128 x %"struct.DTB::node_t"], align 16
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind
declare i64 @strlen(ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3DTB11get_phandleEj(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3DTB7get_fmtEPKc(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3DTB18print_attr_propencEPKNS_11iter_data_tEPmm(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, i64 noundef) #3 align 2

declare i32 @printf(ptr noundef, ...) #4

declare i32 @err(ptr noundef, ...) #4

declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL9__bswap32j(i32 noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZN3DTB12get_instanceEv() #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZlsRSt7ostreamRKN3DTB11iter_data_tE(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(184) %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca [2 x i64], align 16
  %11 = alloca i8, align 1
  %12 = alloca [3 x i64], align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %14, i32 0, i32 0
  %16 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZlsRSt7ostreamRKN3DTB6path_tE(ptr noundef nonnull align 1 dereferenceable(1) %13, ptr noundef nonnull align 8 dereferenceable(136) %15)
  %17 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %16, ptr noundef @.str.24)
  %18 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3DTB12get_instanceEv()
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %19, i32 0, i32 3
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = call noundef i32 @_ZN3DTB7get_fmtEPKc(ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef %21)
  switch i32 %22, label %188 [
    i32 0, label %23
    i32 1, label %31
    i32 2, label %38
    i32 3, label %48
    i32 4, label %59
    i32 5, label %70
    i32 6, label %99
    i32 7, label %135
    i32 8, label %159
  ]

23:                                               ; preds = %2
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %24, i32 0, i32 3
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %27, i32 0, i32 4
  %29 = load i32, ptr %28, align 8, !tbaa !14
  %30 = call i32 (ptr, ...) @warn(ptr noundef @.str.25, ptr noundef %26, i32 noundef %29)
  br label %190

31:                                               ; preds = %2
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %33, i32 0, i32 3
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %32, ptr noundef %35)
  %37 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %36, ptr noundef @.str.26)
  br label %190

38:                                               ; preds = %2
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %39, i32 0, i32 3
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %42, i32 0, i32 5
  %44 = load ptr, ptr %43, align 8, !tbaa !15
  %45 = load i32, ptr %44, align 4, !tbaa !16
  %46 = call noundef i32 @_ZL9__bswap32j(i32 noundef %45)
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.27, ptr noundef %41, i32 noundef %46)
  br label %190

48:                                               ; preds = %2
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %49, i32 0, i32 3
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %52, i32 0, i32 5
  %54 = load ptr, ptr %53, align 8, !tbaa !15
  %55 = load i64, ptr %54, align 8, !tbaa !17
  %56 = trunc i64 %55 to i32
  %57 = call noundef i32 @_ZL9__bswap32j(i32 noundef %56)
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.28, ptr noundef %51, i32 noundef %57)
  br label %190

59:                                               ; preds = %2
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %61, i32 0, i32 3
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %60, ptr noundef %63)
  %65 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %64, ptr noundef @.str.24)
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %66, i32 0, i32 5
  %68 = load ptr, ptr %67, align 8, !tbaa !15
  %69 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %65, ptr noundef %68)
  br label %190

70:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %71, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !18
  %74 = getelementptr inbounds i32, ptr %73, i64 3
  %75 = load i32, ptr %74, align 4, !tbaa !16
  %76 = call noundef i32 @_ZL9__bswap32j(i32 noundef %75)
  store i32 %76, ptr %5, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %77 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3DTB12get_instanceEv()
  %78 = load i32, ptr %5, align 4, !tbaa !16
  %79 = call noundef ptr @_ZN3DTB11get_phandleEj(ptr noundef nonnull align 1 dereferenceable(1) %77, i32 noundef %78)
  store ptr %79, ptr %6, align 8, !tbaa !5
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = icmp ne ptr %80, null
  br i1 %81, label %82, label %92

82:                                               ; preds = %70
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %83, i32 0, i32 3
  %85 = load ptr, ptr %84, align 8, !tbaa !9
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.DTB::node_t", ptr %86, i32 0, i32 0
  %88 = getelementptr inbounds %"struct.DTB::path_t", ptr %87, i32 0, i32 0
  %89 = getelementptr inbounds [16 x ptr], ptr %88, i64 0, i64 0
  %90 = load ptr, ptr %89, align 8, !tbaa !5
  %91 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, ptr noundef %85, ptr noundef %90)
  br label %98

92:                                               ; preds = %70
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %93, i32 0, i32 3
  %95 = load ptr, ptr %94, align 8, !tbaa !9
  %96 = load i32, ptr %5, align 4, !tbaa !16
  %97 = call i32 (ptr, ...) @printf(ptr noundef @.str.30, ptr noundef %95, i32 noundef %96)
  br label %98

98:                                               ; preds = %92, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %190

99:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %100, i32 0, i32 5
  %102 = load ptr, ptr %101, align 8, !tbaa !15
  store ptr %102, ptr %8, align 8, !tbaa !5
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %104, i32 0, i32 3
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  %107 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %103, ptr noundef %106)
  %108 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %107, ptr noundef @.str.31)
  br label %109

109:                                              ; preds = %116, %99
  %110 = load i64, ptr %7, align 8, !tbaa !17
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %111, i32 0, i32 4
  %113 = load i32, ptr %112, align 8, !tbaa !14
  %114 = zext i32 %113 to i64
  %115 = icmp ult i64 %110, %114
  br i1 %115, label %116, label %132

116:                                              ; preds = %109
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %117, ptr noundef @.str.32)
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %118, ptr noundef %119)
  %121 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %120, ptr noundef @.str.32)
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = call i64 @strlen(ptr noundef %122) #6
  %124 = add i64 %123, 1
  %125 = load i64, ptr %7, align 8, !tbaa !17
  %126 = add i64 %125, %124
  store i64 %126, ptr %7, align 8, !tbaa !17
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %127, i32 0, i32 5
  %129 = load ptr, ptr %128, align 8, !tbaa !15
  %130 = load i64, ptr %7, align 8, !tbaa !17
  %131 = getelementptr inbounds i8, ptr %129, i64 %130
  store ptr %131, ptr %8, align 8, !tbaa !5
  br label %109, !llvm.loop !19

132:                                              ; preds = %109
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %133, ptr noundef @.str.33)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %190

135:                                              ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %136, i32 0, i32 6
  %138 = load i8, ptr %137, align 8, !tbaa !21
  store i8 %138, ptr %9, align 1, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  %139 = load i8, ptr %9, align 1, !tbaa !22
  %140 = zext i8 %139 to i64
  %141 = getelementptr inbounds [128 x %"struct.DTB::node_t"], ptr @_ZN3DTB5nodesE, i64 0, i64 %140
  %142 = getelementptr inbounds %"struct.DTB::node_t", ptr %141, i32 0, i32 2
  %143 = load ptr, ptr %142, align 16, !tbaa !23
  %144 = getelementptr inbounds %"struct.DTB::node_t", ptr %143, i32 0, i32 4
  %145 = load i32, ptr %144, align 8, !tbaa !25
  %146 = zext i32 %145 to i64
  store i64 %146, ptr %10, align 8, !tbaa !17
  %147 = getelementptr inbounds i64, ptr %10, i64 1
  %148 = load i8, ptr %9, align 1, !tbaa !22
  %149 = zext i8 %148 to i64
  %150 = getelementptr inbounds [128 x %"struct.DTB::node_t"], ptr @_ZN3DTB5nodesE, i64 0, i64 %149
  %151 = getelementptr inbounds %"struct.DTB::node_t", ptr %150, i32 0, i32 2
  %152 = load ptr, ptr %151, align 16, !tbaa !23
  %153 = getelementptr inbounds %"struct.DTB::node_t", ptr %152, i32 0, i32 5
  %154 = load i32, ptr %153, align 4, !tbaa !26
  %155 = zext i32 %154 to i64
  store i64 %155, ptr %147, align 8, !tbaa !17
  %156 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3DTB12get_instanceEv()
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds [2 x i64], ptr %10, i64 0, i64 0
  call void @_ZN3DTB18print_attr_propencEPKNS_11iter_data_tEPmm(ptr noundef nonnull align 1 dereferenceable(1) %156, ptr noundef %157, ptr noundef %158, i64 noundef 2)
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  br label %190

159:                                              ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %"struct.DTB::iter_data_t", ptr %160, i32 0, i32 6
  %162 = load i8, ptr %161, align 8, !tbaa !21
  store i8 %162, ptr %11, align 1, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #6
  %163 = load i8, ptr %11, align 1, !tbaa !22
  %164 = zext i8 %163 to i64
  %165 = getelementptr inbounds [128 x %"struct.DTB::node_t"], ptr @_ZN3DTB5nodesE, i64 0, i64 %164
  %166 = getelementptr inbounds %"struct.DTB::node_t", ptr %165, i32 0, i32 4
  %167 = load i32, ptr %166, align 16, !tbaa !25
  %168 = zext i32 %167 to i64
  store i64 %168, ptr %12, align 8, !tbaa !17
  %169 = getelementptr inbounds i64, ptr %12, i64 1
  %170 = load i8, ptr %11, align 1, !tbaa !22
  %171 = zext i8 %170 to i64
  %172 = getelementptr inbounds [128 x %"struct.DTB::node_t"], ptr @_ZN3DTB5nodesE, i64 0, i64 %171
  %173 = getelementptr inbounds %"struct.DTB::node_t", ptr %172, i32 0, i32 2
  %174 = load ptr, ptr %173, align 16, !tbaa !23
  %175 = getelementptr inbounds %"struct.DTB::node_t", ptr %174, i32 0, i32 4
  %176 = load i32, ptr %175, align 8, !tbaa !25
  %177 = zext i32 %176 to i64
  store i64 %177, ptr %169, align 8, !tbaa !17
  %178 = getelementptr inbounds i64, ptr %12, i64 2
  %179 = load i8, ptr %11, align 1, !tbaa !22
  %180 = zext i8 %179 to i64
  %181 = getelementptr inbounds [128 x %"struct.DTB::node_t"], ptr @_ZN3DTB5nodesE, i64 0, i64 %180
  %182 = getelementptr inbounds %"struct.DTB::node_t", ptr %181, i32 0, i32 5
  %183 = load i32, ptr %182, align 4, !tbaa !26
  %184 = zext i32 %183 to i64
  store i64 %184, ptr %178, align 8, !tbaa !17
  %185 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3DTB12get_instanceEv()
  %186 = load ptr, ptr %4, align 8, !tbaa !5
  %187 = getelementptr inbounds [3 x i64], ptr %12, i64 0, i64 0
  call void @_ZN3DTB18print_attr_propencEPKNS_11iter_data_tEPmm(ptr noundef nonnull align 1 dereferenceable(1) %185, ptr noundef %186, ptr noundef %187, i64 noundef 3)
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  br label %190

188:                                              ; preds = %2
  %189 = call i32 (ptr, ...) @err(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 566, ptr noundef @.str.12)
  br label %190

190:                                              ; preds = %188, %159, %135, %132, %98, %59, %48, %38, %31, %23
  %191 = load ptr, ptr %3, align 8, !tbaa !5
  ret ptr %191
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZlsRSt7ostreamRKN3DTB6path_tE(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(136)) #3

declare i32 @warn(ptr noundef, ...) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 152}
!10 = !{!"_ZTSN3DTB11iter_data_tE", !11, i64 0, !6, i64 136, !13, i64 144, !6, i64 152, !13, i64 160, !6, i64 168, !7, i64 176}
!11 = !{!"_ZTSN3DTB6path_tE", !7, i64 0, !12, i64 128}
!12 = !{!"long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!10, !13, i64 160}
!15 = !{!10, !6, i64 168}
!16 = !{!13, !13, i64 0}
!17 = !{!12, !12, i64 0}
!18 = !{!10, !6, i64 136}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!10, !7, i64 176}
!22 = !{!7, !7, i64 0}
!23 = !{!24, !6, i64 144}
!24 = !{!"_ZTSN3DTB6node_tE", !11, i64 0, !6, i64 136, !6, i64 144, !6, i64 152, !13, i64 160, !13, i64 164, !13, i64 168, !13, i64 172, !7, i64 176, !7, i64 184, !12, i64 568}
!25 = !{!24, !13, i64 160}
!26 = !{!24, !13, i64 164}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.DTB::node_t" = type { %"struct.DTB::path_t", ptr, ptr, ptr, i32, i32, i32, i32, i8, [16 x %"struct.DTB::prop_t"], i64 }
%"struct.DTB::path_t" = type { [16 x ptr], i64 }
%"struct.DTB::prop_t" = type { ptr, i64, i64 }

@_ZN3DTB5nodesE = external dso_local local_unnamed_addr global [128 x %"struct.DTB::node_t"], align 16
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3DTB11get_phandleEj(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3DTB7get_fmtEPKc(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3DTB18print_attr_propencEPKNS_11iter_data_tEPmm(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

declare i32 @err(ptr noundef, ...) local_unnamed_addr #5

declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL9__bswap32j(i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZN3DTB12get_instanceEv() local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZlsRSt7ostreamRKN3DTB11iter_data_tE(ptr noundef nonnull returned align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(184) %1) local_unnamed_addr #3 {
  %3 = alloca [2 x i64], align 16
  %4 = alloca [3 x i64], align 16
  %5 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZlsRSt7ostreamRKN3DTB6path_tE(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(136) %1)
  %6 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull @.str.24)
  %7 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3DTB12get_instanceEv()
  %8 = getelementptr inbounds i8, ptr %1, i64 152
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call noundef i32 @_ZN3DTB7get_fmtEPKc(ptr noundef nonnull align 1 dereferenceable(1) %7, ptr noundef %9)
  switch i32 %10, label %105 [
    i32 0, label %11
    i32 1, label %16
    i32 2, label %20
    i32 3, label %27
    i32 4, label %35
    i32 5, label %42
    i32 6, label %56
    i32 7, label %76
    i32 8, label %86
  ]

11:                                               ; preds = %2
  %12 = load ptr, ptr %8, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %1, i64 160
  %14 = load i32, ptr %13, align 8, !tbaa !13
  %15 = tail call i32 (ptr, ...) @warn(ptr noundef nonnull @.str.25, ptr noundef %12, i32 noundef %14)
  br label %107

16:                                               ; preds = %2
  %17 = load ptr, ptr %8, align 8, !tbaa !5
  %18 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef %17)
  %19 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef nonnull @.str.26)
  br label %107

20:                                               ; preds = %2
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %1, i64 168
  %23 = load ptr, ptr %22, align 8, !tbaa !14
  %24 = load i32, ptr %23, align 4, !tbaa !15
  %25 = tail call noundef i32 @_ZL9__bswap32j(i32 noundef %24)
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27, ptr noundef %21, i32 noundef %25)
  br label %107

27:                                               ; preds = %2
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %1, i64 168
  %30 = load ptr, ptr %29, align 8, !tbaa !14
  %31 = load i64, ptr %30, align 8, !tbaa !16
  %32 = trunc i64 %31 to i32
  %33 = tail call noundef i32 @_ZL9__bswap32j(i32 noundef %32)
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28, ptr noundef %28, i32 noundef %33)
  br label %107

35:                                               ; preds = %2
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef %36)
  %38 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %37, ptr noundef nonnull @.str.24)
  %39 = getelementptr inbounds i8, ptr %1, i64 168
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  %41 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %38, ptr noundef %40)
  br label %107

42:                                               ; preds = %2
  %43 = getelementptr inbounds i8, ptr %1, i64 136
  %44 = load ptr, ptr %43, align 8, !tbaa !17
  %45 = getelementptr inbounds i8, ptr %44, i64 12
  %46 = load i32, ptr %45, align 4, !tbaa !15
  %47 = tail call noundef i32 @_ZL9__bswap32j(i32 noundef %46)
  %48 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3DTB12get_instanceEv()
  %49 = tail call noundef ptr @_ZN3DTB11get_phandleEj(ptr noundef nonnull align 1 dereferenceable(1) %48, i32 noundef %47)
  %.not = icmp eq ptr %49, null
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  br i1 %.not, label %54, label %51

51:                                               ; preds = %42
  %52 = load ptr, ptr %49, align 8, !tbaa !18
  %53 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef %50, ptr noundef %52)
  br label %107

54:                                               ; preds = %42
  %55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30, ptr noundef %50, i32 noundef %47)
  br label %107

56:                                               ; preds = %2
  %57 = getelementptr inbounds i8, ptr %1, i64 168
  %58 = load ptr, ptr %57, align 8, !tbaa !14
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef %59)
  %61 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %60, ptr noundef nonnull @.str.31)
  %62 = getelementptr inbounds i8, ptr %1, i64 160
  %63 = load i32, ptr %62, align 8, !tbaa !13
  %.not46 = icmp eq i32 %63, 0
  br i1 %.not46, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %56, %.lr.ph
  %.045 = phi i64 [ %69, %.lr.ph ], [ 0, %56 ]
  %.04244 = phi ptr [ %71, %.lr.ph ], [ %58, %56 ]
  %64 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull @.str.32)
  %65 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %64, ptr noundef %.04244)
  %66 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %65, ptr noundef nonnull @.str.32)
  %67 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.04244) #7
  %68 = add nuw nsw i64 %.045, 1
  %69 = add i64 %68, %67
  %70 = load ptr, ptr %57, align 8, !tbaa !14
  %71 = getelementptr inbounds i8, ptr %70, i64 %69
  %72 = load i32, ptr %62, align 8, !tbaa !13
  %73 = zext i32 %72 to i64
  %74 = icmp ult i64 %69, %73
  br i1 %74, label %.lr.ph, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph, %56
  %75 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7ostreamlsEPKc(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull @.str.33)
  br label %107

76:                                               ; preds = %2
  %77 = getelementptr inbounds i8, ptr %1, i64 176
  %78 = load i8, ptr %77, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  %79 = zext i8 %78 to i64
  %80 = getelementptr inbounds [128 x %"struct.DTB::node_t"], ptr @_ZN3DTB5nodesE, i64 0, i64 %79, i32 2
  %81 = load ptr, ptr %80, align 16, !tbaa !22
  %82 = getelementptr inbounds i8, ptr %81, i64 160
  %83 = load <2 x i32>, ptr %82, align 8, !tbaa !15
  %84 = zext <2 x i32> %83 to <2 x i64>
  store <2 x i64> %84, ptr %3, align 16, !tbaa !16
  %85 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3DTB12get_instanceEv()
  call void @_ZN3DTB18print_attr_propencEPKNS_11iter_data_tEPmm(ptr noundef nonnull align 1 dereferenceable(1) %85, ptr noundef nonnull %1, ptr noundef nonnull %3, i64 noundef 2)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  br label %107

86:                                               ; preds = %2
  %87 = getelementptr inbounds i8, ptr %1, i64 176
  %88 = load i8, ptr %87, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  %89 = zext i8 %88 to i64
  %90 = getelementptr inbounds [128 x %"struct.DTB::node_t"], ptr @_ZN3DTB5nodesE, i64 0, i64 %89
  %91 = getelementptr inbounds i8, ptr %90, i64 160
  %92 = load i32, ptr %91, align 16, !tbaa !24
  %93 = zext i32 %92 to i64
  store i64 %93, ptr %4, align 16, !tbaa !16
  %94 = getelementptr inbounds i8, ptr %4, i64 8
  %95 = getelementptr inbounds i8, ptr %90, i64 144
  %96 = load ptr, ptr %95, align 16, !tbaa !22
  %97 = getelementptr inbounds i8, ptr %96, i64 160
  %98 = load i32, ptr %97, align 8, !tbaa !24
  %99 = zext i32 %98 to i64
  store i64 %99, ptr %94, align 8, !tbaa !16
  %100 = getelementptr inbounds i8, ptr %4, i64 16
  %101 = getelementptr inbounds i8, ptr %90, i64 164
  %102 = load i32, ptr %101, align 4, !tbaa !25
  %103 = zext i32 %102 to i64
  store i64 %103, ptr %100, align 16, !tbaa !16
  %104 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3DTB12get_instanceEv()
  call void @_ZN3DTB18print_attr_propencEPKNS_11iter_data_tEPmm(ptr noundef nonnull align 1 dereferenceable(1) %104, ptr noundef nonnull %1, ptr noundef nonnull %4, i64 noundef 3)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  br label %107

105:                                              ; preds = %2
  %106 = tail call i32 (ptr, ...) @err(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 566, ptr noundef nonnull @.str.12)
  br label %107

107:                                              ; preds = %51, %54, %105, %86, %76, %._crit_edge, %35, %27, %20, %16, %11
  ret ptr %0
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZlsRSt7ostreamRKN3DTB6path_tE(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(136)) local_unnamed_addr #3

declare i32 @warn(ptr noundef, ...) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 152}
!6 = !{!"_ZTSN3DTB11iter_data_tE", !7, i64 0, !11, i64 136, !12, i64 144, !11, i64 152, !12, i64 160, !11, i64 168, !8, i64 176}
!7 = !{!"_ZTSN3DTB6path_tE", !8, i64 0, !10, i64 128}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!6, !12, i64 160}
!14 = !{!6, !11, i64 168}
!15 = !{!12, !12, i64 0}
!16 = !{!10, !10, i64 0}
!17 = !{!6, !11, i64 136}
!18 = !{!11, !11, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!6, !8, i64 176}
!22 = !{!23, !11, i64 144}
!23 = !{!"_ZTSN3DTB6node_tE", !7, i64 0, !11, i64 136, !11, i64 144, !11, i64 152, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !8, i64 176, !8, i64 184, !10, i64 568}
!24 = !{!23, !12, i64 160}
!25 = !{!23, !12, i64 164}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass