; LLVM IR from jovanlanik/wip :: src/wip_mdl.ll_msh_ply (write_data_binary)

; 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.msh_ply_file = type { i32, i32, i32, ptr, ptr, ptr, i32, i32, i32 }
%struct.msh_ply_array_header = type { i64, i64 }
%struct.msh_ply_element = type { [64 x i8], i32, ptr, i64, ptr, i64 }
%struct.msh_ply_property = type { i32, i16, i32, i32, i16, i32, i32, i32, i32, i32, i64, [32 x i8], ptr, ptr }

@__func__.msh_ply__write_data_binary = external hidden unnamed_addr constant [27 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 uwtable
define dso_local i32 @msh_ply__write_data_binary(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i8, align 1
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #4
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.msh_ply_file, ptr %24, i32 0, i32 7
  %26 = load i32, ptr %25, align 4, !tbaa !9
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.msh_ply_file, ptr %27, i32 0, i32 1
  %29 = load i32, ptr %28, align 4, !tbaa !12
  %30 = icmp ne i32 %26, %29
  %31 = zext i1 %30 to i32
  %32 = trunc i32 %31 to i8
  store i8 %32, ptr %3, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store i64 0, ptr %4, align 8, !tbaa !14
  br label %33

33:                                               ; preds = %358, %1
  %34 = load i64, ptr %4, align 8, !tbaa !14
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.msh_ply_file, ptr %35, i32 0, i32 3
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %46

39:                                               ; preds = %33
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.msh_ply_file, ptr %40, i32 0, i32 3
  %42 = load ptr, ptr %41, align 8, !tbaa !16
  %43 = getelementptr inbounds i8, ptr %42, i64 -16
  %44 = getelementptr inbounds %struct.msh_ply_array_header, ptr %43, i32 0, i32 0
  %45 = load i64, ptr %44, align 8, !tbaa !17
  br label %47

46:                                               ; preds = %33
  br label %47

47:                                               ; preds = %46, %39
  %48 = phi i64 [ %45, %39 ], [ 0, %46 ]
  %49 = icmp ult i64 %34, %48
  br i1 %49, label %51, label %50

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

51:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.msh_ply_file, ptr %52, i32 0, i32 3
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  %55 = load i64, ptr %4, align 8, !tbaa !14
  %56 = getelementptr inbounds %struct.msh_ply_element, ptr %54, i64 %55
  store ptr %56, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store i64 0, ptr %7, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store i64 0, ptr %8, align 8, !tbaa !14
  br label %57

57:                                               ; preds = %85, %51
  %58 = load i64, ptr %8, align 8, !tbaa !14
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.msh_ply_element, ptr %59, i32 0, i32 2
  %61 = load ptr, ptr %60, align 8, !tbaa !19
  %62 = icmp ne ptr %61, null
  br i1 %62, label %63, label %70

63:                                               ; preds = %57
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.msh_ply_element, ptr %64, i32 0, i32 2
  %66 = load ptr, ptr %65, align 8, !tbaa !19
  %67 = getelementptr inbounds i8, ptr %66, i64 -16
  %68 = getelementptr inbounds %struct.msh_ply_array_header, ptr %67, i32 0, i32 0
  %69 = load i64, ptr %68, align 8, !tbaa !17
  br label %71

70:                                               ; preds = %57
  br label %71

71:                                               ; preds = %70, %63
  %72 = phi i64 [ %69, %63 ], [ 0, %70 ]
  %73 = icmp ult i64 %58, %72
  br i1 %73, label %75, label %74

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

75:                                               ; preds = %71
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.msh_ply_element, ptr %76, i32 0, i32 2
  %78 = load ptr, ptr %77, align 8, !tbaa !19
  %79 = load i64, ptr %8, align 8, !tbaa !14
  %80 = getelementptr inbounds %struct.msh_ply_property, ptr %78, i64 %79
  %81 = getelementptr inbounds %struct.msh_ply_property, ptr %80, i32 0, i32 10
  %82 = load i64, ptr %81, align 8, !tbaa !21
  %83 = load i64, ptr %7, align 8, !tbaa !14
  %84 = add i64 %83, %82
  store i64 %84, ptr %7, align 8, !tbaa !14
  br label %85

85:                                               ; preds = %75
  %86 = load i64, ptr %8, align 8, !tbaa !14
  %87 = add i64 %86, 1
  store i64 %87, ptr %8, align 8, !tbaa !14
  br label %57, !llvm.loop !24

88:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %89 = load i64, ptr %7, align 8, !tbaa !14
  %90 = call ptr @_wip_alloc(i64 noundef %89, ptr noundef @__func__.msh_ply__write_data_binary)
  store ptr %90, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store i64 0, ptr %10, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 0, ptr %11, align 8, !tbaa !14
  br label %91

91:                                               ; preds = %325, %88
  %92 = load i64, ptr %11, align 8, !tbaa !14
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.msh_ply_element, ptr %93, i32 0, i32 1
  %95 = load i32, ptr %94, align 8, !tbaa !26
  %96 = sext i32 %95 to i64
  %97 = icmp ult i64 %92, %96
  br i1 %97, label %99, label %98

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

99:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store i64 0, ptr %12, align 8, !tbaa !14
  br label %100

100:                                              ; preds = %321, %99
  %101 = load i64, ptr %12, align 8, !tbaa !14
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.msh_ply_element, ptr %102, i32 0, i32 2
  %104 = load ptr, ptr %103, align 8, !tbaa !19
  %105 = icmp ne ptr %104, null
  br i1 %105, label %106, label %113

106:                                              ; preds = %100
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.msh_ply_element, ptr %107, i32 0, i32 2
  %109 = load ptr, ptr %108, align 8, !tbaa !19
  %110 = getelementptr inbounds i8, ptr %109, i64 -16
  %111 = getelementptr inbounds %struct.msh_ply_array_header, ptr %110, i32 0, i32 0
  %112 = load i64, ptr %111, align 8, !tbaa !17
  br label %114

113:                                              ; preds = %100
  br label %114

114:                                              ; preds = %113, %106
  %115 = phi i64 [ %112, %106 ], [ 0, %113 ]
  %116 = icmp ult i64 %101, %115
  br i1 %116, label %118, label %117

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

118:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.msh_ply_element, ptr %119, i32 0, i32 2
  %121 = load ptr, ptr %120, align 8, !tbaa !19
  %122 = load i64, ptr %12, align 8, !tbaa !14
  %123 = getelementptr inbounds %struct.msh_ply_property, ptr %121, i64 %122
  store ptr %123, ptr %13, align 8, !tbaa !5
  %124 = load ptr, ptr %13, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.msh_ply_property, ptr %124, i32 0, i32 8
  %126 = load i32, ptr %125, align 8, !tbaa !27
  %127 = icmp eq i32 %126, 0
  br i1 %127, label %128, label %156

128:                                              ; preds = %118
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = load i64, ptr %10, align 8, !tbaa !14
  %131 = getelementptr inbounds i8, ptr %129, i64 %130
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.msh_ply_property, ptr %132, i32 0, i32 12
  %134 = load ptr, ptr %133, align 8, !tbaa !28
  %135 = load ptr, ptr %13, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.msh_ply_property, ptr %135, i32 0, i32 2
  %137 = load i32, ptr %136, align 8, !tbaa !29
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i8, ptr %134, i64 %138
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.msh_ply_property, ptr %140, i32 0, i32 7
  %142 = load i32, ptr %141, align 4, !tbaa !30
  call void @msh_ply__data_assign(ptr noundef %131, ptr noundef %139, i32 noundef %142, i32 noundef 1)
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.msh_ply_property, ptr %143, i32 0, i32 3
  %145 = load i32, ptr %144, align 4, !tbaa !31
  %146 = load ptr, ptr %13, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.msh_ply_property, ptr %146, i32 0, i32 2
  %148 = load i32, ptr %147, align 8, !tbaa !29
  %149 = add nsw i32 %148, %145
  store i32 %149, ptr %147, align 8, !tbaa !29
  %150 = load ptr, ptr %13, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.msh_ply_property, ptr %150, i32 0, i32 1
  %152 = load i16, ptr %151, align 4, !tbaa !32
  %153 = sext i16 %152 to i64
  %154 = load i64, ptr %10, align 8, !tbaa !14
  %155 = add nsw i64 %154, %153
  store i64 %155, ptr %10, align 8, !tbaa !14
  br label %320

156:                                              ; preds = %118
  %157 = load ptr, ptr %13, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.msh_ply_property, ptr %157, i32 0, i32 0
  %159 = load i32, ptr %158, align 8, !tbaa !33
  %160 = icmp ne i32 %159, 0
  br i1 %160, label %212, label %161

161:                                              ; preds = %156
  %162 = load ptr, ptr %13, align 8, !tbaa !5
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.msh_ply_element, ptr %163, i32 0, i32 2
  %165 = load ptr, ptr %164, align 8, !tbaa !19
  %166 = load i8, ptr %3, align 1, !tbaa !13
  %167 = call i32 @msh_ply__calculate_list_property_stride(ptr noundef %162, ptr noundef %165, i8 noundef signext %166)
  %168 = load ptr, ptr %13, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.msh_ply_property, ptr %168, i32 0, i32 3
  store i32 %167, ptr %169, align 4, !tbaa !31
  %170 = load ptr, ptr %13, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.msh_ply_property, ptr %170, i32 0, i32 13
  %172 = load ptr, ptr %171, align 8, !tbaa !34
  %173 = load ptr, ptr %13, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.msh_ply_property, ptr %173, i32 0, i32 5
  %175 = load i32, ptr %174, align 4, !tbaa !35
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds i8, ptr %172, i64 %176
  %178 = load ptr, ptr %13, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.msh_ply_property, ptr %178, i32 0, i32 8
  %180 = load i32, ptr %179, align 8, !tbaa !27
  %181 = load i8, ptr %3, align 1, !tbaa !13
  %182 = call i32 @msh_ply__get_data_as_int(ptr noundef %177, i32 noundef %180, i8 noundef signext %181)
  %183 = load ptr, ptr %13, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.msh_ply_property, ptr %183, i32 0, i32 0
  store i32 %182, ptr %184, align 8, !tbaa !33
  %185 = load ptr, ptr %9, align 8, !tbaa !5
  %186 = load i64, ptr %10, align 8, !tbaa !14
  %187 = getelementptr inbounds i8, ptr %185, i64 %186
  %188 = load ptr, ptr %13, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.msh_ply_property, ptr %188, i32 0, i32 13
  %190 = load ptr, ptr %189, align 8, !tbaa !34
  %191 = load ptr, ptr %13, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.msh_ply_property, ptr %191, i32 0, i32 5
  %193 = load i32, ptr %192, align 4, !tbaa !35
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds i8, ptr %190, i64 %194
  %196 = load ptr, ptr %13, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.msh_ply_property, ptr %196, i32 0, i32 8
  %198 = load i32, ptr %197, align 8, !tbaa !27
  call void @msh_ply__data_assign(ptr noundef %187, ptr noundef %195, i32 noundef %198, i32 noundef 1)
  %199 = load ptr, ptr %13, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.msh_ply_property, ptr %199, i32 0, i32 6
  %201 = load i32, ptr %200, align 8, !tbaa !36
  %202 = load ptr, ptr %13, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.msh_ply_property, ptr %202, i32 0, i32 5
  %204 = load i32, ptr %203, align 4, !tbaa !35
  %205 = add nsw i32 %204, %201
  store i32 %205, ptr %203, align 4, !tbaa !35
  %206 = load ptr, ptr %13, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.msh_ply_property, ptr %206, i32 0, i32 4
  %208 = load i16, ptr %207, align 8, !tbaa !37
  %209 = sext i16 %208 to i64
  %210 = load i64, ptr %10, align 8, !tbaa !14
  %211 = add nsw i64 %210, %209
  store i64 %211, ptr %10, align 8, !tbaa !14
  br label %284

212:                                              ; preds = %156
  %213 = load ptr, ptr %13, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.msh_ply_property, ptr %213, i32 0, i32 8
  %215 = load i32, ptr %214, align 8, !tbaa !27
  switch i32 %215, label %268 [
    i32 2, label %216
    i32 4, label %225
    i32 6, label %234
    i32 1, label %242
    i32 3, label %251
    i32 5, label %260
  ]

216:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %217 = load ptr, ptr %9, align 8, !tbaa !5
  %218 = load i64, ptr %10, align 8, !tbaa !14
  %219 = getelementptr inbounds i8, ptr %217, i64 %218
  store ptr %219, ptr %14, align 8, !tbaa !5
  %220 = load ptr, ptr %13, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.msh_ply_property, ptr %220, i32 0, i32 0
  %222 = load i32, ptr %221, align 8, !tbaa !33
  %223 = trunc i32 %222 to i8
  %224 = load ptr, ptr %14, align 8, !tbaa !5
  store i8 %223, ptr %224, align 1, !tbaa !13
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %277

225:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %226 = load ptr, ptr %9, align 8, !tbaa !5
  %227 = load i64, ptr %10, align 8, !tbaa !14
  %228 = getelementptr inbounds i16, ptr %226, i64 %227
  store ptr %228, ptr %15, align 8, !tbaa !5
  %229 = load ptr, ptr %13, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.msh_ply_property, ptr %229, i32 0, i32 0
  %231 = load i32, ptr %230, align 8, !tbaa !33
  %232 = trunc i32 %231 to i16
  %233 = load ptr, ptr %15, align 8, !tbaa !5
  store i16 %232, ptr %233, align 2, !tbaa !38
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %277

234:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %235 = load ptr, ptr %9, align 8, !tbaa !5
  %236 = load i64, ptr %10, align 8, !tbaa !14
  %237 = getelementptr inbounds i32, ptr %235, i64 %236
  store ptr %237, ptr %16, align 8, !tbaa !5
  %238 = load ptr, ptr %13, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.msh_ply_property, ptr %238, i32 0, i32 0
  %240 = load i32, ptr %239, align 8, !tbaa !33
  %241 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %240, ptr %241, align 4, !tbaa !39
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %277

242:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %243 = load ptr, ptr %9, align 8, !tbaa !5
  %244 = load i64, ptr %10, align 8, !tbaa !14
  %245 = getelementptr inbounds i8, ptr %243, i64 %244
  store ptr %245, ptr %17, align 8, !tbaa !5
  %246 = load ptr, ptr %13, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.msh_ply_property, ptr %246, i32 0, i32 0
  %248 = load i32, ptr %247, align 8, !tbaa !33
  %249 = trunc i32 %248 to i8
  %250 = load ptr, ptr %17, align 8, !tbaa !5
  store i8 %249, ptr %250, align 1, !tbaa !13
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %277

251:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %252 = load ptr, ptr %9, align 8, !tbaa !5
  %253 = load i64, ptr %10, align 8, !tbaa !14
  %254 = getelementptr inbounds i16, ptr %252, i64 %253
  store ptr %254, ptr %18, align 8, !tbaa !5
  %255 = load ptr, ptr %13, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.msh_ply_property, ptr %255, i32 0, i32 0
  %257 = load i32, ptr %256, align 8, !tbaa !33
  %258 = trunc i32 %257 to i16
  %259 = load ptr, ptr %18, align 8, !tbaa !5
  store i16 %258, ptr %259, align 2, !tbaa !38
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %277

260:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %261 = load ptr, ptr %9, align 8, !tbaa !5
  %262 = load i64, ptr %10, align 8, !tbaa !14
  %263 = getelementptr inbounds i32, ptr %261, i64 %262
  store ptr %263, ptr %19, align 8, !tbaa !5
  %264 = load ptr, ptr %13, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.msh_ply_property, ptr %264, i32 0, i32 0
  %266 = load i32, ptr %265, align 8, !tbaa !33
  %267 = load ptr, ptr %19, align 8, !tbaa !5
  store i32 %266, ptr %267, align 4, !tbaa !39
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %277

268:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %269 = load ptr, ptr %9, align 8, !tbaa !5
  %270 = load i64, ptr %10, align 8, !tbaa !14
  %271 = getelementptr inbounds i8, ptr %269, i64 %270
  store ptr %271, ptr %20, align 8, !tbaa !5
  %272 = load ptr, ptr %13, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.msh_ply_property, ptr %272, i32 0, i32 0
  %274 = load i32, ptr %273, align 8, !tbaa !33
  %275 = trunc i32 %274 to i8
  %276 = load ptr, ptr %20, align 8, !tbaa !5
  store i8 %275, ptr %276, align 1, !tbaa !13
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %277

277:                                              ; preds = %268, %260, %251, %242, %234, %225, %216
  %278 = load ptr, ptr %13, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.msh_ply_property, ptr %278, i32 0, i32 4
  %280 = load i16, ptr %279, align 8, !tbaa !37
  %281 = sext i16 %280 to i64
  %282 = load i64, ptr %10, align 8, !tbaa !14
  %283 = add nsw i64 %282, %281
  store i64 %283, ptr %10, align 8, !tbaa !14
  br label %284

284:                                              ; preds = %277, %161
  %285 = load ptr, ptr %9, align 8, !tbaa !5
  %286 = load i64, ptr %10, align 8, !tbaa !14
  %287 = getelementptr inbounds i8, ptr %285, i64 %286
  %288 = load ptr, ptr %13, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.msh_ply_property, ptr %288, i32 0, i32 12
  %290 = load ptr, ptr %289, align 8, !tbaa !28
  %291 = load ptr, ptr %13, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.msh_ply_property, ptr %291, i32 0, i32 2
  %293 = load i32, ptr %292, align 8, !tbaa !29
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds i8, ptr %290, i64 %294
  %296 = load ptr, ptr %13, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.msh_ply_property, ptr %296, i32 0, i32 7
  %298 = load i32, ptr %297, align 4, !tbaa !30
  %299 = load ptr, ptr %13, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.msh_ply_property, ptr %299, i32 0, i32 0
  %301 = load i32, ptr %300, align 8, !tbaa !33
  call void @msh_ply__data_assign(ptr noundef %287, ptr noundef %295, i32 noundef %298, i32 noundef %301)
  %302 = load ptr, ptr %13, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.msh_ply_property, ptr %302, i32 0, i32 3
  %304 = load i32, ptr %303, align 4, !tbaa !31
  %305 = load ptr, ptr %13, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.msh_ply_property, ptr %305, i32 0, i32 2
  %307 = load i32, ptr %306, align 8, !tbaa !29
  %308 = add nsw i32 %307, %304
  store i32 %308, ptr %306, align 8, !tbaa !29
  %309 = load ptr, ptr %13, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.msh_ply_property, ptr %309, i32 0, i32 1
  %311 = load i16, ptr %310, align 4, !tbaa !32
  %312 = sext i16 %311 to i32
  %313 = load ptr, ptr %13, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.msh_ply_property, ptr %313, i32 0, i32 0
  %315 = load i32, ptr %314, align 8, !tbaa !33
  %316 = mul nsw i32 %312, %315
  %317 = sext i32 %316 to i64
  %318 = load i64, ptr %10, align 8, !tbaa !14
  %319 = add nsw i64 %318, %317
  store i64 %319, ptr %10, align 8, !tbaa !14
  br label %320

320:                                              ; preds = %284, %128
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %321

321:                                              ; preds = %320
  %322 = load i64, ptr %12, align 8, !tbaa !14
  %323 = add i64 %322, 1
  store i64 %323, ptr %12, align 8, !tbaa !14
  br label %100, !llvm.loop !40

324:                                              ; preds = %117
  br label %325

325:                                              ; preds = %324
  %326 = load i64, ptr %11, align 8, !tbaa !14
  %327 = add i64 %326, 1
  store i64 %327, ptr %11, align 8, !tbaa !14
  br label %91, !llvm.loop !41

328:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  store i64 2097152, ptr %21, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %329 = load i64, ptr %7, align 8, !tbaa !14
  store i64 %329, ptr %22, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %330 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %330, ptr %23, align 8, !tbaa !5
  br label %331

331:                                              ; preds = %337, %328
  br label %332

332:                                              ; preds = %331
  %333 = load i64, ptr %22, align 8, !tbaa !14
  %334 = load i64, ptr %21, align 8, !tbaa !14
  %335 = icmp ult i64 %333, %334
  br i1 %335, label %336, label %337

336:                                              ; preds = %332
  br label %350

337:                                              ; preds = %332
  %338 = load ptr, ptr %23, align 8, !tbaa !5
  %339 = load i64, ptr %21, align 8, !tbaa !14
  %340 = load ptr, ptr %2, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.msh_ply_file, ptr %340, i32 0, i32 5
  %342 = load ptr, ptr %341, align 8, !tbaa !42
  %343 = call i64 @fwrite(ptr noundef %338, i64 noundef %339, i64 noundef 1, ptr noundef %342)
  %344 = load i64, ptr %21, align 8, !tbaa !14
  %345 = load ptr, ptr %23, align 8, !tbaa !5
  %346 = getelementptr inbounds i8, ptr %345, i64 %344
  store ptr %346, ptr %23, align 8, !tbaa !5
  %347 = load i64, ptr %21, align 8, !tbaa !14
  %348 = load i64, ptr %22, align 8, !tbaa !14
  %349 = sub i64 %348, %347
  store i64 %349, ptr %22, align 8, !tbaa !14
  br label %331

350:                                              ; preds = %336
  %351 = load ptr, ptr %23, align 8, !tbaa !5
  %352 = load i64, ptr %22, align 8, !tbaa !14
  %353 = load ptr, ptr %2, align 8, !tbaa !5
  %354 = getelementptr inbounds %struct.msh_ply_file, ptr %353, i32 0, i32 5
  %355 = load ptr, ptr %354, align 8, !tbaa !42
  %356 = call i64 @fwrite(ptr noundef %351, i64 noundef %352, i64 noundef 1, ptr noundef %355)
  %357 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_wip_free(ptr noundef %357, ptr noundef @__func__.msh_ply__write_data_binary)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %358

358:                                              ; preds = %350
  %359 = load i64, ptr %4, align 8, !tbaa !14
  %360 = add i64 %359, 1
  store i64 %360, ptr %4, align 8, !tbaa !14
  br label %33, !llvm.loop !43

361:                                              ; preds = %50
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #4
  ret i32 0
}

declare ptr @_wip_alloc(i64 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @msh_ply__data_assign(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @msh_ply__calculate_list_property_stride(ptr noundef, ptr noundef, i8 noundef signext) #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @msh_ply__get_data_as_int(ptr noundef, i32 noundef, i8 noundef signext) #3

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

declare void @_wip_free(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { alwaysinline 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 #4 = { 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/C++ TBAA"}
!9 = !{!10, !11, i64 44}
!10 = !{!"msh_ply_file", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44, !11, i64 48}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!10, !6, i64 16}
!17 = !{!18, !15, i64 0}
!18 = !{!"msh_ply_array_header", !15, i64 0, !15, i64 8}
!19 = !{!20, !6, i64 72}
!20 = !{!"msh_ply_element", !7, i64 0, !11, i64 64, !6, i64 72, !15, i64 80, !6, i64 88, !15, i64 96}
!21 = !{!22, !15, i64 40}
!22 = !{!"msh_ply_property", !11, i64 0, !23, i64 4, !11, i64 8, !11, i64 12, !23, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !15, i64 40, !7, i64 48, !6, i64 80, !6, i64 88}
!23 = !{!"short", !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!20, !11, i64 64}
!27 = !{!22, !11, i64 32}
!28 = !{!22, !6, i64 80}
!29 = !{!22, !11, i64 8}
!30 = !{!22, !11, i64 28}
!31 = !{!22, !11, i64 12}
!32 = !{!22, !23, i64 4}
!33 = !{!22, !11, i64 0}
!34 = !{!22, !6, i64 88}
!35 = !{!22, !11, i64 20}
!36 = !{!22, !11, i64 24}
!37 = !{!22, !23, i64 16}
!38 = !{!23, !23, i64 0}
!39 = !{!11, !11, i64 0}
!40 = distinct !{!40, !25}
!41 = distinct !{!41, !25}
!42 = !{!10, !6, i64 32}
!43 = distinct !{!43, !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.msh_ply_element = type { [64 x i8], i32, ptr, i64, ptr, i64 }
%struct.msh_ply_property = type { i32, i16, i32, i32, i16, i32, i32, i32, i32, i32, i64, [32 x i8], ptr, ptr }

@__func__.msh_ply__write_data_binary = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @msh_ply__write_data_binary(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 44
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 4
  %5 = load i32, ptr %4, align 4, !tbaa !11
  %6 = icmp ne i32 %3, %5
  %7 = zext i1 %6 to i8
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  br label %10

10:                                               ; preds = %._crit_edge, %1
  %.0111 = phi i64 [ 0, %1 ], [ %160, %._crit_edge ]
  %11 = load ptr, ptr %8, align 8, !tbaa !12
  %.not = icmp eq ptr %11, null
  br i1 %.not, label %15, label %12

12:                                               ; preds = %10
  %13 = getelementptr inbounds i8, ptr %11, i64 -16
  %14 = load i64, ptr %13, align 8, !tbaa !13
  br label %15

15:                                               ; preds = %10, %12
  %16 = phi i64 [ %14, %12 ], [ 0, %10 ]
  %17 = icmp ult i64 %.0111, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %15
  ret i32 0

19:                                               ; preds = %15
  %20 = getelementptr inbounds %struct.msh_ply_element, ptr %11, i64 %.0111
  %21 = getelementptr inbounds i8, ptr %20, i64 72
  %22 = load ptr, ptr %21, align 8, !tbaa !16
  %.not122 = icmp eq ptr %22, null
  br i1 %.not122, label %.split127.us, label %.split

.split:                                           ; preds = %19
  %23 = getelementptr inbounds i8, ptr %22, i64 -16
  %24 = load i64, ptr %23, align 8, !tbaa !13
  %.not141 = icmp eq i64 %24, 0
  br i1 %.not141, label %.split127.us, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.split
  %xtraiter = and i64 %24, 3
  %25 = icmp ult i64 %24, 4
  br i1 %25, label %.split127.us.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %24, -4
  br label %.lr.ph

.split127.us.loopexit.unr-lcssa:                  ; preds = %.lr.ph, %.lr.ph.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph.preheader ], [ %47, %.lr.ph ]
  %.0112129.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %47, %.lr.ph ]
  %.0113128.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %48, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.split127.us, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.split127.us.loopexit.unr-lcssa, %.lr.ph.epil
  %.0112129.epil = phi i64 [ %28, %.lr.ph.epil ], [ %.0112129.unr, %.split127.us.loopexit.unr-lcssa ]
  %.0113128.epil = phi i64 [ %29, %.lr.ph.epil ], [ %.0113128.unr, %.split127.us.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.split127.us.loopexit.unr-lcssa ]
  %26 = getelementptr inbounds %struct.msh_ply_property, ptr %22, i64 %.0113128.epil, i32 10
  %27 = load i64, ptr %26, align 8, !tbaa !18
  %28 = add i64 %27, %.0112129.epil
  %29 = add nuw i64 %.0113128.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 %.split127.us, label %.lr.ph.epil, !llvm.loop !21

.split127.us:                                     ; preds = %.split127.us.loopexit.unr-lcssa, %.lr.ph.epil, %.split, %19
  %.us-phi = phi i64 [ 0, %19 ], [ 0, %.split ], [ %.lcssa.ph, %.split127.us.loopexit.unr-lcssa ], [ %28, %.lr.ph.epil ]
  %30 = tail call ptr @_wip_alloc(i64 noundef %.us-phi, ptr noundef nonnull @__func__.msh_ply__write_data_binary) #4
  %31 = getelementptr inbounds i8, ptr %20, i64 64
  %32 = load i32, ptr %31, align 8, !tbaa !23
  %.not142 = icmp eq i32 %32, 0
  br i1 %.not142, label %.preheader125, label %.preheader

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.0112129 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %47, %.lr.ph ]
  %.0113128 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %48, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %33 = getelementptr inbounds %struct.msh_ply_property, ptr %22, i64 %.0113128, i32 10
  %34 = load i64, ptr %33, align 8, !tbaa !18
  %35 = add i64 %34, %.0112129
  %36 = or disjoint i64 %.0113128, 1
  %37 = getelementptr inbounds %struct.msh_ply_property, ptr %22, i64 %36, i32 10
  %38 = load i64, ptr %37, align 8, !tbaa !18
  %39 = add i64 %38, %35
  %40 = or disjoint i64 %.0113128, 2
  %41 = getelementptr inbounds %struct.msh_ply_property, ptr %22, i64 %40, i32 10
  %42 = load i64, ptr %41, align 8, !tbaa !18
  %43 = add i64 %42, %39
  %44 = or disjoint i64 %.0113128, 3
  %45 = getelementptr inbounds %struct.msh_ply_property, ptr %22, i64 %44, i32 10
  %46 = load i64, ptr %45, align 8, !tbaa !18
  %47 = add i64 %46, %43
  %48 = add nuw i64 %.0113128, 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 %.split127.us.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !24

.preheader125:                                    ; preds = %58, %.split127.us
  %49 = icmp ult i64 %.us-phi, 2097152
  br i1 %49, label %._crit_edge, label %.lr.ph138

.preheader:                                       ; preds = %.split127.us, %58
  %.0114135 = phi i64 [ %.1, %58 ], [ 0, %.split127.us ]
  %.0115134 = phi i64 [ %59, %58 ], [ 0, %.split127.us ]
  br label %50

50:                                               ; preds = %.preheader, %151
  %.0116 = phi i64 [ %152, %151 ], [ 0, %.preheader ]
  %.1 = phi i64 [ %.3, %151 ], [ %.0114135, %.preheader ]
  %51 = load ptr, ptr %21, align 8, !tbaa !16
  %.not123 = icmp eq ptr %51, null
  br i1 %.not123, label %55, label %52

52:                                               ; preds = %50
  %53 = getelementptr inbounds i8, ptr %51, i64 -16
  %54 = load i64, ptr %53, align 8, !tbaa !13
  br label %55

55:                                               ; preds = %50, %52
  %56 = phi i64 [ %54, %52 ], [ 0, %50 ]
  %57 = icmp ult i64 %.0116, %56
  br i1 %57, label %63, label %58

58:                                               ; preds = %55
  %59 = add nuw i64 %.0115134, 1
  %60 = load i32, ptr %31, align 8, !tbaa !23
  %61 = sext i32 %60 to i64
  %62 = icmp ult i64 %59, %61
  br i1 %62, label %.preheader, label %.preheader125, !llvm.loop !26

63:                                               ; preds = %55
  %64 = getelementptr inbounds %struct.msh_ply_property, ptr %51, i64 %.0116
  %65 = getelementptr inbounds i8, ptr %64, i64 32
  %66 = load i32, ptr %65, align 8, !tbaa !27
  %67 = icmp eq i32 %66, 0
  br i1 %67, label %68, label %86

68:                                               ; preds = %63
  %69 = getelementptr inbounds i8, ptr %30, i64 %.1
  %70 = getelementptr inbounds i8, ptr %64, i64 80
  %71 = load ptr, ptr %70, align 8, !tbaa !28
  %72 = getelementptr inbounds i8, ptr %64, i64 8
  %73 = load i32, ptr %72, align 8, !tbaa !29
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %71, i64 %74
  %76 = getelementptr inbounds i8, ptr %64, i64 28
  %77 = load i32, ptr %76, align 4, !tbaa !30
  tail call void @msh_ply__data_assign(ptr noundef %69, ptr noundef %75, i32 noundef %77, i32 noundef 1)
  %78 = getelementptr inbounds i8, ptr %64, i64 12
  %79 = load i32, ptr %78, align 4, !tbaa !31
  %80 = load i32, ptr %72, align 8, !tbaa !29
  %81 = add nsw i32 %80, %79
  store i32 %81, ptr %72, align 8, !tbaa !29
  %82 = getelementptr inbounds i8, ptr %64, i64 4
  %83 = load i16, ptr %82, align 4, !tbaa !32
  %84 = sext i16 %83 to i64
  %85 = add nsw i64 %.1, %84
  br label %151

86:                                               ; preds = %63
  %87 = load i32, ptr %64, align 8, !tbaa !33
  %.not124 = icmp eq i32 %87, 0
  br i1 %.not124, label %88, label %109

88:                                               ; preds = %86
  %89 = tail call i32 @msh_ply__calculate_list_property_stride(ptr noundef nonnull %64, ptr noundef nonnull %51, i8 noundef signext %7)
  %90 = getelementptr inbounds i8, ptr %64, i64 12
  store i32 %89, ptr %90, align 4, !tbaa !31
  %91 = getelementptr inbounds i8, ptr %64, i64 88
  %92 = load ptr, ptr %91, align 8, !tbaa !34
  %93 = getelementptr inbounds i8, ptr %64, i64 20
  %94 = load i32, ptr %93, align 4, !tbaa !35
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i8, ptr %92, i64 %95
  %97 = load i32, ptr %65, align 8, !tbaa !27
  %98 = tail call i32 @msh_ply__get_data_as_int(ptr noundef %96, i32 noundef %97, i8 noundef signext %7)
  store i32 %98, ptr %64, align 8, !tbaa !33
  %99 = getelementptr inbounds i8, ptr %30, i64 %.1
  %100 = load ptr, ptr %91, align 8, !tbaa !34
  %101 = load i32, ptr %93, align 4, !tbaa !35
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i8, ptr %100, i64 %102
  %104 = load i32, ptr %65, align 8, !tbaa !27
  tail call void @msh_ply__data_assign(ptr noundef %99, ptr noundef %103, i32 noundef %104, i32 noundef 1)
  %105 = getelementptr inbounds i8, ptr %64, i64 24
  %106 = load i32, ptr %105, align 8, !tbaa !36
  %107 = load i32, ptr %93, align 4, !tbaa !35
  %108 = add nsw i32 %107, %106
  store i32 %108, ptr %93, align 4, !tbaa !35
  br label %129

109:                                              ; preds = %86
  switch i32 %66, label %126 [
    i32 2, label %110
    i32 4, label %113
    i32 6, label %116
    i32 1, label %118
    i32 3, label %121
    i32 5, label %124
  ]

110:                                              ; preds = %109
  %111 = getelementptr inbounds i8, ptr %30, i64 %.1
  %112 = trunc i32 %87 to i8
  store i8 %112, ptr %111, align 1, !tbaa !37
  br label %129

113:                                              ; preds = %109
  %114 = getelementptr inbounds i16, ptr %30, i64 %.1
  %115 = trunc i32 %87 to i16
  store i16 %115, ptr %114, align 2, !tbaa !38
  br label %129

116:                                              ; preds = %109
  %117 = getelementptr inbounds i32, ptr %30, i64 %.1
  store i32 %87, ptr %117, align 4, !tbaa !39
  br label %129

118:                                              ; preds = %109
  %119 = getelementptr inbounds i8, ptr %30, i64 %.1
  %120 = trunc i32 %87 to i8
  store i8 %120, ptr %119, align 1, !tbaa !37
  br label %129

121:                                              ; preds = %109
  %122 = getelementptr inbounds i16, ptr %30, i64 %.1
  %123 = trunc i32 %87 to i16
  store i16 %123, ptr %122, align 2, !tbaa !38
  br label %129

124:                                              ; preds = %109
  %125 = getelementptr inbounds i32, ptr %30, i64 %.1
  store i32 %87, ptr %125, align 4, !tbaa !39
  br label %129

126:                                              ; preds = %109
  %127 = getelementptr inbounds i8, ptr %30, i64 %.1
  %128 = trunc i32 %87 to i8
  store i8 %128, ptr %127, align 1, !tbaa !37
  br label %129

129:                                              ; preds = %110, %113, %116, %118, %121, %124, %126, %88
  %.pn.in.in = getelementptr inbounds i8, ptr %64, i64 16
  %.pn.in = load i16, ptr %.pn.in.in, align 8, !tbaa !40
  %.pn = sext i16 %.pn.in to i64
  %.2 = add nsw i64 %.1, %.pn
  %130 = getelementptr inbounds i8, ptr %30, i64 %.2
  %131 = getelementptr inbounds i8, ptr %64, i64 80
  %132 = load ptr, ptr %131, align 8, !tbaa !28
  %133 = getelementptr inbounds i8, ptr %64, i64 8
  %134 = load i32, ptr %133, align 8, !tbaa !29
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds i8, ptr %132, i64 %135
  %137 = getelementptr inbounds i8, ptr %64, i64 28
  %138 = load i32, ptr %137, align 4, !tbaa !30
  %139 = load i32, ptr %64, align 8, !tbaa !33
  tail call void @msh_ply__data_assign(ptr noundef %130, ptr noundef %136, i32 noundef %138, i32 noundef %139)
  %140 = getelementptr inbounds i8, ptr %64, i64 12
  %141 = load i32, ptr %140, align 4, !tbaa !31
  %142 = load i32, ptr %133, align 8, !tbaa !29
  %143 = add nsw i32 %142, %141
  store i32 %143, ptr %133, align 8, !tbaa !29
  %144 = getelementptr inbounds i8, ptr %64, i64 4
  %145 = load i16, ptr %144, align 4, !tbaa !32
  %146 = sext i16 %145 to i32
  %147 = load i32, ptr %64, align 8, !tbaa !33
  %148 = mul nsw i32 %147, %146
  %149 = sext i32 %148 to i64
  %150 = add nsw i64 %.2, %149
  br label %151

151:                                              ; preds = %129, %68
  %.3 = phi i64 [ %85, %68 ], [ %150, %129 ]
  %152 = add nuw i64 %.0116, 1
  br label %50, !llvm.loop !41

.lr.ph138:                                        ; preds = %.preheader125, %.lr.ph138
  %.0137 = phi ptr [ %155, %.lr.ph138 ], [ %30, %.preheader125 ]
  %.0110136 = phi i64 [ %156, %.lr.ph138 ], [ %.us-phi, %.preheader125 ]
  %153 = load ptr, ptr %9, align 8, !tbaa !42
  %154 = tail call i64 @fwrite(ptr noundef %.0137, i64 noundef 2097152, i64 noundef 1, ptr noundef %153)
  %155 = getelementptr inbounds i8, ptr %.0137, i64 2097152
  %156 = add i64 %.0110136, -2097152
  %157 = icmp ult i64 %156, 2097152
  br i1 %157, label %._crit_edge, label %.lr.ph138

._crit_edge:                                      ; preds = %.lr.ph138, %.preheader125
  %.0110.lcssa = phi i64 [ %.us-phi, %.preheader125 ], [ %156, %.lr.ph138 ]
  %.0.lcssa = phi ptr [ %30, %.preheader125 ], [ %155, %.lr.ph138 ]
  %158 = load ptr, ptr %9, align 8, !tbaa !42
  %159 = tail call i64 @fwrite(ptr noundef %.0.lcssa, i64 noundef %.0110.lcssa, i64 noundef 1, ptr noundef %158)
  tail call void @_wip_free(ptr noundef %30, ptr noundef nonnull @__func__.msh_ply__write_data_binary) #4
  %160 = add i64 %.0111, 1
  br label %10, !llvm.loop !43
}

declare ptr @_wip_alloc(i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @msh_ply__data_assign(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @msh_ply__calculate_list_property_stride(ptr noundef, ptr noundef, i8 noundef signext) local_unnamed_addr #0

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @msh_ply__get_data_as_int(ptr noundef, i32 noundef, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

declare void @_wip_free(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { "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 = { alwaysinline 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 = { 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 #4 = { 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, !7, i64 44}
!6 = !{!"msh_ply_file", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !7, i64 44, !7, i64 48}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !10, i64 16}
!13 = !{!14, !15, i64 0}
!14 = !{!"msh_ply_array_header", !15, i64 0, !15, i64 8}
!15 = !{!"long", !8, i64 0}
!16 = !{!17, !10, i64 72}
!17 = !{!"msh_ply_element", !8, i64 0, !7, i64 64, !10, i64 72, !15, i64 80, !10, i64 88, !15, i64 96}
!18 = !{!19, !15, i64 40}
!19 = !{!"msh_ply_property", !7, i64 0, !20, i64 4, !7, i64 8, !7, i64 12, !20, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !15, i64 40, !8, i64 48, !10, i64 80, !10, i64 88}
!20 = !{!"short", !8, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}
!23 = !{!17, !7, i64 64}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = !{!19, !7, i64 32}
!28 = !{!19, !10, i64 80}
!29 = !{!19, !7, i64 8}
!30 = !{!19, !7, i64 28}
!31 = !{!19, !7, i64 12}
!32 = !{!19, !20, i64 4}
!33 = !{!19, !7, i64 0}
!34 = !{!19, !10, i64 88}
!35 = !{!19, !7, i64 20}
!36 = !{!19, !7, i64 24}
!37 = !{!8, !8, i64 0}
!38 = !{!20, !20, i64 0}
!39 = !{!7, !7, i64 0}
!40 = !{!19, !20, i64 16}
!41 = distinct !{!41, !25}
!42 = !{!6, !10, i64 32}
!43 = distinct !{!43, !25}


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