; LLVM IR from aap/librw :: src/geometry.ll (ZN2rw8Geometry11buildMeshesEv)

; 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.rw::MemoryFunctions" = type { ptr, ptr, ptr, ptr, ptr }
%"struct.rw::Geometry" = type { %"struct.rw::Object", i32, i16, i32, i32, i32, i32, ptr, ptr, [8 x ptr], ptr, %"struct.rw::MaterialList", ptr, ptr, i32 }
%"struct.rw::Object" = type { i8, i8, i8, i8, ptr }
%"struct.rw::MaterialList" = type { ptr, i32, i32 }
%"struct.rw::Triangle" = type { [3 x i16], i16 }
%"struct.rw::Mesh" = type { ptr, i32, ptr }

@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [60 x i8], align 1
@_ZN2rw6Engine8memfuncsE = external global %"struct.rw::MemoryFunctions", align 8
@.str.13 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._ZN2rw8Geometry11buildMeshesEv = external hidden unnamed_addr constant [33 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: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw8Geometry11buildMeshesEv(ptr noundef nonnull align 8 dereferenceable(168) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  %14 = getelementptr inbounds %"struct.rw::Geometry", ptr %13, i32 0, i32 1
  %15 = load i32, ptr %14, align 8, !tbaa !9
  %16 = and i32 %15, 16777216
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %21

18:                                               ; preds = %1
  %19 = load ptr, ptr @stderr, align 8, !tbaa !5
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str.13) #8
  store i32 1, ptr %5, align 4
  br label %215

21:                                               ; preds = %1
  %22 = load ptr, ptr getelementptr inbounds (%"struct.rw::MemoryFunctions", ptr @_ZN2rw6Engine8memfuncsE, i32 0, i32 2), align 8, !tbaa !15
  %23 = getelementptr inbounds %"struct.rw::Geometry", ptr %13, i32 0, i32 12
  %24 = load ptr, ptr %23, align 8, !tbaa !17
  call void %22(ptr noundef %24)
  %25 = getelementptr inbounds %"struct.rw::Geometry", ptr %13, i32 0, i32 12
  store ptr null, ptr %25, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %26 = getelementptr inbounds %"struct.rw::Geometry", ptr %13, i32 0, i32 11
  %27 = getelementptr inbounds %"struct.rw::MaterialList", ptr %26, i32 0, i32 1
  %28 = load i32, ptr %27, align 8, !tbaa !18
  store i32 %28, ptr %6, align 4, !tbaa !19
  %29 = getelementptr inbounds %"struct.rw::Geometry", ptr %13, i32 0, i32 1
  %30 = load i32, ptr %29, align 8, !tbaa !9
  %31 = and i32 %30, 1
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %213

33:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %34 = load i32, ptr %6, align 4, !tbaa !19
  %35 = sext i32 %34 to i64
  %36 = mul i64 %35, 4
  %37 = call noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef %36, i32 noundef 65551, ptr noundef @.str.14)
  store ptr %37, ptr %7, align 8, !tbaa !5
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = load i32, ptr %6, align 4, !tbaa !19
  %40 = sext i32 %39 to i64
  %41 = mul i64 %40, 4
  call void @llvm.memset.p0.i64(ptr align 4 %38, i8 0, i64 %41, i1 false)
  %42 = getelementptr inbounds %"struct.rw::Geometry", ptr %13, i32 0, i32 7
  %43 = load ptr, ptr %42, align 8, !tbaa !20
  store ptr %43, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !19
  br label %44

44:                                               ; preds = %71, %33
  %45 = load i32, ptr %8, align 4, !tbaa !19
  %46 = getelementptr inbounds %"struct.rw::Geometry", ptr %13, i32 0, i32 3
  %47 = load i32, ptr %46, align 8, !tbaa !21
  %48 = icmp slt i32 %45, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %44
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %74

50:                                               ; preds = %44
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.rw::Triangle", ptr %51, i32 0, i32 1
  %53 = load i16, ptr %52, align 2, !tbaa !22
  %54 = zext i16 %53 to i32
  %55 = load i32, ptr %6, align 4, !tbaa !19
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %50
  br label %60

58:                                               ; preds = %50
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.3, i32 noundef 535, ptr noundef @__PRETTY_FUNCTION__._ZN2rw8Geometry11buildMeshesEv) #9
  unreachable

59:                                               ; No predecessors!
  br label %60

60:                                               ; preds = %59, %57
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = getelementptr inbounds %"struct.rw::Triangle", ptr %62, i32 0, i32 1
  %64 = load i16, ptr %63, align 2, !tbaa !22
  %65 = zext i16 %64 to i64
  %66 = getelementptr inbounds i32, ptr %61, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !19
  %68 = add nsw i32 %67, 3
  store i32 %68, ptr %66, align 4, !tbaa !19
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.rw::Triangle", ptr %69, i32 1
  store ptr %70, ptr %3, align 8, !tbaa !5
  br label %71

71:                                               ; preds = %60
  %72 = load i32, ptr %8, align 4, !tbaa !19
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %8, align 4, !tbaa !19
  br label %44, !llvm.loop !24

74:                                               ; preds = %49
  %75 = load i32, ptr %6, align 4, !tbaa !19
  %76 = getelementptr inbounds %"struct.rw::Geometry", ptr %13, i32 0, i32 3
  %77 = load i32, ptr %76, align 8, !tbaa !21
  %78 = mul nsw i32 %77, 3
  %79 = call noundef ptr @_ZN2rw8Geometry14allocateMeshesEiji(ptr noundef nonnull align 8 dereferenceable(168) %13, i32 noundef %75, i32 noundef %78, i32 noundef 0)
  %80 = getelementptr inbounds %"struct.rw::Geometry", ptr %13, i32 0, i32 12
  %81 = load ptr, ptr %80, align 8, !tbaa !17
  %82 = call noundef ptr @_ZN2rw10MeshHeader9getMeshesEv(ptr noundef nonnull align 4 dereferenceable(16) %81)
  store ptr %82, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !19
  br label %83

83:                                               ; preds = %111, %74
  %84 = load i32, ptr %9, align 4, !tbaa !19
  %85 = load i32, ptr %6, align 4, !tbaa !19
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %114

88:                                               ; preds = %83
  %89 = getelementptr inbounds %"struct.rw::Geometry", ptr %13, i32 0, i32 11
  %90 = getelementptr inbounds %"struct.rw::MaterialList", ptr %89, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !26
  %92 = load i32, ptr %9, align 4, !tbaa !19
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds ptr, ptr %91, i64 %93
  %95 = load ptr, ptr %94, align 8, !tbaa !5
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = load i32, ptr %9, align 4, !tbaa !19
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds %"struct.rw::Mesh", ptr %96, i64 %98
  %100 = getelementptr inbounds %"struct.rw::Mesh", ptr %99, i32 0, i32 2
  store ptr %95, ptr %100, align 8, !tbaa !27
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = load i32, ptr %9, align 4, !tbaa !19
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i32, ptr %101, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !19
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = load i32, ptr %9, align 4, !tbaa !19
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds %"struct.rw::Mesh", ptr %106, i64 %108
  %110 = getelementptr inbounds %"struct.rw::Mesh", ptr %109, i32 0, i32 1
  store i32 %105, ptr %110, align 8, !tbaa !29
  br label %111

111:                                              ; preds = %88
  %112 = load i32, ptr %9, align 4, !tbaa !19
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %9, align 4, !tbaa !19
  br label %83, !llvm.loop !30

114:                                              ; preds = %87
  %115 = getelementptr inbounds %"struct.rw::Geometry", ptr %13, i32 0, i32 12
  %116 = load ptr, ptr %115, align 8, !tbaa !17
  call void @_ZN2rw10MeshHeader12setupIndicesEv(ptr noundef nonnull align 4 dereferenceable(16) %116)
  %117 = load ptr, ptr getelementptr inbounds (%"struct.rw::MemoryFunctions", ptr @_ZN2rw6Engine8memfuncsE, i32 0, i32 2), align 8, !tbaa !15
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  call void %117(ptr noundef %118)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !19
  br label %119

119:                                              ; preds = %130, %114
  %120 = load i32, ptr %10, align 4, !tbaa !19
  %121 = load i32, ptr %6, align 4, !tbaa !19
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %133

124:                                              ; preds = %119
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = load i32, ptr %10, align 4, !tbaa !19
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds %"struct.rw::Mesh", ptr %125, i64 %127
  %129 = getelementptr inbounds %"struct.rw::Mesh", ptr %128, i32 0, i32 1
  store i32 0, ptr %129, align 8, !tbaa !29
  br label %130

130:                                              ; preds = %124
  %131 = load i32, ptr %10, align 4, !tbaa !19
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %10, align 4, !tbaa !19
  br label %119, !llvm.loop !31

133:                                              ; preds = %123
  %134 = getelementptr inbounds %"struct.rw::Geometry", ptr %13, i32 0, i32 7
  %135 = load ptr, ptr %134, align 8, !tbaa !20
  store ptr %135, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !19
  br label %136

136:                                              ; preds = %209, %133
  %137 = load i32, ptr %11, align 4, !tbaa !19
  %138 = getelementptr inbounds %"struct.rw::Geometry", ptr %13, i32 0, i32 3
  %139 = load i32, ptr %138, align 8, !tbaa !21
  %140 = icmp slt i32 %137, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %136
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %212

142:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = getelementptr inbounds %"struct.rw::Triangle", ptr %144, i32 0, i32 1
  %146 = load i16, ptr %145, align 2, !tbaa !22
  %147 = zext i16 %146 to i64
  %148 = getelementptr inbounds %"struct.rw::Mesh", ptr %143, i64 %147
  %149 = getelementptr inbounds %"struct.rw::Mesh", ptr %148, i32 0, i32 1
  %150 = load i32, ptr %149, align 8, !tbaa !29
  store i32 %150, ptr %12, align 4, !tbaa !19
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = getelementptr inbounds %"struct.rw::Triangle", ptr %151, i32 0, i32 0
  %153 = getelementptr inbounds [3 x i16], ptr %152, i64 0, i64 0
  %154 = load i16, ptr %153, align 2, !tbaa !32
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %"struct.rw::Triangle", ptr %156, i32 0, i32 1
  %158 = load i16, ptr %157, align 2, !tbaa !22
  %159 = zext i16 %158 to i64
  %160 = getelementptr inbounds %"struct.rw::Mesh", ptr %155, i64 %159
  %161 = getelementptr inbounds %"struct.rw::Mesh", ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8, !tbaa !33
  %163 = load i32, ptr %12, align 4, !tbaa !19
  %164 = add i32 %163, 1
  store i32 %164, ptr %12, align 4, !tbaa !19
  %165 = zext i32 %163 to i64
  %166 = getelementptr inbounds i16, ptr %162, i64 %165
  store i16 %154, ptr %166, align 2, !tbaa !32
  %167 = load ptr, ptr %3, align 8, !tbaa !5
  %168 = getelementptr inbounds %"struct.rw::Triangle", ptr %167, i32 0, i32 0
  %169 = getelementptr inbounds [3 x i16], ptr %168, i64 0, i64 1
  %170 = load i16, ptr %169, align 2, !tbaa !32
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = load ptr, ptr %3, align 8, !tbaa !5
  %173 = getelementptr inbounds %"struct.rw::Triangle", ptr %172, i32 0, i32 1
  %174 = load i16, ptr %173, align 2, !tbaa !22
  %175 = zext i16 %174 to i64
  %176 = getelementptr inbounds %"struct.rw::Mesh", ptr %171, i64 %175
  %177 = getelementptr inbounds %"struct.rw::Mesh", ptr %176, i32 0, i32 0
  %178 = load ptr, ptr %177, align 8, !tbaa !33
  %179 = load i32, ptr %12, align 4, !tbaa !19
  %180 = add i32 %179, 1
  store i32 %180, ptr %12, align 4, !tbaa !19
  %181 = zext i32 %179 to i64
  %182 = getelementptr inbounds i16, ptr %178, i64 %181
  store i16 %170, ptr %182, align 2, !tbaa !32
  %183 = load ptr, ptr %3, align 8, !tbaa !5
  %184 = getelementptr inbounds %"struct.rw::Triangle", ptr %183, i32 0, i32 0
  %185 = getelementptr inbounds [3 x i16], ptr %184, i64 0, i64 2
  %186 = load i16, ptr %185, align 2, !tbaa !32
  %187 = load ptr, ptr %4, align 8, !tbaa !5
  %188 = load ptr, ptr %3, align 8, !tbaa !5
  %189 = getelementptr inbounds %"struct.rw::Triangle", ptr %188, i32 0, i32 1
  %190 = load i16, ptr %189, align 2, !tbaa !22
  %191 = zext i16 %190 to i64
  %192 = getelementptr inbounds %"struct.rw::Mesh", ptr %187, i64 %191
  %193 = getelementptr inbounds %"struct.rw::Mesh", ptr %192, i32 0, i32 0
  %194 = load ptr, ptr %193, align 8, !tbaa !33
  %195 = load i32, ptr %12, align 4, !tbaa !19
  %196 = add i32 %195, 1
  store i32 %196, ptr %12, align 4, !tbaa !19
  %197 = zext i32 %195 to i64
  %198 = getelementptr inbounds i16, ptr %194, i64 %197
  store i16 %186, ptr %198, align 2, !tbaa !32
  %199 = load i32, ptr %12, align 4, !tbaa !19
  %200 = load ptr, ptr %4, align 8, !tbaa !5
  %201 = load ptr, ptr %3, align 8, !tbaa !5
  %202 = getelementptr inbounds %"struct.rw::Triangle", ptr %201, i32 0, i32 1
  %203 = load i16, ptr %202, align 2, !tbaa !22
  %204 = zext i16 %203 to i64
  %205 = getelementptr inbounds %"struct.rw::Mesh", ptr %200, i64 %204
  %206 = getelementptr inbounds %"struct.rw::Mesh", ptr %205, i32 0, i32 1
  store i32 %199, ptr %206, align 8, !tbaa !29
  %207 = load ptr, ptr %3, align 8, !tbaa !5
  %208 = getelementptr inbounds %"struct.rw::Triangle", ptr %207, i32 1
  store ptr %208, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %209

209:                                              ; preds = %142
  %210 = load i32, ptr %11, align 4, !tbaa !19
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %11, align 4, !tbaa !19
  br label %136, !llvm.loop !34

212:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %214

213:                                              ; preds = %21
  call void @_ZN2rw8Geometry14buildTristripsEv(ptr noundef nonnull align 8 dereferenceable(168) %13)
  br label %214

214:                                              ; preds = %213, %212
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  store i32 0, ptr %5, align 4
  br label %215

215:                                              ; preds = %214, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  %216 = load i32, ptr %5, align 4
  switch i32 %216, label %218 [
    i32 0, label %217
    i32 1, label %217
  ]

217:                                              ; preds = %215, %215
  ret void

218:                                              ; preds = %215
  unreachable
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw10MeshHeader9getMeshesEv(ptr noundef nonnull align 4 dereferenceable(16)) #5 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

declare noundef ptr @_ZN2rw8Geometry14allocateMeshesEiji(ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, i32 noundef, i32 noundef) #7

declare void @_ZN2rw10MeshHeader12setupIndicesEv(ptr noundef nonnull align 4 dereferenceable(16)) #7

declare void @_ZN2rw8Geometry14buildTristripsEv(ptr noundef nonnull align 8 dereferenceable(168)) #7

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 = { inlinehint 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 #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 = { noreturn 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { "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 #8 = { nounwind }
attributes #9 = { noreturn 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, !12, i64 16}
!10 = !{!"_ZTSN2rw8GeometryE", !11, i64 0, !12, i64 16, !13, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 120, !14, i64 128, !6, i64 144, !6, i64 152, !12, i64 160}
!11 = !{!"_ZTSN2rw6ObjectE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !6, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!"_ZTSN2rw12MaterialListE", !6, i64 0, !12, i64 8, !12, i64 12}
!15 = !{!16, !6, i64 16}
!16 = !{!"_ZTSN2rw15MemoryFunctionsE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!17 = !{!10, !6, i64 144}
!18 = !{!10, !12, i64 136}
!19 = !{!12, !12, i64 0}
!20 = !{!10, !6, i64 40}
!21 = !{!10, !12, i64 24}
!22 = !{!23, !13, i64 6}
!23 = !{!"_ZTSN2rw8TriangleE", !7, i64 0, !13, i64 6}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!10, !6, i64 128}
!27 = !{!28, !6, i64 16}
!28 = !{!"_ZTSN2rw4MeshE", !6, i64 0, !12, i64 8, !6, i64 16}
!29 = !{!28, !12, i64 8}
!30 = distinct !{!30, !25}
!31 = distinct !{!31, !25}
!32 = !{!13, !13, i64 0}
!33 = !{!28, !6, i64 0}
!34 = distinct !{!34, !25}


; 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.rw::MemoryFunctions" = type { ptr, ptr, ptr, ptr, ptr }
%"struct.rw::Mesh" = type { ptr, i32, ptr }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [60 x i8], align 1
@_ZN2rw6Engine8memfuncsE = external local_unnamed_addr global %"struct.rw::MemoryFunctions", align 8
@.str.13 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._ZN2rw8Geometry11buildMeshesEv = external hidden unnamed_addr constant [33 x i8], align 1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw8Geometry11buildMeshesEv(ptr noundef nonnull align 8 dereferenceable(168) %0) local_unnamed_addr #2 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 16
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = and i32 %3, 16777216
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %8, label %5

5:                                                ; preds = %1
  %6 = load ptr, ptr @stderr, align 8, !tbaa !14
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %6, ptr noundef nonnull @.str.13) #7
  br label %.loopexit

8:                                                ; preds = %1
  %9 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN2rw6Engine8memfuncsE, i64 16), align 8, !tbaa !15
  %10 = getelementptr inbounds i8, ptr %0, i64 144
  %11 = load ptr, ptr %10, align 8, !tbaa !17
  tail call void %9(ptr noundef %11)
  store ptr null, ptr %10, align 8, !tbaa !17
  %12 = getelementptr inbounds i8, ptr %0, i64 128
  %13 = getelementptr inbounds i8, ptr %0, i64 136
  %14 = load i32, ptr %13, align 8, !tbaa !18
  %15 = load i32, ptr %2, align 8, !tbaa !5
  %16 = and i32 %15, 1
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %18, label %131

18:                                               ; preds = %8
  %19 = sext i32 %14 to i64
  %20 = shl nsw i64 %19, 2
  %21 = tail call noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef %20, i32 noundef 65551, ptr noundef nonnull @.str.14)
  tail call void @llvm.memset.p0.i64(ptr align 4 %21, i8 0, i64 %20, i1 false)
  %22 = getelementptr inbounds i8, ptr %0, i64 40
  %23 = getelementptr inbounds i8, ptr %0, i64 24
  %24 = load i32, ptr %23, align 8, !tbaa !19
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %18
  %26 = load ptr, ptr %22, align 8, !tbaa !20
  br label %.lr.ph

._crit_edge:                                      ; preds = %39, %18
  %.lcssa = phi i32 [ %24, %18 ], [ %46, %39 ]
  %27 = mul nsw i32 %.lcssa, 3
  %28 = tail call noundef ptr @_ZN2rw8Geometry14allocateMeshesEiji(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 noundef %14, i32 noundef %27, i32 noundef 0)
  %29 = load ptr, ptr %10, align 8, !tbaa !17
  %30 = tail call noundef ptr @_ZN2rw10MeshHeader9getMeshesEv(ptr noundef nonnull align 4 dereferenceable(16) %29)
  %31 = icmp sgt i32 %14, 0
  br i1 %31, label %.lr.ph60, label %._crit_edge65.critedge

.lr.ph60:                                         ; preds = %._crit_edge
  %32 = load ptr, ptr %12, align 8, !tbaa !21
  %wide.trip.count = zext nneg i32 %14 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %33 = icmp ult i32 %14, 4
  br i1 %33, label %._crit_edge61.unr-lcssa, label %.lr.ph60.new

.lr.ph60.new:                                     ; preds = %.lr.ph60
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %58

.lr.ph:                                           ; preds = %.lr.ph.preheader, %39
  %.057 = phi ptr [ %44, %39 ], [ %26, %.lr.ph.preheader ]
  %.05056 = phi i32 [ %45, %39 ], [ 0, %.lr.ph.preheader ]
  %34 = getelementptr inbounds i8, ptr %.057, i64 6
  %35 = load i16, ptr %34, align 2, !tbaa !22
  %36 = zext i16 %35 to i32
  %37 = icmp sgt i32 %14, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %.lr.ph
  tail call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.3, i32 noundef 535, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN2rw8Geometry11buildMeshesEv) #8
  unreachable

39:                                               ; preds = %.lr.ph
  %40 = zext i16 %35 to i64
  %41 = getelementptr inbounds i32, ptr %21, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !24
  %43 = add nsw i32 %42, 3
  store i32 %43, ptr %41, align 4, !tbaa !24
  %44 = getelementptr inbounds i8, ptr %.057, i64 8
  %45 = add nuw nsw i32 %.05056, 1
  %46 = load i32, ptr %23, align 8, !tbaa !19
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %.lr.ph, label %._crit_edge, !llvm.loop !25

._crit_edge61.unr-lcssa:                          ; preds = %58, %.lr.ph60
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph60 ], [ %indvars.iv.next.3, %58 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge61, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge61.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge61.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge61.unr-lcssa ]
  %48 = getelementptr inbounds ptr, ptr %32, i64 %indvars.iv.epil
  %49 = load ptr, ptr %48, align 8, !tbaa !14
  %50 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %indvars.iv.epil
  %51 = getelementptr inbounds i8, ptr %50, i64 16
  store ptr %49, ptr %51, align 8, !tbaa !27
  %52 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv.epil
  %53 = load i32, ptr %52, align 4, !tbaa !24
  %54 = getelementptr inbounds i8, ptr %50, i64 8
  store i32 %53, ptr %54, align 8, !tbaa !29
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge61, label %.epil.preheader, !llvm.loop !30

._crit_edge61:                                    ; preds = %.epil.preheader, %._crit_edge61.unr-lcssa
  %55 = load ptr, ptr %10, align 8, !tbaa !17
  tail call void @_ZN2rw10MeshHeader12setupIndicesEv(ptr noundef nonnull align 4 dereferenceable(16) %55)
  %56 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN2rw6Engine8memfuncsE, i64 16), align 8, !tbaa !15
  tail call void %56(ptr noundef %21)
  br i1 %31, label %.lr.ph64.preheader, label %._crit_edge65

.lr.ph64.preheader:                               ; preds = %._crit_edge61
  %xtraiter81 = and i64 %wide.trip.count, 3
  %57 = icmp ult i32 %14, 4
  br i1 %57, label %._crit_edge65.loopexit.unr-lcssa, label %.lr.ph64.preheader.new

.lr.ph64.preheader.new:                           ; preds = %.lr.ph64.preheader
  %unroll_iter84 = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph64

58:                                               ; preds = %58, %.lr.ph60.new
  %indvars.iv = phi i64 [ 0, %.lr.ph60.new ], [ %indvars.iv.next.3, %58 ]
  %niter = phi i64 [ 0, %.lr.ph60.new ], [ %niter.next.3, %58 ]
  %59 = getelementptr inbounds ptr, ptr %32, i64 %indvars.iv
  %60 = load ptr, ptr %59, align 8, !tbaa !14
  %61 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %indvars.iv
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  store ptr %60, ptr %62, align 8, !tbaa !27
  %63 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv
  %64 = load i32, ptr %63, align 4, !tbaa !24
  %65 = getelementptr inbounds i8, ptr %61, i64 8
  store i32 %64, ptr %65, align 8, !tbaa !29
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %66 = getelementptr inbounds ptr, ptr %32, i64 %indvars.iv.next
  %67 = load ptr, ptr %66, align 8, !tbaa !14
  %68 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %indvars.iv.next
  %69 = getelementptr inbounds i8, ptr %68, i64 16
  store ptr %67, ptr %69, align 8, !tbaa !27
  %70 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv.next
  %71 = load i32, ptr %70, align 4, !tbaa !24
  %72 = getelementptr inbounds i8, ptr %68, i64 8
  store i32 %71, ptr %72, align 8, !tbaa !29
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %73 = getelementptr inbounds ptr, ptr %32, i64 %indvars.iv.next.1
  %74 = load ptr, ptr %73, align 8, !tbaa !14
  %75 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %indvars.iv.next.1
  %76 = getelementptr inbounds i8, ptr %75, i64 16
  store ptr %74, ptr %76, align 8, !tbaa !27
  %77 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv.next.1
  %78 = load i32, ptr %77, align 4, !tbaa !24
  %79 = getelementptr inbounds i8, ptr %75, i64 8
  store i32 %78, ptr %79, align 8, !tbaa !29
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %80 = getelementptr inbounds ptr, ptr %32, i64 %indvars.iv.next.2
  %81 = load ptr, ptr %80, align 8, !tbaa !14
  %82 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %indvars.iv.next.2
  %83 = getelementptr inbounds i8, ptr %82, i64 16
  store ptr %81, ptr %83, align 8, !tbaa !27
  %84 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv.next.2
  %85 = load i32, ptr %84, align 4, !tbaa !24
  %86 = getelementptr inbounds i8, ptr %82, i64 8
  store i32 %85, ptr %86, align 8, !tbaa !29
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge61.unr-lcssa, label %58, !llvm.loop !32

._crit_edge65.critedge:                           ; preds = %._crit_edge
  %87 = load ptr, ptr %10, align 8, !tbaa !17
  tail call void @_ZN2rw10MeshHeader12setupIndicesEv(ptr noundef nonnull align 4 dereferenceable(16) %87)
  %88 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN2rw6Engine8memfuncsE, i64 16), align 8, !tbaa !15
  tail call void %88(ptr noundef %21)
  br label %._crit_edge65

._crit_edge65.loopexit.unr-lcssa:                 ; preds = %.lr.ph64, %.lr.ph64.preheader
  %indvars.iv72.unr = phi i64 [ 0, %.lr.ph64.preheader ], [ %indvars.iv.next73.3, %.lr.ph64 ]
  %lcmp.mod83.not = icmp eq i64 %xtraiter81, 0
  br i1 %lcmp.mod83.not, label %._crit_edge65, label %.lr.ph64.epil

.lr.ph64.epil:                                    ; preds = %._crit_edge65.loopexit.unr-lcssa, %.lr.ph64.epil
  %indvars.iv72.epil = phi i64 [ %indvars.iv.next73.epil, %.lr.ph64.epil ], [ %indvars.iv72.unr, %._crit_edge65.loopexit.unr-lcssa ]
  %epil.iter82 = phi i64 [ %epil.iter82.next, %.lr.ph64.epil ], [ 0, %._crit_edge65.loopexit.unr-lcssa ]
  %89 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %indvars.iv72.epil, i32 1
  store i32 0, ptr %89, align 8, !tbaa !29
  %indvars.iv.next73.epil = add nuw nsw i64 %indvars.iv72.epil, 1
  %epil.iter82.next = add i64 %epil.iter82, 1
  %epil.iter82.cmp.not = icmp eq i64 %epil.iter82.next, %xtraiter81
  br i1 %epil.iter82.cmp.not, label %._crit_edge65, label %.lr.ph64.epil, !llvm.loop !33

._crit_edge65:                                    ; preds = %._crit_edge65.loopexit.unr-lcssa, %.lr.ph64.epil, %._crit_edge65.critedge, %._crit_edge61
  %90 = load i32, ptr %23, align 8, !tbaa !19
  %91 = icmp sgt i32 %90, 0
  br i1 %91, label %.lr.ph69.preheader, label %.loopexit

.lr.ph69.preheader:                               ; preds = %._crit_edge65
  %92 = load ptr, ptr %22, align 8, !tbaa !20
  br label %.lr.ph69

.lr.ph64:                                         ; preds = %.lr.ph64, %.lr.ph64.preheader.new
  %indvars.iv72 = phi i64 [ 0, %.lr.ph64.preheader.new ], [ %indvars.iv.next73.3, %.lr.ph64 ]
  %niter85 = phi i64 [ 0, %.lr.ph64.preheader.new ], [ %niter85.next.3, %.lr.ph64 ]
  %93 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %indvars.iv72, i32 1
  store i32 0, ptr %93, align 8, !tbaa !29
  %indvars.iv.next73 = or disjoint i64 %indvars.iv72, 1
  %94 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %indvars.iv.next73, i32 1
  store i32 0, ptr %94, align 8, !tbaa !29
  %indvars.iv.next73.1 = or disjoint i64 %indvars.iv72, 2
  %95 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %indvars.iv.next73.1, i32 1
  store i32 0, ptr %95, align 8, !tbaa !29
  %indvars.iv.next73.2 = or disjoint i64 %indvars.iv72, 3
  %96 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %indvars.iv.next73.2, i32 1
  store i32 0, ptr %96, align 8, !tbaa !29
  %indvars.iv.next73.3 = add nuw nsw i64 %indvars.iv72, 4
  %niter85.next.3 = add i64 %niter85, 4
  %niter85.ncmp.3 = icmp eq i64 %niter85.next.3, %unroll_iter84
  br i1 %niter85.ncmp.3, label %._crit_edge65.loopexit.unr-lcssa, label %.lr.ph64, !llvm.loop !34

.lr.ph69:                                         ; preds = %.lr.ph69.preheader, %.lr.ph69
  %.167 = phi ptr [ %129, %.lr.ph69 ], [ %92, %.lr.ph69.preheader ]
  %.04766 = phi i32 [ %130, %.lr.ph69 ], [ 0, %.lr.ph69.preheader ]
  %97 = getelementptr inbounds i8, ptr %.167, i64 6
  %98 = load i16, ptr %97, align 2, !tbaa !22
  %99 = zext i16 %98 to i64
  %100 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %99
  %101 = getelementptr inbounds i8, ptr %100, i64 8
  %102 = load i32, ptr %101, align 8, !tbaa !29
  %103 = load i16, ptr %.167, align 2, !tbaa !35
  %104 = load ptr, ptr %100, align 8, !tbaa !36
  %105 = add i32 %102, 1
  %106 = zext i32 %102 to i64
  %107 = getelementptr inbounds i16, ptr %104, i64 %106
  store i16 %103, ptr %107, align 2, !tbaa !35
  %108 = getelementptr inbounds i8, ptr %.167, i64 2
  %109 = load i16, ptr %108, align 2, !tbaa !35
  %110 = load i16, ptr %97, align 2, !tbaa !22
  %111 = zext i16 %110 to i64
  %112 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %111
  %113 = load ptr, ptr %112, align 8, !tbaa !36
  %114 = add i32 %102, 2
  %115 = zext i32 %105 to i64
  %116 = getelementptr inbounds i16, ptr %113, i64 %115
  store i16 %109, ptr %116, align 2, !tbaa !35
  %117 = getelementptr inbounds i8, ptr %.167, i64 4
  %118 = load i16, ptr %117, align 2, !tbaa !35
  %119 = load i16, ptr %97, align 2, !tbaa !22
  %120 = zext i16 %119 to i64
  %121 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %120
  %122 = load ptr, ptr %121, align 8, !tbaa !36
  %123 = add i32 %102, 3
  %124 = zext i32 %114 to i64
  %125 = getelementptr inbounds i16, ptr %122, i64 %124
  store i16 %118, ptr %125, align 2, !tbaa !35
  %126 = load i16, ptr %97, align 2, !tbaa !22
  %127 = zext i16 %126 to i64
  %128 = getelementptr inbounds %"struct.rw::Mesh", ptr %30, i64 %127, i32 1
  store i32 %123, ptr %128, align 8, !tbaa !29
  %129 = getelementptr inbounds i8, ptr %.167, i64 8
  %130 = add nuw nsw i32 %.04766, 1
  %exitcond77.not = icmp eq i32 %130, %90
  br i1 %exitcond77.not, label %.loopexit, label %.lr.ph69, !llvm.loop !37

131:                                              ; preds = %8
  tail call void @_ZN2rw8Geometry14buildTristripsEv(ptr noundef nonnull align 8 dereferenceable(168) %0)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph69, %._crit_edge65, %131, %5
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare noundef ptr @_ZN2rw8Geometry14allocateMeshesEiji(ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #6

declare void @_ZN2rw10MeshHeader12setupIndicesEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #6

declare void @_ZN2rw8Geometry14buildTristripsEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #6

attributes #0 = { 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 #1 = { inlinehint 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 #2 = { 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 #3 = { noreturn 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 #4 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { "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 = { cold nounwind }
attributes #8 = { noreturn 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 16}
!6 = !{!"_ZTSN2rw8GeometryE", !7, i64 0, !11, i64 16, !12, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !10, i64 40, !10, i64 48, !8, i64 56, !10, i64 120, !13, i64 128, !10, i64 144, !10, i64 152, !11, i64 160}
!7 = !{!"_ZTSN2rw6ObjectE", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !10, i64 8}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"_ZTSN2rw12MaterialListE", !10, i64 0, !11, i64 8, !11, i64 12}
!14 = !{!10, !10, i64 0}
!15 = !{!16, !10, i64 16}
!16 = !{!"_ZTSN2rw15MemoryFunctionsE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!17 = !{!6, !10, i64 144}
!18 = !{!6, !11, i64 136}
!19 = !{!6, !11, i64 24}
!20 = !{!6, !10, i64 40}
!21 = !{!6, !10, i64 128}
!22 = !{!23, !12, i64 6}
!23 = !{!"_ZTSN2rw8TriangleE", !8, i64 0, !12, i64 6}
!24 = !{!11, !11, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !10, i64 16}
!28 = !{!"_ZTSN2rw4MeshE", !10, i64 0, !11, i64 8, !10, i64 16}
!29 = !{!28, !11, i64 8}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.unroll.disable"}
!32 = distinct !{!32, !26}
!33 = distinct !{!33, !31}
!34 = distinct !{!34, !26}
!35 = !{!12, !12, i64 0}
!36 = !{!28, !10, i64 0}
!37 = distinct !{!37, !26}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass