; LLVM IR from pms67/HadesFCS :: Firmware/F4/HadesF4Testbed_RTOS/Core/Src (GPSNMEAParser)

; 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.GPSData = type { float, float, float, float, float, float, float, i8, i8, i8, i8, i8, i32, i8, i8, [6 x i8], i8, [16 x i8], i8, i8 }

; Function Attrs: nounwind uwtable
define dso_local void @GPSNMEAParser_ExtractGGA(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca [2 x i8], align 1
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca [3 x i8], align 1
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.GPSData, ptr %17, i32 0, i32 19
  %19 = load i8, ptr %18, align 2, !tbaa !9
  %20 = zext i8 %19 to i32
  %21 = icmp eq i32 %20, 2
  br i1 %21, label %22, label %73

22:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 2, ptr %3) #4
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.GPSData, ptr %23, i32 0, i32 17
  %25 = getelementptr inbounds [16 x i8], ptr %24, i64 0, i64 0
  %26 = load i8, ptr %25, align 1, !tbaa !13
  store i8 %26, ptr %3, align 1, !tbaa !13
  %27 = getelementptr inbounds i8, ptr %3, i64 1
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.GPSData, ptr %28, i32 0, i32 17
  %30 = getelementptr inbounds [16 x i8], ptr %29, i64 0, i64 1
  %31 = load i8, ptr %30, align 1, !tbaa !13
  store i8 %31, ptr %27, align 1, !tbaa !13
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.GPSData, ptr %32, i32 0, i32 18
  %34 = load i8, ptr %33, align 1, !tbaa !14
  %35 = zext i8 %34 to i32
  %36 = sub nsw i32 %35, 2
  %37 = zext i32 %36 to i64
  %38 = call ptr @llvm.stacksave.p0()
  store ptr %38, ptr %4, align 8
  %39 = alloca i8, i64 %37, align 16
  store i64 %37, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 2, ptr %6, align 4, !tbaa !15
  br label %40

40:                                               ; preds = %59, %22
  %41 = load i32, ptr %6, align 4, !tbaa !15
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.GPSData, ptr %42, i32 0, i32 18
  %44 = load i8, ptr %43, align 1, !tbaa !14
  %45 = zext i8 %44 to i32
  %46 = icmp slt i32 %41, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %62

48:                                               ; preds = %40
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.GPSData, ptr %49, i32 0, i32 17
  %51 = load i32, ptr %6, align 4, !tbaa !15
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [16 x i8], ptr %50, i64 0, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !13
  %55 = load i32, ptr %6, align 4, !tbaa !15
  %56 = sub nsw i32 %55, 2
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i8, ptr %39, i64 %57
  store i8 %54, ptr %58, align 1, !tbaa !13
  br label %59

59:                                               ; preds = %48
  %60 = load i32, ptr %6, align 4, !tbaa !15
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %6, align 4, !tbaa !15
  br label %40, !llvm.loop !16

62:                                               ; preds = %47
  %63 = getelementptr inbounds [2 x i8], ptr %3, i64 0, i64 0
  %64 = call i32 @atoi(ptr noundef %63) #5
  %65 = sitofp i32 %64 to float
  %66 = call double @atof(ptr noundef %39) #5
  %67 = fptrunc double %66 to float
  %68 = fdiv float %67, 6.000000e+01
  %69 = fadd float %65, %68
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.GPSData, ptr %70, i32 0, i32 0
  store float %69, ptr %71, align 4, !tbaa !18
  %72 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %72)
  call void @llvm.lifetime.end.p0(i64 2, ptr %3) #4
  br label %300

73:                                               ; preds = %1
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.GPSData, ptr %74, i32 0, i32 19
  %76 = load i8, ptr %75, align 2, !tbaa !9
  %77 = zext i8 %76 to i32
  %78 = icmp eq i32 %77, 3
  br i1 %78, label %79, label %90

79:                                               ; preds = %73
  %80 = load ptr, ptr %2, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.GPSData, ptr %80, i32 0, i32 17
  %82 = getelementptr inbounds [16 x i8], ptr %81, i64 0, i64 0
  %83 = load i8, ptr %82, align 1, !tbaa !13
  %84 = sext i8 %83 to i32
  %85 = icmp eq i32 %84, 83
  %86 = zext i1 %85 to i32
  %87 = trunc i32 %86 to i8
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.GPSData, ptr %88, i32 0, i32 10
  store i8 %87, ptr %89, align 1, !tbaa !19
  br label %299

90:                                               ; preds = %73
  %91 = load ptr, ptr %2, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.GPSData, ptr %91, i32 0, i32 19
  %93 = load i8, ptr %92, align 2, !tbaa !9
  %94 = zext i8 %93 to i32
  %95 = icmp eq i32 %94, 4
  br i1 %95, label %96, label %152

96:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 3, ptr %7) #4
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.GPSData, ptr %97, i32 0, i32 17
  %99 = getelementptr inbounds [16 x i8], ptr %98, i64 0, i64 0
  %100 = load i8, ptr %99, align 1, !tbaa !13
  store i8 %100, ptr %7, align 1, !tbaa !13
  %101 = getelementptr inbounds i8, ptr %7, i64 1
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.GPSData, ptr %102, i32 0, i32 17
  %104 = getelementptr inbounds [16 x i8], ptr %103, i64 0, i64 1
  %105 = load i8, ptr %104, align 1, !tbaa !13
  store i8 %105, ptr %101, align 1, !tbaa !13
  %106 = getelementptr inbounds i8, ptr %7, i64 2
  %107 = load ptr, ptr %2, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.GPSData, ptr %107, i32 0, i32 17
  %109 = getelementptr inbounds [16 x i8], ptr %108, i64 0, i64 2
  %110 = load i8, ptr %109, align 1, !tbaa !13
  store i8 %110, ptr %106, align 1, !tbaa !13
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.GPSData, ptr %111, i32 0, i32 18
  %113 = load i8, ptr %112, align 1, !tbaa !14
  %114 = zext i8 %113 to i32
  %115 = sub nsw i32 %114, 3
  %116 = zext i32 %115 to i64
  %117 = call ptr @llvm.stacksave.p0()
  store ptr %117, ptr %8, align 8
  %118 = alloca i8, i64 %116, align 16
  store i64 %116, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 3, ptr %10, align 4, !tbaa !15
  br label %119

119:                                              ; preds = %138, %96
  %120 = load i32, ptr %10, align 4, !tbaa !15
  %121 = load ptr, ptr %2, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.GPSData, ptr %121, i32 0, i32 18
  %123 = load i8, ptr %122, align 1, !tbaa !14
  %124 = zext i8 %123 to i32
  %125 = icmp slt i32 %120, %124
  br i1 %125, label %127, label %126

126:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %141

127:                                              ; preds = %119
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.GPSData, ptr %128, i32 0, i32 17
  %130 = load i32, ptr %10, align 4, !tbaa !15
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [16 x i8], ptr %129, i64 0, i64 %131
  %133 = load i8, ptr %132, align 1, !tbaa !13
  %134 = load i32, ptr %10, align 4, !tbaa !15
  %135 = sub nsw i32 %134, 3
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i8, ptr %118, i64 %136
  store i8 %133, ptr %137, align 1, !tbaa !13
  br label %138

138:                                              ; preds = %127
  %139 = load i32, ptr %10, align 4, !tbaa !15
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %10, align 4, !tbaa !15
  br label %119, !llvm.loop !20

141:                                              ; preds = %126
  %142 = getelementptr inbounds [3 x i8], ptr %7, i64 0, i64 0
  %143 = call i32 @atoi(ptr noundef %142) #5
  %144 = sitofp i32 %143 to float
  %145 = call double @atof(ptr noundef %118) #5
  %146 = fptrunc double %145 to float
  %147 = fdiv float %146, 6.000000e+01
  %148 = fadd float %144, %147
  %149 = load ptr, ptr %2, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.GPSData, ptr %149, i32 0, i32 1
  store float %148, ptr %150, align 4, !tbaa !21
  %151 = load ptr, ptr %8, align 8
  call void @llvm.stackrestore.p0(ptr %151)
  call void @llvm.lifetime.end.p0(i64 3, ptr %7) #4
  br label %298

152:                                              ; preds = %90
  %153 = load ptr, ptr %2, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.GPSData, ptr %153, i32 0, i32 19
  %155 = load i8, ptr %154, align 2, !tbaa !9
  %156 = zext i8 %155 to i32
  %157 = icmp eq i32 %156, 5
  br i1 %157, label %158, label %169

158:                                              ; preds = %152
  %159 = load ptr, ptr %2, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.GPSData, ptr %159, i32 0, i32 17
  %161 = getelementptr inbounds [16 x i8], ptr %160, i64 0, i64 0
  %162 = load i8, ptr %161, align 1, !tbaa !13
  %163 = sext i8 %162 to i32
  %164 = icmp eq i32 %163, 87
  %165 = zext i1 %164 to i32
  %166 = trunc i32 %165 to i8
  %167 = load ptr, ptr %2, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.GPSData, ptr %167, i32 0, i32 11
  store i8 %166, ptr %168, align 4, !tbaa !22
  br label %297

169:                                              ; preds = %152
  %170 = load ptr, ptr %2, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.GPSData, ptr %170, i32 0, i32 19
  %172 = load i8, ptr %171, align 2, !tbaa !9
  %173 = zext i8 %172 to i32
  %174 = icmp eq i32 %173, 6
  br i1 %174, label %175, label %185

175:                                              ; preds = %169
  %176 = load ptr, ptr %2, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.GPSData, ptr %176, i32 0, i32 17
  %178 = getelementptr inbounds [16 x i8], ptr %177, i64 0, i64 0
  %179 = load i8, ptr %178, align 1, !tbaa !13
  %180 = sext i8 %179 to i32
  %181 = sub nsw i32 %180, 48
  %182 = trunc i32 %181 to i8
  %183 = load ptr, ptr %2, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.GPSData, ptr %183, i32 0, i32 8
  store i8 %182, ptr %184, align 1, !tbaa !23
  br label %296

185:                                              ; preds = %169
  %186 = load ptr, ptr %2, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.GPSData, ptr %186, i32 0, i32 19
  %188 = load i8, ptr %187, align 2, !tbaa !9
  %189 = zext i8 %188 to i32
  %190 = icmp eq i32 %189, 7
  br i1 %190, label %191, label %213

191:                                              ; preds = %185
  %192 = load ptr, ptr %2, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.GPSData, ptr %192, i32 0, i32 17
  %194 = getelementptr inbounds [16 x i8], ptr %193, i64 0, i64 0
  %195 = load i8, ptr %194, align 1, !tbaa !13
  %196 = sext i8 %195 to i32
  %197 = sub nsw i32 %196, 48
  %198 = trunc i32 %197 to i8
  %199 = zext i8 %198 to i32
  %200 = mul nsw i32 %199, 10
  %201 = load ptr, ptr %2, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.GPSData, ptr %201, i32 0, i32 17
  %203 = getelementptr inbounds [16 x i8], ptr %202, i64 0, i64 1
  %204 = load i8, ptr %203, align 1, !tbaa !13
  %205 = sext i8 %204 to i32
  %206 = sub nsw i32 %205, 48
  %207 = trunc i32 %206 to i8
  %208 = zext i8 %207 to i32
  %209 = add nsw i32 %200, %208
  %210 = trunc i32 %209 to i8
  %211 = load ptr, ptr %2, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.GPSData, ptr %211, i32 0, i32 9
  store i8 %210, ptr %212, align 2, !tbaa !24
  br label %295

213:                                              ; preds = %185
  %214 = load ptr, ptr %2, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.GPSData, ptr %214, i32 0, i32 19
  %216 = load i8, ptr %215, align 2, !tbaa !9
  %217 = zext i8 %216 to i32
  %218 = icmp eq i32 %217, 9
  br i1 %218, label %219, label %253

219:                                              ; preds = %213
  %220 = load ptr, ptr %2, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.GPSData, ptr %220, i32 0, i32 18
  %222 = load i8, ptr %221, align 1, !tbaa !14
  %223 = zext i8 %222 to i64
  %224 = call ptr @llvm.stacksave.p0()
  store ptr %224, ptr %11, align 8
  %225 = alloca i8, i64 %223, align 16
  store i64 %223, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !15
  br label %226

226:                                              ; preds = %244, %219
  %227 = load i32, ptr %13, align 4, !tbaa !15
  %228 = load ptr, ptr %2, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.GPSData, ptr %228, i32 0, i32 18
  %230 = load i8, ptr %229, align 1, !tbaa !14
  %231 = zext i8 %230 to i32
  %232 = icmp slt i32 %227, %231
  br i1 %232, label %234, label %233

233:                                              ; preds = %226
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %247

234:                                              ; preds = %226
  %235 = load ptr, ptr %2, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.GPSData, ptr %235, i32 0, i32 17
  %237 = load i32, ptr %13, align 4, !tbaa !15
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [16 x i8], ptr %236, i64 0, i64 %238
  %240 = load i8, ptr %239, align 1, !tbaa !13
  %241 = load i32, ptr %13, align 4, !tbaa !15
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds i8, ptr %225, i64 %242
  store i8 %240, ptr %243, align 1, !tbaa !13
  br label %244

244:                                              ; preds = %234
  %245 = load i32, ptr %13, align 4, !tbaa !15
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr %13, align 4, !tbaa !15
  br label %226, !llvm.loop !25

247:                                              ; preds = %233
  %248 = call double @atof(ptr noundef %225) #5
  %249 = fptrunc double %248 to float
  %250 = load ptr, ptr %2, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.GPSData, ptr %250, i32 0, i32 2
  store float %249, ptr %251, align 4, !tbaa !26
  %252 = load ptr, ptr %11, align 8
  call void @llvm.stackrestore.p0(ptr %252)
  br label %294

253:                                              ; preds = %213
  %254 = load ptr, ptr %2, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.GPSData, ptr %254, i32 0, i32 19
  %256 = load i8, ptr %255, align 2, !tbaa !9
  %257 = zext i8 %256 to i32
  %258 = icmp eq i32 %257, 11
  br i1 %258, label %259, label %293

259:                                              ; preds = %253
  %260 = load ptr, ptr %2, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.GPSData, ptr %260, i32 0, i32 18
  %262 = load i8, ptr %261, align 1, !tbaa !14
  %263 = zext i8 %262 to i64
  %264 = call ptr @llvm.stacksave.p0()
  store ptr %264, ptr %14, align 8
  %265 = alloca i8, i64 %263, align 16
  store i64 %263, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !15
  br label %266

266:                                              ; preds = %284, %259
  %267 = load i32, ptr %16, align 4, !tbaa !15
  %268 = load ptr, ptr %2, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.GPSData, ptr %268, i32 0, i32 18
  %270 = load i8, ptr %269, align 1, !tbaa !14
  %271 = zext i8 %270 to i32
  %272 = icmp slt i32 %267, %271
  br i1 %272, label %274, label %273

273:                                              ; preds = %266
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %287

274:                                              ; preds = %266
  %275 = load ptr, ptr %2, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.GPSData, ptr %275, i32 0, i32 17
  %277 = load i32, ptr %16, align 4, !tbaa !15
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [16 x i8], ptr %276, i64 0, i64 %278
  %280 = load i8, ptr %279, align 1, !tbaa !13
  %281 = load i32, ptr %16, align 4, !tbaa !15
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds i8, ptr %265, i64 %282
  store i8 %280, ptr %283, align 1, !tbaa !13
  br label %284

284:                                              ; preds = %274
  %285 = load i32, ptr %16, align 4, !tbaa !15
  %286 = add nsw i32 %285, 1
  store i32 %286, ptr %16, align 4, !tbaa !15
  br label %266, !llvm.loop !27

287:                                              ; preds = %273
  %288 = call double @atof(ptr noundef %265) #5
  %289 = fptrunc double %288 to float
  %290 = load ptr, ptr %2, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.GPSData, ptr %290, i32 0, i32 6
  store float %289, ptr %291, align 4, !tbaa !28
  %292 = load ptr, ptr %14, align 8
  call void @llvm.stackrestore.p0(ptr %292)
  br label %293

293:                                              ; preds = %287, %253
  br label %294

294:                                              ; preds = %293, %247
  br label %295

295:                                              ; preds = %294, %191
  br label %296

296:                                              ; preds = %295, %175
  br label %297

297:                                              ; preds = %296, %158
  br label %298

298:                                              ; preds = %297, %141
  br label %299

299:                                              ; preds = %298, %79
  br label %300

300:                                              ; preds = %299, %62
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #3

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare double @atof(ptr noundef nonnull) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn }
attributes #3 = { inlinehint nounwind willreturn memory(read) 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 }
attributes #5 = { nounwind willreturn memory(read) }

!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, !7, i64 66}
!10 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31, !7, i64 32, !12, i64 36, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 48, !7, i64 49, !7, i64 65, !7, i64 66}
!11 = !{!"float", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!10, !7, i64 65}
!15 = !{!12, !12, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!10, !11, i64 0}
!19 = !{!10, !7, i64 31}
!20 = distinct !{!20, !17}
!21 = !{!10, !11, i64 4}
!22 = !{!10, !7, i64 32}
!23 = !{!10, !7, i64 29}
!24 = !{!10, !7, i64 30}
!25 = distinct !{!25, !17}
!26 = !{!10, !11, i64 8}
!27 = distinct !{!27, !17}
!28 = !{!10, !11, i64 24}


; 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"

; Function Attrs: mustprogress nofree nounwind willreturn uwtable
define dso_local void @GPSNMEAParser_ExtractGGA(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = alloca [2 x i8], align 1
  %3 = alloca [3 x i8], align 1
  %4 = getelementptr inbounds i8, ptr %0, i64 66
  %5 = load i8, ptr %4, align 2, !tbaa !5
  switch i8 %5, label %108 [
    i8 2, label %6
    i8 3, label %30
    i8 4, label %36
    i8 5, label %64
    i8 6, label %70
    i8 7, label %75
    i8 9, label %84
    i8 11, label %96
  ]

6:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %2) #5
  %7 = getelementptr inbounds i8, ptr %0, i64 49
  %8 = load i8, ptr %7, align 1, !tbaa !11
  store i8 %8, ptr %2, align 1, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %2, i64 1
  %10 = getelementptr inbounds i8, ptr %0, i64 50
  %11 = load i8, ptr %10, align 1, !tbaa !11
  store i8 %11, ptr %9, align 1, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %0, i64 65
  %13 = load i8, ptr %12, align 1, !tbaa !12
  %14 = zext i8 %13 to i64
  %15 = add nuw nsw i64 %14, 4294967294
  %16 = and i64 %15, 4294967295
  %17 = tail call ptr @llvm.stacksave.p0()
  %18 = alloca i8, i64 %16, align 16
  %19 = load i8, ptr %12, align 1, !tbaa !12
  %20 = icmp ugt i8 %19, 2
  br i1 %20, label %.lr.ph74.preheader, label %._crit_edge75

.lr.ph74.preheader:                               ; preds = %6
  %21 = zext i8 %19 to i64
  %scevgep80 = getelementptr i8, ptr %0, i64 51
  %22 = add nuw nsw i64 %21, 4294967294
  %23 = and i64 %22, 4294967295
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %18, ptr align 1 %scevgep80, i64 %23, i1 false), !tbaa !11
  br label %._crit_edge75

._crit_edge75:                                    ; preds = %.lr.ph74.preheader, %6
  %24 = call i32 @atoi(ptr nocapture noundef %2) #6
  %25 = sitofp i32 %24 to float
  %26 = call double @atof(ptr noundef %18) #6
  %27 = fptrunc double %26 to float
  %28 = fdiv float %27, 6.000000e+01
  %29 = fadd float %28, %25
  store float %29, ptr %0, align 4, !tbaa !13
  tail call void @llvm.stackrestore.p0(ptr %17)
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %2) #5
  br label %108

30:                                               ; preds = %1
  %31 = getelementptr inbounds i8, ptr %0, i64 49
  %32 = load i8, ptr %31, align 1, !tbaa !11
  %33 = icmp eq i8 %32, 83
  %34 = zext i1 %33 to i8
  %35 = getelementptr inbounds i8, ptr %0, i64 31
  store i8 %34, ptr %35, align 1, !tbaa !14
  br label %108

36:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %3) #5
  %37 = getelementptr inbounds i8, ptr %0, i64 49
  %38 = load i8, ptr %37, align 1, !tbaa !11
  store i8 %38, ptr %3, align 1, !tbaa !11
  %39 = getelementptr inbounds i8, ptr %3, i64 1
  %40 = getelementptr inbounds i8, ptr %0, i64 50
  %41 = load i8, ptr %40, align 1, !tbaa !11
  store i8 %41, ptr %39, align 1, !tbaa !11
  %42 = getelementptr inbounds i8, ptr %3, i64 2
  %43 = getelementptr inbounds i8, ptr %0, i64 51
  %44 = load i8, ptr %43, align 1, !tbaa !11
  store i8 %44, ptr %42, align 1, !tbaa !11
  %45 = getelementptr inbounds i8, ptr %0, i64 65
  %46 = load i8, ptr %45, align 1, !tbaa !12
  %47 = zext i8 %46 to i64
  %48 = add nuw nsw i64 %47, 4294967293
  %49 = and i64 %48, 4294967295
  %50 = tail call ptr @llvm.stacksave.p0()
  %51 = alloca i8, i64 %49, align 16
  %52 = load i8, ptr %45, align 1, !tbaa !12
  %53 = icmp ugt i8 %52, 3
  br i1 %53, label %.lr.ph68.preheader, label %._crit_edge69

.lr.ph68.preheader:                               ; preds = %36
  %54 = zext i8 %52 to i64
  %scevgep = getelementptr i8, ptr %0, i64 52
  %55 = add nuw nsw i64 %54, 4294967293
  %56 = and i64 %55, 4294967295
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %51, ptr align 1 %scevgep, i64 %56, i1 false), !tbaa !11
  br label %._crit_edge69

._crit_edge69:                                    ; preds = %.lr.ph68.preheader, %36
  %57 = call i32 @atoi(ptr nocapture noundef %3) #6
  %58 = sitofp i32 %57 to float
  %59 = call double @atof(ptr noundef %51) #6
  %60 = fptrunc double %59 to float
  %61 = fdiv float %60, 6.000000e+01
  %62 = fadd float %61, %58
  %63 = getelementptr inbounds i8, ptr %0, i64 4
  store float %62, ptr %63, align 4, !tbaa !15
  tail call void @llvm.stackrestore.p0(ptr %50)
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %3) #5
  br label %108

64:                                               ; preds = %1
  %65 = getelementptr inbounds i8, ptr %0, i64 49
  %66 = load i8, ptr %65, align 1, !tbaa !11
  %67 = icmp eq i8 %66, 87
  %68 = zext i1 %67 to i8
  %69 = getelementptr inbounds i8, ptr %0, i64 32
  store i8 %68, ptr %69, align 4, !tbaa !16
  br label %108

70:                                               ; preds = %1
  %71 = getelementptr inbounds i8, ptr %0, i64 49
  %72 = load i8, ptr %71, align 1, !tbaa !11
  %73 = add i8 %72, -48
  %74 = getelementptr inbounds i8, ptr %0, i64 29
  store i8 %73, ptr %74, align 1, !tbaa !17
  br label %108

75:                                               ; preds = %1
  %76 = getelementptr inbounds i8, ptr %0, i64 49
  %77 = load i8, ptr %76, align 1, !tbaa !11
  %78 = mul i8 %77, 10
  %79 = getelementptr inbounds i8, ptr %0, i64 50
  %80 = load i8, ptr %79, align 1, !tbaa !11
  %81 = add i8 %80, -16
  %82 = add i8 %81, %78
  %83 = getelementptr inbounds i8, ptr %0, i64 30
  store i8 %82, ptr %83, align 2, !tbaa !18
  br label %108

84:                                               ; preds = %1
  %85 = getelementptr inbounds i8, ptr %0, i64 65
  %86 = load i8, ptr %85, align 1, !tbaa !12
  %87 = zext i8 %86 to i64
  %88 = tail call ptr @llvm.stacksave.p0()
  %89 = alloca i8, i64 %87, align 16
  %90 = load i8, ptr %85, align 1, !tbaa !12
  %.not76 = icmp eq i8 %90, 0
  br i1 %.not76, label %._crit_edge65, label %.lr.ph64

.lr.ph64:                                         ; preds = %84
  %91 = getelementptr inbounds i8, ptr %0, i64 49
  %92 = zext i8 %90 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %89, ptr nonnull align 1 %91, i64 %92, i1 false), !tbaa !11
  br label %._crit_edge65

._crit_edge65:                                    ; preds = %.lr.ph64, %84
  %93 = call double @atof(ptr noundef %89) #6
  %94 = fptrunc double %93 to float
  %95 = getelementptr inbounds i8, ptr %0, i64 8
  store float %94, ptr %95, align 4, !tbaa !19
  tail call void @llvm.stackrestore.p0(ptr %88)
  br label %108

96:                                               ; preds = %1
  %97 = getelementptr inbounds i8, ptr %0, i64 65
  %98 = load i8, ptr %97, align 1, !tbaa !12
  %99 = zext i8 %98 to i64
  %100 = tail call ptr @llvm.stacksave.p0()
  %101 = alloca i8, i64 %99, align 16
  %102 = load i8, ptr %97, align 1, !tbaa !12
  %.not = icmp eq i8 %102, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %96
  %103 = getelementptr inbounds i8, ptr %0, i64 49
  %104 = zext i8 %102 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %101, ptr nonnull align 1 %103, i64 %104, i1 false), !tbaa !11
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %96
  %105 = call double @atof(ptr noundef %101) #6
  %106 = fptrunc double %105 to float
  %107 = getelementptr inbounds i8, ptr %0, i64 24
  store float %106, ptr %107, align 4, !tbaa !20
  tail call void @llvm.stackrestore.p0(ptr %100)
  br label %108

108:                                              ; preds = %1, %30, %64, %75, %._crit_edge, %._crit_edge65, %70, %._crit_edge69, %._crit_edge75
  ret void
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare double @atof(ptr nocapture noundef nonnull) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

attributes #0 = { mustprogress nofree nounwind willreturn 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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, !8, i64 66}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !8, i64 28, !8, i64 29, !8, i64 30, !8, i64 31, !8, i64 32, !10, i64 36, !8, i64 40, !8, i64 41, !8, i64 42, !8, i64 48, !8, i64 49, !8, i64 65, !8, i64 66}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!8, !8, i64 0}
!12 = !{!6, !8, i64 65}
!13 = !{!6, !7, i64 0}
!14 = !{!6, !8, i64 31}
!15 = !{!6, !7, i64 4}
!16 = !{!6, !8, i64 32}
!17 = !{!6, !8, i64 29}
!18 = !{!6, !8, i64 30}
!19 = !{!6, !7, i64 8}
!20 = !{!6, !7, i64 24}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass