; LLVM IR from devicehive/esp8266-firmware :: esp-utils (esp-flasher)

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

@TIMEOUT = external dso_local global i32, align 4
@mCurrentPort = external dso_local global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@stdout = external global ptr, align 8
@.str.25 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [264 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [345 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [165 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [258 x i8], align 1
@__const.main.dh = external hidden unnamed_addr constant [15 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [19 x i8], align 1

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

; 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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.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
declare void @llvm.stackrestore.p0(ptr) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z11flash_startP10SerialPortjjj(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #3

; 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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z10flash_fileP10SerialPortPcjS1_(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

declare noalias ptr @fopen(ptr noundef, ptr noundef) #0

declare i32 @fclose(ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z10flash_doneP10SerialPort(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z10flash_syncP10SerialPortb(ptr noundef, i1 noundef zeroext) #3

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #5

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4exitv() #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z20flash_default_configP10SerialPort(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z16force_flash_modeP10SerialPort(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6rebootP10SerialPort(ptr noundef) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #6 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca [20 x ptr], align 16
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i8, align 1
  %20 = alloca [15 x i8], align 1
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i64, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %30 = load ptr, ptr @stdout, align 8, !tbaa !9
  call void @setbuf(ptr noundef %30, ptr noundef null) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #8
  store i8 1, ptr %7, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store ptr null, ptr %8, align 8, !tbaa !9
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = icmp sgt i32 %31, 1
  br i1 %32, label %33, label %70

33:                                               ; preds = %2
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = getelementptr inbounds ptr, ptr %34, i64 1
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = call i32 @strncmp(ptr noundef %36, ptr noundef @.str.25, i64 noundef 5) #9
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %69

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %54, %39
  %41 = load ptr, ptr %8, align 8, !tbaa !9
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %46

43:                                               ; preds = %40
  %44 = load i32, ptr %9, align 4, !tbaa !5
  %45 = icmp ult i32 %44, 3
  br label %46

46:                                               ; preds = %43, %40
  %47 = phi i1 [ false, %40 ], [ %45, %43 ]
  br i1 %47, label %49, label %48

48:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %57

49:                                               ; preds = %46
  %50 = load ptr, ptr %5, align 8, !tbaa !9
  %51 = getelementptr inbounds ptr, ptr %50, i64 1
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = call noundef ptr @_ZN10SerialPort4openEPKc(ptr noundef %52)
  store ptr %53, ptr %8, align 8, !tbaa !9
  br label %54

54:                                               ; preds = %49
  %55 = load i32, ptr %9, align 4, !tbaa !5
  %56 = add i32 %55, 1
  store i32 %56, ptr %9, align 4, !tbaa !5
  br label %40, !llvm.loop !13

57:                                               ; preds = %48
  %58 = load ptr, ptr %8, align 8, !tbaa !9
  %59 = icmp ne ptr %58, null
  br i1 %59, label %66, label %60

60:                                               ; preds = %57
  %61 = load ptr, ptr %5, align 8, !tbaa !9
  %62 = getelementptr inbounds ptr, ptr %61, i64 1
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.26, ptr noundef %63)
  %65 = call noundef i32 @_Z4exitv()
  store i32 %65, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %533

66:                                               ; preds = %57
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %6, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %66, %33
  br label %70

70:                                               ; preds = %69, %2
  %71 = load ptr, ptr %8, align 8, !tbaa !9
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %105

73:                                               ; preds = %70
  store i32 500, ptr @TIMEOUT, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #8
  store i8 0, ptr %11, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %84, %73
  %75 = load i32, ptr %12, align 4, !tbaa !5
  %76 = icmp slt i32 %75, 3
  br i1 %76, label %78, label %77

77:                                               ; preds = %74
  store i32 5, ptr %10, align 4
  br label %87

78:                                               ; preds = %74
  %79 = load ptr, ptr %8, align 8, !tbaa !9
  call void @_Z16force_flash_modeP10SerialPort(ptr noundef %79)
  %80 = load ptr, ptr %8, align 8, !tbaa !9
  %81 = call noundef zeroext i1 @_Z10flash_syncP10SerialPortb(ptr noundef %80, i1 noundef zeroext false)
  br i1 %81, label %82, label %83

82:                                               ; preds = %78
  store i8 1, ptr %11, align 1, !tbaa !11
  store i32 5, ptr %10, align 4
  br label %87

83:                                               ; preds = %78
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %12, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %12, align 4, !tbaa !5
  br label %74, !llvm.loop !15

87:                                               ; preds = %82, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %88

88:                                               ; preds = %87
  %89 = load i8, ptr %11, align 1, !tbaa !11, !range !16, !noundef !17
  %90 = trunc i8 %89 to i1
  br i1 %90, label %101, label %91

91:                                               ; preds = %88
  %92 = load ptr, ptr %8, align 8, !tbaa !9
  %93 = icmp eq ptr %92, null
  br i1 %93, label %98, label %94

94:                                               ; preds = %91
  %95 = load ptr, ptr %92, align 8, !tbaa !18
  %96 = getelementptr inbounds ptr, ptr %95, i64 1
  %97 = load ptr, ptr %96, align 8
  call void %97(ptr noundef nonnull align 8 dereferenceable(292) %92) #8
  br label %98

98:                                               ; preds = %94, %91
  %99 = call i32 (ptr, ...) @printf(ptr noundef @.str.27)
  %100 = call noundef i32 @_Z4exitv()
  store i32 %100, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %102

101:                                              ; preds = %88
  store i32 5000, ptr @TIMEOUT, align 4, !tbaa !5
  store i32 0, ptr %10, align 4
  br label %102

102:                                              ; preds = %101, %98
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #8
  %103 = load i32, ptr %10, align 4
  switch i32 %103, label %533 [
    i32 0, label %104
  ]

104:                                              ; preds = %102
  br label %246

105:                                              ; preds = %70
  store i32 500, ptr @TIMEOUT, align 4, !tbaa !5
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.28)
  call void @llvm.lifetime.start.p0(i64 160, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %115, %105
  %108 = load i32, ptr %14, align 4, !tbaa !5
  %109 = icmp ult i32 %108, 20
  br i1 %109, label %111, label %110

110:                                              ; preds = %107
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %118

111:                                              ; preds = %107
  %112 = load i32, ptr %14, align 4, !tbaa !5
  %113 = zext i32 %112 to i64
  %114 = getelementptr inbounds [20 x ptr], ptr %13, i64 0, i64 %113
  store ptr null, ptr %114, align 8, !tbaa !9
  br label %115

115:                                              ; preds = %111
  %116 = load i32, ptr %14, align 4, !tbaa !5
  %117 = add i32 %116, 1
  store i32 %117, ptr %14, align 4, !tbaa !5
  br label %107, !llvm.loop !20

118:                                              ; preds = %110
  store ptr null, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %199, %118
  %120 = load ptr, ptr %8, align 8, !tbaa !9
  %121 = icmp eq ptr %120, null
  br i1 %121, label %122, label %125

122:                                              ; preds = %119
  %123 = load i32, ptr %15, align 4, !tbaa !5
  %124 = icmp ult i32 %123, 3
  br label %125

125:                                              ; preds = %122, %119
  %126 = phi i1 [ false, %119 ], [ %124, %122 ]
  br i1 %126, label %128, label %127

127:                                              ; preds = %125
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %202

128:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %194, %128
  %130 = load ptr, ptr %8, align 8, !tbaa !9
  %131 = icmp eq ptr %130, null
  br i1 %131, label %132, label %135

132:                                              ; preds = %129
  %133 = load i32, ptr %16, align 4, !tbaa !5
  %134 = icmp ult i32 %133, 20
  br label %135

135:                                              ; preds = %132, %129
  %136 = phi i1 [ false, %129 ], [ %134, %132 ]
  br i1 %136, label %138, label %137

137:                                              ; preds = %135
  store i32 14, ptr %10, align 4
  br label %197

138:                                              ; preds = %135
  %139 = load i32, ptr %16, align 4, !tbaa !5
  %140 = zext i32 %139 to i64
  %141 = getelementptr inbounds [20 x ptr], ptr %13, i64 0, i64 %140
  %142 = load ptr, ptr %141, align 8, !tbaa !9
  %143 = icmp ne ptr %142, null
  br i1 %143, label %161, label %144

144:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %145 = call noundef ptr @_ZN10SerialPort12findNextPortEb(i1 noundef zeroext false)
  store ptr %145, ptr %17, align 8, !tbaa !9
  %146 = load ptr, ptr %17, align 8, !tbaa !9
  %147 = getelementptr inbounds i8, ptr %146, i64 0
  %148 = load i8, ptr %147, align 1, !tbaa !21
  %149 = sext i8 %148 to i32
  %150 = icmp eq i32 %149, 0
  br i1 %150, label %151, label %152

151:                                              ; preds = %144
  store i32 14, ptr %10, align 4
  br label %158

152:                                              ; preds = %144
  %153 = load ptr, ptr %17, align 8, !tbaa !9
  %154 = call noundef ptr @_ZN10SerialPort4openEPKc(ptr noundef %153)
  %155 = load i32, ptr %16, align 4, !tbaa !5
  %156 = zext i32 %155 to i64
  %157 = getelementptr inbounds [20 x ptr], ptr %13, i64 0, i64 %156
  store ptr %154, ptr %157, align 8, !tbaa !9
  store i32 0, ptr %10, align 4
  br label %158

158:                                              ; preds = %152, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  %159 = load i32, ptr %10, align 4
  switch i32 %159, label %197 [
    i32 0, label %160
  ]

160:                                              ; preds = %158
  br label %161

161:                                              ; preds = %160, %138
  %162 = load i32, ptr %16, align 4, !tbaa !5
  %163 = zext i32 %162 to i64
  %164 = getelementptr inbounds [20 x ptr], ptr %13, i64 0, i64 %163
  %165 = load ptr, ptr %164, align 8, !tbaa !9
  %166 = icmp ne ptr %165, null
  br i1 %166, label %167, label %193

167:                                              ; preds = %161
  %168 = load i32, ptr %16, align 4, !tbaa !5
  %169 = zext i32 %168 to i64
  %170 = getelementptr inbounds [20 x ptr], ptr %13, i64 0, i64 %169
  %171 = load ptr, ptr %170, align 8, !tbaa !9
  store ptr %171, ptr @mCurrentPort, align 8, !tbaa !9
  %172 = load i32, ptr %16, align 4, !tbaa !5
  %173 = zext i32 %172 to i64
  %174 = getelementptr inbounds [20 x ptr], ptr %13, i64 0, i64 %173
  %175 = load ptr, ptr %174, align 8, !tbaa !9
  call void @_Z16force_flash_modeP10SerialPort(ptr noundef %175)
  %176 = load i32, ptr %16, align 4, !tbaa !5
  %177 = zext i32 %176 to i64
  %178 = getelementptr inbounds [20 x ptr], ptr %13, i64 0, i64 %177
  %179 = load ptr, ptr %178, align 8, !tbaa !9
  %180 = call noundef zeroext i1 @_Z10flash_syncP10SerialPortb(ptr noundef %179, i1 noundef zeroext false)
  br i1 %180, label %181, label %192

181:                                              ; preds = %167
  %182 = load i32, ptr %16, align 4, !tbaa !5
  %183 = zext i32 %182 to i64
  %184 = getelementptr inbounds [20 x ptr], ptr %13, i64 0, i64 %183
  %185 = load ptr, ptr %184, align 8, !tbaa !9
  %186 = call noundef ptr @_ZN10SerialPort7getNameEv(ptr noundef nonnull align 8 dereferenceable(292) %185)
  %187 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, ptr noundef %186)
  %188 = load i32, ptr %16, align 4, !tbaa !5
  %189 = zext i32 %188 to i64
  %190 = getelementptr inbounds [20 x ptr], ptr %13, i64 0, i64 %189
  %191 = load ptr, ptr %190, align 8, !tbaa !9
  store ptr %191, ptr %8, align 8, !tbaa !9
  br label %192

192:                                              ; preds = %181, %167
  store ptr null, ptr @mCurrentPort, align 8, !tbaa !9
  br label %193

193:                                              ; preds = %192, %161
  br label %194

194:                                              ; preds = %193
  %195 = load i32, ptr %16, align 4, !tbaa !5
  %196 = add i32 %195, 1
  store i32 %196, ptr %16, align 4, !tbaa !5
  br label %129, !llvm.loop !22

197:                                              ; preds = %158, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %198

198:                                              ; preds = %197
  br label %199

199:                                              ; preds = %198
  %200 = load i32, ptr %15, align 4, !tbaa !5
  %201 = add i32 %200, 1
  store i32 %201, ptr %15, align 4, !tbaa !5
  br label %119, !llvm.loop !23

202:                                              ; preds = %127
  %203 = call noundef ptr @_ZN10SerialPort12findNextPortEb(i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %204

204:                                              ; preds = %233, %202
  %205 = load i32, ptr %18, align 4, !tbaa !5
  %206 = icmp ult i32 %205, 20
  br i1 %206, label %208, label %207

207:                                              ; preds = %204
  store i32 17, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %236

208:                                              ; preds = %204
  %209 = load i32, ptr %18, align 4, !tbaa !5
  %210 = zext i32 %209 to i64
  %211 = getelementptr inbounds [20 x ptr], ptr %13, i64 0, i64 %210
  %212 = load ptr, ptr %211, align 8, !tbaa !9
  %213 = icmp ne ptr %212, null
  br i1 %213, label %214, label %232

214:                                              ; preds = %208
  %215 = load i32, ptr %18, align 4, !tbaa !5
  %216 = zext i32 %215 to i64
  %217 = getelementptr inbounds [20 x ptr], ptr %13, i64 0, i64 %216
  %218 = load ptr, ptr %217, align 8, !tbaa !9
  %219 = load ptr, ptr %8, align 8, !tbaa !9
  %220 = icmp ne ptr %218, %219
  br i1 %220, label %221, label %232

221:                                              ; preds = %214
  %222 = load i32, ptr %18, align 4, !tbaa !5
  %223 = zext i32 %222 to i64
  %224 = getelementptr inbounds [20 x ptr], ptr %13, i64 0, i64 %223
  %225 = load ptr, ptr %224, align 8, !tbaa !9
  %226 = icmp eq ptr %225, null
  br i1 %226, label %231, label %227

227:                                              ; preds = %221
  %228 = load ptr, ptr %225, align 8, !tbaa !18
  %229 = getelementptr inbounds ptr, ptr %228, i64 1
  %230 = load ptr, ptr %229, align 8
  call void %230(ptr noundef nonnull align 8 dereferenceable(292) %225) #8
  br label %231

231:                                              ; preds = %227, %221
  br label %232

232:                                              ; preds = %231, %214, %208
  br label %233

233:                                              ; preds = %232
  %234 = load i32, ptr %18, align 4, !tbaa !5
  %235 = add i32 %234, 1
  store i32 %235, ptr %18, align 4, !tbaa !5
  br label %204, !llvm.loop !24

236:                                              ; preds = %207
  store i32 5000, ptr @TIMEOUT, align 4, !tbaa !5
  %237 = load ptr, ptr %8, align 8, !tbaa !9
  %238 = icmp ne ptr %237, null
  br i1 %238, label %242, label %239

239:                                              ; preds = %236
  %240 = call i32 (ptr, ...) @printf(ptr noundef @.str.30, i32 noundef 20)
  %241 = call noundef i32 @_Z4exitv()
  store i32 %241, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %243

242:                                              ; preds = %236
  store i32 0, ptr %10, align 4
  br label %243

243:                                              ; preds = %242, %239
  call void @llvm.lifetime.end.p0(i64 160, ptr %13) #8
  %244 = load i32, ptr %10, align 4
  switch i32 %244, label %533 [
    i32 0, label %245
  ]

245:                                              ; preds = %243
  br label %246

246:                                              ; preds = %245, %104
  %247 = load ptr, ptr %8, align 8, !tbaa !9
  %248 = call noundef zeroext i1 @_Z10flash_syncP10SerialPortb(ptr noundef %247, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #8
  store i8 0, ptr %19, align 1, !tbaa !11
  %249 = load i32, ptr %4, align 4, !tbaa !5
  %250 = load i32, ptr %6, align 4, !tbaa !5
  %251 = icmp sgt i32 %249, %250
  br i1 %251, label %252, label %275

252:                                              ; preds = %246
  %253 = load ptr, ptr %5, align 8, !tbaa !9
  %254 = load i32, ptr %6, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds ptr, ptr %253, i64 %255
  %257 = load ptr, ptr %256, align 8, !tbaa !9
  %258 = call i32 @strncmp(ptr noundef %257, ptr noundef @.str.31, i64 noundef 5) #9
  %259 = icmp eq i32 %258, 0
  br i1 %259, label %260, label %263

260:                                              ; preds = %252
  %261 = load i32, ptr %6, align 4, !tbaa !5
  %262 = add nsw i32 %261, 1
  store i32 %262, ptr %6, align 4, !tbaa !5
  store i8 1, ptr %19, align 1, !tbaa !11
  br label %274

263:                                              ; preds = %252
  %264 = load ptr, ptr %5, align 8, !tbaa !9
  %265 = load i32, ptr %6, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds ptr, ptr %264, i64 %266
  %268 = load ptr, ptr %267, align 8, !tbaa !9
  %269 = call i32 @strncmp(ptr noundef %268, ptr noundef @.str.32, i64 noundef 5) #9
  %270 = icmp eq i32 %269, 0
  br i1 %270, label %271, label %273

271:                                              ; preds = %263
  %272 = load ptr, ptr %8, align 8, !tbaa !9
  call void @_Z6rebootP10SerialPort(ptr noundef %272)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %532

273:                                              ; preds = %263
  br label %274

274:                                              ; preds = %273, %260
  br label %275

275:                                              ; preds = %274, %246
  %276 = load i32, ptr %6, align 4, !tbaa !5
  %277 = load i32, ptr %4, align 4, !tbaa !5
  %278 = icmp sge i32 %276, %277
  br i1 %278, label %279, label %358

279:                                              ; preds = %275
  %280 = load i8, ptr %19, align 1, !tbaa !11, !range !16, !noundef !17
  %281 = trunc i8 %280 to i1
  br i1 %281, label %282, label %284

282:                                              ; preds = %279
  %283 = call i32 (ptr, ...) @printf(ptr noundef @.str.33)
  br label %286

284:                                              ; preds = %279
  %285 = call i32 (ptr, ...) @printf(ptr noundef @.str.34)
  br label %286

286:                                              ; preds = %284, %282
  call void @llvm.lifetime.start.p0(i64 15, ptr %20) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %20, ptr align 1 @__const.main.dh, i64 15, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %287 = load ptr, ptr %5, align 8, !tbaa !9
  %288 = getelementptr inbounds ptr, ptr %287, i64 0
  %289 = load ptr, ptr %288, align 8, !tbaa !9
  %290 = call i64 @strlen(ptr noundef %289) #9
  %291 = trunc i64 %290 to i32
  store i32 %291, ptr %21, align 4, !tbaa !5
  %292 = load i32, ptr %21, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = add i64 %293, 15
  %295 = call ptr @llvm.stacksave.p0()
  store ptr %295, ptr %22, align 8
  %296 = alloca i8, i64 %294, align 16
  store i64 %294, ptr %23, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %297 = getelementptr inbounds [15 x i8], ptr %20, i64 0, i64 0
  store ptr %297, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %298 = getelementptr inbounds [15 x i8], ptr %20, i64 0, i64 0
  %299 = call noalias ptr @fopen(ptr noundef %298, ptr noundef @.str.11)
  store ptr %299, ptr %25, align 8, !tbaa !9
  %300 = load ptr, ptr %25, align 8, !tbaa !9
  %301 = icmp ne ptr %300, null
  br i1 %301, label %302, label %305

302:                                              ; preds = %286
  %303 = load ptr, ptr %25, align 8, !tbaa !9
  %304 = call i32 @fclose(ptr noundef %303)
  br label %338

305:                                              ; preds = %286
  %306 = load ptr, ptr %5, align 8, !tbaa !9
  %307 = getelementptr inbounds ptr, ptr %306, i64 0
  %308 = load ptr, ptr %307, align 8, !tbaa !9
  %309 = call ptr @strcpy(ptr noundef %296, ptr noundef %308) #8
  br label %310

310:                                              ; preds = %334, %305
  %311 = load i32, ptr %21, align 4, !tbaa !5
  %312 = icmp sge i32 %311, 0
  br i1 %312, label %313, label %337

313:                                              ; preds = %310
  %314 = load i32, ptr %21, align 4, !tbaa !5
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds i8, ptr %296, i64 %315
  %317 = load i8, ptr %316, align 1, !tbaa !21
  %318 = sext i8 %317 to i32
  %319 = icmp eq i32 %318, 47
  br i1 %319, label %327, label %320

320:                                              ; preds = %313
  %321 = load i32, ptr %21, align 4, !tbaa !5
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds i8, ptr %296, i64 %322
  %324 = load i8, ptr %323, align 1, !tbaa !21
  %325 = sext i8 %324 to i32
  %326 = icmp eq i32 %325, 92
  br i1 %326, label %327, label %334

327:                                              ; preds = %320, %313
  %328 = load i32, ptr %21, align 4, !tbaa !5
  %329 = add nsw i32 %328, 1
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds i8, ptr %296, i64 %330
  %332 = getelementptr inbounds [15 x i8], ptr %20, i64 0, i64 0
  %333 = call ptr @strcpy(ptr noundef %331, ptr noundef %332) #8
  store ptr %296, ptr %24, align 8, !tbaa !9
  br label %337

334:                                              ; preds = %320
  %335 = load i32, ptr %21, align 4, !tbaa !5
  %336 = add nsw i32 %335, -1
  store i32 %336, ptr %21, align 4, !tbaa !5
  br label %310, !llvm.loop !25

337:                                              ; preds = %327, %310
  br label %338

338:                                              ; preds = %337, %302
  %339 = load ptr, ptr %8, align 8, !tbaa !9
  %340 = load ptr, ptr %24, align 8, !tbaa !9
  %341 = load i8, ptr %19, align 1, !tbaa !11, !range !16, !noundef !17
  %342 = trunc i8 %341 to i1
  %343 = zext i1 %342 to i64
  %344 = select i1 %342, ptr @.str.35, ptr null
  %345 = call noundef zeroext i1 @_Z10flash_fileP10SerialPortPcjS1_(ptr noundef %339, ptr noundef %340, i32 noundef 0, ptr noundef %344)
  %346 = zext i1 %345 to i8
  store i8 %346, ptr %7, align 1, !tbaa !11
  %347 = load i8, ptr %7, align 1, !tbaa !11, !range !16, !noundef !17
  %348 = trunc i8 %347 to i1
  br i1 %348, label %349, label %356

349:                                              ; preds = %338
  %350 = load i8, ptr %19, align 1, !tbaa !11, !range !16, !noundef !17
  %351 = trunc i8 %350 to i1
  br i1 %351, label %356, label %352

352:                                              ; preds = %349
  %353 = load ptr, ptr %8, align 8, !tbaa !9
  %354 = call noundef zeroext i1 @_Z20flash_default_configP10SerialPort(ptr noundef %353)
  %355 = zext i1 %354 to i8
  store i8 %355, ptr %7, align 1, !tbaa !11
  br label %356

356:                                              ; preds = %352, %349, %338
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  %357 = load ptr, ptr %22, align 8
  call void @llvm.stackrestore.p0(ptr %357)
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 15, ptr %20) #8
  br label %503

358:                                              ; preds = %275
  %359 = load i32, ptr %4, align 4, !tbaa !5
  %360 = load i32, ptr %6, align 4, !tbaa !5
  %361 = sub nsw i32 %359, %360
  %362 = srem i32 %361, 2
  %363 = icmp ne i32 %362, 0
  br i1 %363, label %364, label %374

364:                                              ; preds = %358
  %365 = load ptr, ptr %8, align 8, !tbaa !9
  %366 = icmp eq ptr %365, null
  br i1 %366, label %371, label %367

367:                                              ; preds = %364
  %368 = load ptr, ptr %365, align 8, !tbaa !18
  %369 = getelementptr inbounds ptr, ptr %368, i64 1
  %370 = load ptr, ptr %369, align 8
  call void %370(ptr noundef nonnull align 8 dereferenceable(292) %365) #8
  br label %371

371:                                              ; preds = %367, %364
  %372 = call i32 (ptr, ...) @printf(ptr noundef @.str.36)
  %373 = call noundef i32 @_Z4exitv()
  store i32 %373, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %532

374:                                              ; preds = %358
  %375 = call i32 (ptr, ...) @printf(ptr noundef @.str.37)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  %376 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %376, ptr %26, align 4, !tbaa !5
  br label %377

377:                                              ; preds = %462, %374
  %378 = load i32, ptr %26, align 4, !tbaa !5
  %379 = load i32, ptr %4, align 4, !tbaa !5
  %380 = sub nsw i32 %379, 1
  %381 = icmp slt i32 %378, %380
  br i1 %381, label %383, label %382

382:                                              ; preds = %377
  store i32 22, ptr %10, align 4
  br label %465

383:                                              ; preds = %377
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %384 = load ptr, ptr %5, align 8, !tbaa !9
  %385 = load i32, ptr %26, align 4, !tbaa !5
  %386 = sext i32 %385 to i64
  %387 = getelementptr inbounds ptr, ptr %384, i64 %386
  %388 = load ptr, ptr %387, align 8, !tbaa !9
  %389 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %388, ptr noundef @.str.38, ptr noundef %27) #8
  %390 = icmp ne i32 %389, 0
  br i1 %390, label %391, label %431

391:                                              ; preds = %383
  %392 = load i32, ptr %27, align 4, !tbaa !5
  %393 = load ptr, ptr %5, align 8, !tbaa !9
  %394 = load i32, ptr %26, align 4, !tbaa !5
  %395 = add nsw i32 %394, 1
  %396 = sext i32 %395 to i64
  %397 = getelementptr inbounds ptr, ptr %393, i64 %396
  %398 = load ptr, ptr %397, align 8, !tbaa !9
  %399 = call i32 (ptr, ...) @printf(ptr noundef @.str.39, i32 noundef %392, ptr noundef %398)
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %400 = load ptr, ptr %5, align 8, !tbaa !9
  %401 = load i32, ptr %26, align 4, !tbaa !5
  %402 = add nsw i32 %401, 1
  %403 = sext i32 %402 to i64
  %404 = getelementptr inbounds ptr, ptr %400, i64 %403
  %405 = load ptr, ptr %404, align 8, !tbaa !9
  %406 = call noalias ptr @fopen(ptr noundef %405, ptr noundef @.str.11)
  store ptr %406, ptr %28, align 8, !tbaa !9
  %407 = load ptr, ptr %28, align 8, !tbaa !9
  %408 = icmp ne ptr %407, null
  br i1 %408, label %425, label %409

409:                                              ; preds = %391
  %410 = load ptr, ptr %8, align 8, !tbaa !9
  %411 = icmp eq ptr %410, null
  br i1 %411, label %416, label %412

412:                                              ; preds = %409
  %413 = load ptr, ptr %410, align 8, !tbaa !18
  %414 = getelementptr inbounds ptr, ptr %413, i64 1
  %415 = load ptr, ptr %414, align 8
  call void %415(ptr noundef nonnull align 8 dereferenceable(292) %410) #8
  br label %416

416:                                              ; preds = %412, %409
  %417 = load ptr, ptr %5, align 8, !tbaa !9
  %418 = load i32, ptr %26, align 4, !tbaa !5
  %419 = add nsw i32 %418, 1
  %420 = sext i32 %419 to i64
  %421 = getelementptr inbounds ptr, ptr %417, i64 %420
  %422 = load ptr, ptr %421, align 8, !tbaa !9
  %423 = call i32 (ptr, ...) @printf(ptr noundef @.str.40, ptr noundef %422)
  %424 = call noundef i32 @_Z4exitv()
  store i32 %424, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %428

425:                                              ; preds = %391
  %426 = load ptr, ptr %28, align 8, !tbaa !9
  %427 = call i32 @fclose(ptr noundef %426)
  store i32 0, ptr %10, align 4
  br label %428

428:                                              ; preds = %425, %416
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  %429 = load i32, ptr %10, align 4
  switch i32 %429, label %459 [
    i32 0, label %430
  ]

430:                                              ; preds = %428
  br label %458

431:                                              ; preds = %383
  %432 = load ptr, ptr %8, align 8, !tbaa !9
  %433 = icmp eq ptr %432, null
  br i1 %433, label %438, label %434

434:                                              ; preds = %431
  %435 = load ptr, ptr %432, align 8, !tbaa !18
  %436 = getelementptr inbounds ptr, ptr %435, i64 1
  %437 = load ptr, ptr %436, align 8
  call void %437(ptr noundef nonnull align 8 dereferenceable(292) %432) #8
  br label %438

438:                                              ; preds = %434, %431
  %439 = load ptr, ptr %5, align 8, !tbaa !9
  %440 = load i32, ptr %26, align 4, !tbaa !5
  %441 = sext i32 %440 to i64
  %442 = getelementptr inbounds ptr, ptr %439, i64 %441
  %443 = load ptr, ptr %442, align 8, !tbaa !9
  %444 = load ptr, ptr %5, align 8, !tbaa !9
  %445 = load i32, ptr %26, align 4, !tbaa !5
  %446 = add nsw i32 %445, 1
  %447 = sext i32 %446 to i64
  %448 = getelementptr inbounds ptr, ptr %444, i64 %447
  %449 = load ptr, ptr %448, align 8, !tbaa !9
  %450 = call i32 (ptr, ...) @printf(ptr noundef @.str.41, ptr noundef %443, ptr noundef %449)
  %451 = load ptr, ptr %5, align 8, !tbaa !9
  %452 = load i32, ptr %26, align 4, !tbaa !5
  %453 = sext i32 %452 to i64
  %454 = getelementptr inbounds ptr, ptr %451, i64 %453
  %455 = load ptr, ptr %454, align 8, !tbaa !9
  %456 = call i32 (ptr, ...) @printf(ptr noundef @.str.42, ptr noundef %455)
  %457 = call noundef i32 @_Z4exitv()
  store i32 %457, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %459

458:                                              ; preds = %430
  store i32 0, ptr %10, align 4
  br label %459

459:                                              ; preds = %458, %438, %428
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  %460 = load i32, ptr %10, align 4
  switch i32 %460, label %465 [
    i32 0, label %461
  ]

461:                                              ; preds = %459
  br label %462

462:                                              ; preds = %461
  %463 = load i32, ptr %26, align 4, !tbaa !5
  %464 = add nsw i32 %463, 2
  store i32 %464, ptr %26, align 4, !tbaa !5
  br label %377, !llvm.loop !26

465:                                              ; preds = %459, %382
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  %466 = load i32, ptr %10, align 4
  switch i32 %466, label %532 [
    i32 22, label %467
  ]

467:                                              ; preds = %465
  %468 = call i32 (ptr, ...) @printf(ptr noundef @.str.43)
  br label %469

469:                                              ; preds = %499, %467
  %470 = load i32, ptr %6, align 4, !tbaa !5
  %471 = load i32, ptr %4, align 4, !tbaa !5
  %472 = sub nsw i32 %471, 1
  %473 = icmp slt i32 %470, %472
  br i1 %473, label %474, label %477

474:                                              ; preds = %469
  %475 = load i8, ptr %7, align 1, !tbaa !11, !range !16, !noundef !17
  %476 = trunc i8 %475 to i1
  br label %477

477:                                              ; preds = %474, %469
  %478 = phi i1 [ false, %469 ], [ %476, %474 ]
  br i1 %478, label %479, label %502

479:                                              ; preds = %477
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  %480 = load ptr, ptr %5, align 8, !tbaa !9
  %481 = load i32, ptr %6, align 4, !tbaa !5
  %482 = sext i32 %481 to i64
  %483 = getelementptr inbounds ptr, ptr %480, i64 %482
  %484 = load ptr, ptr %483, align 8, !tbaa !9
  %485 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %484, ptr noundef @.str.38, ptr noundef %29) #8
  %486 = icmp ne i32 %485, 0
  br i1 %486, label %487, label %498

487:                                              ; preds = %479
  %488 = load ptr, ptr %8, align 8, !tbaa !9
  %489 = load ptr, ptr %5, align 8, !tbaa !9
  %490 = load i32, ptr %6, align 4, !tbaa !5
  %491 = add nsw i32 %490, 1
  %492 = sext i32 %491 to i64
  %493 = getelementptr inbounds ptr, ptr %489, i64 %492
  %494 = load ptr, ptr %493, align 8, !tbaa !9
  %495 = load i32, ptr %29, align 4, !tbaa !5
  %496 = call noundef zeroext i1 @_Z10flash_fileP10SerialPortPcjS1_(ptr noundef %488, ptr noundef %494, i32 noundef %495, ptr noundef null)
  %497 = zext i1 %496 to i8
  store i8 %497, ptr %7, align 1, !tbaa !11
  br label %498

498:                                              ; preds = %487, %479
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %499

499:                                              ; preds = %498
  %500 = load i32, ptr %6, align 4, !tbaa !5
  %501 = add nsw i32 %500, 2
  store i32 %501, ptr %6, align 4, !tbaa !5
  br label %469, !llvm.loop !27

502:                                              ; preds = %477
  br label %503

503:                                              ; preds = %502, %356
  %504 = load i8, ptr %7, align 1, !tbaa !11, !range !16, !noundef !17
  %505 = trunc i8 %504 to i1
  br i1 %505, label %506, label %512

506:                                              ; preds = %503
  %507 = load ptr, ptr %8, align 8, !tbaa !9
  %508 = call noundef zeroext i1 @_Z11flash_startP10SerialPortjjj(ptr noundef %507, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %509 = load ptr, ptr %8, align 8, !tbaa !9
  %510 = call noundef zeroext i1 @_Z10flash_doneP10SerialPort(ptr noundef %509)
  %511 = zext i1 %510 to i8
  store i8 %511, ptr %7, align 1, !tbaa !11
  br label %512

512:                                              ; preds = %506, %503
  %513 = load ptr, ptr %8, align 8, !tbaa !9
  %514 = icmp eq ptr %513, null
  br i1 %514, label %519, label %515

515:                                              ; preds = %512
  %516 = load ptr, ptr %513, align 8, !tbaa !18
  %517 = getelementptr inbounds ptr, ptr %516, i64 1
  %518 = load ptr, ptr %517, align 8
  call void %518(ptr noundef nonnull align 8 dereferenceable(292) %513) #8
  br label %519

519:                                              ; preds = %515, %512
  %520 = load i8, ptr %7, align 1, !tbaa !11, !range !16, !noundef !17
  %521 = trunc i8 %520 to i1
  br i1 %521, label %522, label %524

522:                                              ; preds = %519
  %523 = call i32 (ptr, ...) @printf(ptr noundef @.str.44)
  br label %526

524:                                              ; preds = %519
  %525 = call i32 (ptr, ...) @printf(ptr noundef @.str.45)
  br label %526

526:                                              ; preds = %524, %522
  %527 = call noundef i32 @_Z4exitv()
  %528 = load i8, ptr %7, align 1, !tbaa !11, !range !16, !noundef !17
  %529 = trunc i8 %528 to i1
  %530 = zext i1 %529 to i64
  %531 = select i1 %529, i32 0, i32 1
  store i32 %531, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %532

532:                                              ; preds = %526, %465, %371, %271
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #8
  br label %533

533:                                              ; preds = %532, %243, %102, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  %534 = load i32, ptr %3, align 4
  ret i32 %534
}

; Function Attrs: nounwind
declare void @setbuf(ptr noundef, ptr noundef) #7

declare noundef ptr @_ZN10SerialPort4openEPKc(ptr noundef) #0

declare noundef ptr @_ZN10SerialPort12findNextPortEb(i1 noundef zeroext) #0

declare noundef ptr @_ZN10SerialPort7getNameEv(ptr noundef nonnull align 8 dereferenceable(292)) #0

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #7

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #7

attributes #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind "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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!19, !19, i64 0}
!19 = !{!"vtable pointer", !8, i64 0}
!20 = distinct !{!20, !14}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !14}
!27 = distinct !{!27, !14}


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

@TIMEOUT = external dso_local local_unnamed_addr global i32, align 4
@mCurrentPort = external dso_local local_unnamed_addr global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.25 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [264 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [345 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [165 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [258 x i8], align 1
@__const.main.dh = external hidden unnamed_addr constant [15 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [19 x i8], align 1

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

; 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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.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
declare void @llvm.stackrestore.p0(ptr) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z11flash_startP10SerialPortjjj(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress 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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z10flash_fileP10SerialPortPcjS1_(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z10flash_doneP10SerialPort(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z10flash_syncP10SerialPortb(ptr noundef, i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4exitv() local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z20flash_default_configP10SerialPort(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z16force_flash_modeP10SerialPort(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6rebootP10SerialPort(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #6 {
  %3 = alloca [20 x ptr], align 16
  %4 = alloca [15 x i8], align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = load ptr, ptr @stdout, align 8, !tbaa !5
  tail call void @setbuf(ptr noundef %7, ptr noundef null) #10
  %8 = icmp sgt i32 %0, 1
  br i1 %8, label %9, label %.preheader206.preheader

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.25, i64 noundef 5) #11
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %.preheader, label %.preheader206.preheader

14:                                               ; preds = %.preheader
  br i1 %18, label %21, label %25

.preheader:                                       ; preds = %9, %.preheader
  %.0142221 = phi i32 [ %17, %.preheader ], [ 0, %9 ]
  %15 = load ptr, ptr %10, align 8, !tbaa !5
  %16 = tail call noundef ptr @_ZN10SerialPort4openEPKc(ptr noundef %15)
  %17 = add nuw nsw i32 %.0142221, 1
  %18 = icmp eq ptr %16, null
  %19 = icmp ult i32 %.0142221, 2
  %20 = select i1 %18, i1 %19, i1 false
  br i1 %20, label %.preheader, label %14, !llvm.loop !9

21:                                               ; preds = %14
  %22 = load ptr, ptr %10, align 8, !tbaa !5
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26, ptr noundef %22)
  %24 = tail call noundef i32 @_Z4exitv()
  br label %318

25:                                               ; preds = %14
  store i32 500, ptr @TIMEOUT, align 4, !tbaa !11
  tail call void @_Z16force_flash_modeP10SerialPort(ptr noundef nonnull %16)
  %26 = tail call noundef zeroext i1 @_Z10flash_syncP10SerialPortb(ptr noundef nonnull %16, i1 noundef zeroext false)
  br i1 %26, label %.thread182, label %27

27:                                               ; preds = %25
  tail call void @_Z16force_flash_modeP10SerialPort(ptr noundef nonnull %16)
  %28 = tail call noundef zeroext i1 @_Z10flash_syncP10SerialPortb(ptr noundef nonnull %16, i1 noundef zeroext false)
  br i1 %28, label %.thread182, label %29

29:                                               ; preds = %27
  tail call void @_Z16force_flash_modeP10SerialPort(ptr noundef nonnull %16)
  %30 = tail call noundef zeroext i1 @_Z10flash_syncP10SerialPortb(ptr noundef nonnull %16, i1 noundef zeroext false)
  br i1 %30, label %.thread182, label %31

31:                                               ; preds = %29
  %32 = load ptr, ptr %16, align 8, !tbaa !13
  %33 = getelementptr inbounds i8, ptr %32, i64 8
  %34 = load ptr, ptr %33, align 8
  tail call void %34(ptr noundef nonnull align 8 dereferenceable(292) %16) #10
  %35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27)
  %36 = tail call noundef i32 @_Z4exitv()
  br label %318

.thread182:                                       ; preds = %29, %27, %25
  store i32 5000, ptr @TIMEOUT, align 4, !tbaa !11
  br label %204

.preheader206.preheader:                          ; preds = %9, %2
  store i32 500, ptr @TIMEOUT, align 4, !tbaa !11
  %37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28)
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %3) #10
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(160) %3, i8 0, i64 160, i1 false), !tbaa !5
  br label %.preheader206

.preheader206:                                    ; preds = %.preheader206.preheader, %.critedge175
  %.0144219 = phi i32 [ %59, %.critedge175 ], [ 0, %.preheader206.preheader ]
  br label %41

38:                                               ; preds = %.critedge175
  %39 = tail call noundef ptr @_ZN10SerialPort12findNextPortEb(i1 noundef zeroext true)
  %40 = load ptr, ptr %3, align 16, !tbaa !5
  %.not162 = icmp eq ptr %40, null
  %.not163 = icmp eq ptr %40, %.3135.lcssa
  %or.cond = or i1 %.not162, %.not163
  br i1 %or.cond, label %67, label %63

41:                                               ; preds = %.preheader206, %55
  %indvars.iv = phi i64 [ 0, %.preheader206 ], [ %indvars.iv.next, %55 ]
  %42 = getelementptr inbounds [20 x ptr], ptr %3, i64 0, i64 %indvars.iv
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  %.not164 = icmp eq ptr %43, null
  br i1 %.not164, label %44, label %.thread184

44:                                               ; preds = %41
  %45 = tail call noundef ptr @_ZN10SerialPort12findNextPortEb(i1 noundef zeroext false)
  %46 = load i8, ptr %45, align 1, !tbaa !15
  %.not165 = icmp eq i8 %46, 0
  br i1 %.not165, label %.critedge175, label %47

47:                                               ; preds = %44
  %48 = tail call noundef ptr @_ZN10SerialPort4openEPKc(ptr noundef nonnull %45)
  store ptr %48, ptr %42, align 8, !tbaa !5
  %.not166 = icmp eq ptr %48, null
  br i1 %.not166, label %55, label %.thread184

.thread184:                                       ; preds = %41, %47
  %49 = phi ptr [ %48, %47 ], [ %43, %41 ]
  store ptr %49, ptr @mCurrentPort, align 8, !tbaa !5
  tail call void @_Z16force_flash_modeP10SerialPort(ptr noundef nonnull %49)
  %50 = tail call noundef zeroext i1 @_Z10flash_syncP10SerialPortb(ptr noundef nonnull %49, i1 noundef zeroext false)
  br i1 %50, label %51, label %54

51:                                               ; preds = %.thread184
  %52 = tail call noundef ptr @_ZN10SerialPort7getNameEv(ptr noundef nonnull align 8 dereferenceable(292) %49)
  %53 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef %52)
  br label %54

54:                                               ; preds = %51, %.thread184
  %.4136 = phi ptr [ %49, %51 ], [ null, %.thread184 ]
  store ptr null, ptr @mCurrentPort, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %47, %54
  %.5137 = phi ptr [ %.4136, %54 ], [ null, %47 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %56 = icmp eq ptr %.5137, null
  %57 = icmp ult i64 %indvars.iv, 19
  %58 = and i1 %56, %57
  br i1 %58, label %41, label %.critedge175, !llvm.loop !16

.critedge175:                                     ; preds = %44, %55
  %.3135.lcssa = phi ptr [ null, %44 ], [ %.5137, %55 ]
  %59 = add nuw nsw i32 %.0144219, 1
  %60 = icmp eq ptr %.3135.lcssa, null
  %61 = icmp ult i32 %.0144219, 2
  %62 = select i1 %60, i1 %61, i1 false
  br i1 %62, label %.preheader206, label %38, !llvm.loop !17

63:                                               ; preds = %38
  %64 = load ptr, ptr %40, align 8, !tbaa !13
  %65 = getelementptr inbounds i8, ptr %64, i64 8
  %66 = load ptr, ptr %65, align 8
  tail call void %66(ptr noundef nonnull align 8 dereferenceable(292) %40) #10
  br label %67

67:                                               ; preds = %38, %63
  %68 = getelementptr inbounds i8, ptr %3, i64 8
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  %.not162.1 = icmp eq ptr %69, null
  %.not163.1 = icmp eq ptr %69, %.3135.lcssa
  %or.cond.1 = or i1 %.not162.1, %.not163.1
  br i1 %or.cond.1, label %74, label %70

70:                                               ; preds = %67
  %71 = load ptr, ptr %69, align 8, !tbaa !13
  %72 = getelementptr inbounds i8, ptr %71, i64 8
  %73 = load ptr, ptr %72, align 8
  tail call void %73(ptr noundef nonnull align 8 dereferenceable(292) %69) #10
  br label %74

74:                                               ; preds = %70, %67
  %75 = getelementptr inbounds i8, ptr %3, i64 16
  %76 = load ptr, ptr %75, align 16, !tbaa !5
  %.not162.2 = icmp eq ptr %76, null
  %.not163.2 = icmp eq ptr %76, %.3135.lcssa
  %or.cond.2 = or i1 %.not162.2, %.not163.2
  br i1 %or.cond.2, label %81, label %77

77:                                               ; preds = %74
  %78 = load ptr, ptr %76, align 8, !tbaa !13
  %79 = getelementptr inbounds i8, ptr %78, i64 8
  %80 = load ptr, ptr %79, align 8
  tail call void %80(ptr noundef nonnull align 8 dereferenceable(292) %76) #10
  br label %81

81:                                               ; preds = %77, %74
  %82 = getelementptr inbounds i8, ptr %3, i64 24
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %.not162.3 = icmp eq ptr %83, null
  %.not163.3 = icmp eq ptr %83, %.3135.lcssa
  %or.cond.3 = or i1 %.not162.3, %.not163.3
  br i1 %or.cond.3, label %88, label %84

84:                                               ; preds = %81
  %85 = load ptr, ptr %83, align 8, !tbaa !13
  %86 = getelementptr inbounds i8, ptr %85, i64 8
  %87 = load ptr, ptr %86, align 8
  tail call void %87(ptr noundef nonnull align 8 dereferenceable(292) %83) #10
  br label %88

88:                                               ; preds = %84, %81
  %89 = getelementptr inbounds i8, ptr %3, i64 32
  %90 = load ptr, ptr %89, align 16, !tbaa !5
  %.not162.4 = icmp eq ptr %90, null
  %.not163.4 = icmp eq ptr %90, %.3135.lcssa
  %or.cond.4 = or i1 %.not162.4, %.not163.4
  br i1 %or.cond.4, label %95, label %91

91:                                               ; preds = %88
  %92 = load ptr, ptr %90, align 8, !tbaa !13
  %93 = getelementptr inbounds i8, ptr %92, i64 8
  %94 = load ptr, ptr %93, align 8
  tail call void %94(ptr noundef nonnull align 8 dereferenceable(292) %90) #10
  br label %95

95:                                               ; preds = %91, %88
  %96 = getelementptr inbounds i8, ptr %3, i64 40
  %97 = load ptr, ptr %96, align 8, !tbaa !5
  %.not162.5 = icmp eq ptr %97, null
  %.not163.5 = icmp eq ptr %97, %.3135.lcssa
  %or.cond.5 = or i1 %.not162.5, %.not163.5
  br i1 %or.cond.5, label %102, label %98

98:                                               ; preds = %95
  %99 = load ptr, ptr %97, align 8, !tbaa !13
  %100 = getelementptr inbounds i8, ptr %99, i64 8
  %101 = load ptr, ptr %100, align 8
  tail call void %101(ptr noundef nonnull align 8 dereferenceable(292) %97) #10
  br label %102

102:                                              ; preds = %98, %95
  %103 = getelementptr inbounds i8, ptr %3, i64 48
  %104 = load ptr, ptr %103, align 16, !tbaa !5
  %.not162.6 = icmp eq ptr %104, null
  %.not163.6 = icmp eq ptr %104, %.3135.lcssa
  %or.cond.6 = or i1 %.not162.6, %.not163.6
  br i1 %or.cond.6, label %109, label %105

105:                                              ; preds = %102
  %106 = load ptr, ptr %104, align 8, !tbaa !13
  %107 = getelementptr inbounds i8, ptr %106, i64 8
  %108 = load ptr, ptr %107, align 8
  tail call void %108(ptr noundef nonnull align 8 dereferenceable(292) %104) #10
  br label %109

109:                                              ; preds = %105, %102
  %110 = getelementptr inbounds i8, ptr %3, i64 56
  %111 = load ptr, ptr %110, align 8, !tbaa !5
  %.not162.7 = icmp eq ptr %111, null
  %.not163.7 = icmp eq ptr %111, %.3135.lcssa
  %or.cond.7 = or i1 %.not162.7, %.not163.7
  br i1 %or.cond.7, label %116, label %112

112:                                              ; preds = %109
  %113 = load ptr, ptr %111, align 8, !tbaa !13
  %114 = getelementptr inbounds i8, ptr %113, i64 8
  %115 = load ptr, ptr %114, align 8
  tail call void %115(ptr noundef nonnull align 8 dereferenceable(292) %111) #10
  br label %116

116:                                              ; preds = %112, %109
  %117 = getelementptr inbounds i8, ptr %3, i64 64
  %118 = load ptr, ptr %117, align 16, !tbaa !5
  %.not162.8 = icmp eq ptr %118, null
  %.not163.8 = icmp eq ptr %118, %.3135.lcssa
  %or.cond.8 = or i1 %.not162.8, %.not163.8
  br i1 %or.cond.8, label %123, label %119

119:                                              ; preds = %116
  %120 = load ptr, ptr %118, align 8, !tbaa !13
  %121 = getelementptr inbounds i8, ptr %120, i64 8
  %122 = load ptr, ptr %121, align 8
  tail call void %122(ptr noundef nonnull align 8 dereferenceable(292) %118) #10
  br label %123

123:                                              ; preds = %119, %116
  %124 = getelementptr inbounds i8, ptr %3, i64 72
  %125 = load ptr, ptr %124, align 8, !tbaa !5
  %.not162.9 = icmp eq ptr %125, null
  %.not163.9 = icmp eq ptr %125, %.3135.lcssa
  %or.cond.9 = or i1 %.not162.9, %.not163.9
  br i1 %or.cond.9, label %130, label %126

126:                                              ; preds = %123
  %127 = load ptr, ptr %125, align 8, !tbaa !13
  %128 = getelementptr inbounds i8, ptr %127, i64 8
  %129 = load ptr, ptr %128, align 8
  tail call void %129(ptr noundef nonnull align 8 dereferenceable(292) %125) #10
  br label %130

130:                                              ; preds = %126, %123
  %131 = getelementptr inbounds i8, ptr %3, i64 80
  %132 = load ptr, ptr %131, align 16, !tbaa !5
  %.not162.10 = icmp eq ptr %132, null
  %.not163.10 = icmp eq ptr %132, %.3135.lcssa
  %or.cond.10 = or i1 %.not162.10, %.not163.10
  br i1 %or.cond.10, label %137, label %133

133:                                              ; preds = %130
  %134 = load ptr, ptr %132, align 8, !tbaa !13
  %135 = getelementptr inbounds i8, ptr %134, i64 8
  %136 = load ptr, ptr %135, align 8
  tail call void %136(ptr noundef nonnull align 8 dereferenceable(292) %132) #10
  br label %137

137:                                              ; preds = %133, %130
  %138 = getelementptr inbounds i8, ptr %3, i64 88
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  %.not162.11 = icmp eq ptr %139, null
  %.not163.11 = icmp eq ptr %139, %.3135.lcssa
  %or.cond.11 = or i1 %.not162.11, %.not163.11
  br i1 %or.cond.11, label %144, label %140

140:                                              ; preds = %137
  %141 = load ptr, ptr %139, align 8, !tbaa !13
  %142 = getelementptr inbounds i8, ptr %141, i64 8
  %143 = load ptr, ptr %142, align 8
  tail call void %143(ptr noundef nonnull align 8 dereferenceable(292) %139) #10
  br label %144

144:                                              ; preds = %140, %137
  %145 = getelementptr inbounds i8, ptr %3, i64 96
  %146 = load ptr, ptr %145, align 16, !tbaa !5
  %.not162.12 = icmp eq ptr %146, null
  %.not163.12 = icmp eq ptr %146, %.3135.lcssa
  %or.cond.12 = or i1 %.not162.12, %.not163.12
  br i1 %or.cond.12, label %151, label %147

147:                                              ; preds = %144
  %148 = load ptr, ptr %146, align 8, !tbaa !13
  %149 = getelementptr inbounds i8, ptr %148, i64 8
  %150 = load ptr, ptr %149, align 8
  tail call void %150(ptr noundef nonnull align 8 dereferenceable(292) %146) #10
  br label %151

151:                                              ; preds = %147, %144
  %152 = getelementptr inbounds i8, ptr %3, i64 104
  %153 = load ptr, ptr %152, align 8, !tbaa !5
  %.not162.13 = icmp eq ptr %153, null
  %.not163.13 = icmp eq ptr %153, %.3135.lcssa
  %or.cond.13 = or i1 %.not162.13, %.not163.13
  br i1 %or.cond.13, label %158, label %154

154:                                              ; preds = %151
  %155 = load ptr, ptr %153, align 8, !tbaa !13
  %156 = getelementptr inbounds i8, ptr %155, i64 8
  %157 = load ptr, ptr %156, align 8
  tail call void %157(ptr noundef nonnull align 8 dereferenceable(292) %153) #10
  br label %158

158:                                              ; preds = %154, %151
  %159 = getelementptr inbounds i8, ptr %3, i64 112
  %160 = load ptr, ptr %159, align 16, !tbaa !5
  %.not162.14 = icmp eq ptr %160, null
  %.not163.14 = icmp eq ptr %160, %.3135.lcssa
  %or.cond.14 = or i1 %.not162.14, %.not163.14
  br i1 %or.cond.14, label %165, label %161

161:                                              ; preds = %158
  %162 = load ptr, ptr %160, align 8, !tbaa !13
  %163 = getelementptr inbounds i8, ptr %162, i64 8
  %164 = load ptr, ptr %163, align 8
  tail call void %164(ptr noundef nonnull align 8 dereferenceable(292) %160) #10
  br label %165

165:                                              ; preds = %161, %158
  %166 = getelementptr inbounds i8, ptr %3, i64 120
  %167 = load ptr, ptr %166, align 8, !tbaa !5
  %.not162.15 = icmp eq ptr %167, null
  %.not163.15 = icmp eq ptr %167, %.3135.lcssa
  %or.cond.15 = or i1 %.not162.15, %.not163.15
  br i1 %or.cond.15, label %172, label %168

168:                                              ; preds = %165
  %169 = load ptr, ptr %167, align 8, !tbaa !13
  %170 = getelementptr inbounds i8, ptr %169, i64 8
  %171 = load ptr, ptr %170, align 8
  tail call void %171(ptr noundef nonnull align 8 dereferenceable(292) %167) #10
  br label %172

172:                                              ; preds = %168, %165
  %173 = getelementptr inbounds i8, ptr %3, i64 128
  %174 = load ptr, ptr %173, align 16, !tbaa !5
  %.not162.16 = icmp eq ptr %174, null
  %.not163.16 = icmp eq ptr %174, %.3135.lcssa
  %or.cond.16 = or i1 %.not162.16, %.not163.16
  br i1 %or.cond.16, label %179, label %175

175:                                              ; preds = %172
  %176 = load ptr, ptr %174, align 8, !tbaa !13
  %177 = getelementptr inbounds i8, ptr %176, i64 8
  %178 = load ptr, ptr %177, align 8
  tail call void %178(ptr noundef nonnull align 8 dereferenceable(292) %174) #10
  br label %179

179:                                              ; preds = %175, %172
  %180 = getelementptr inbounds i8, ptr %3, i64 136
  %181 = load ptr, ptr %180, align 8, !tbaa !5
  %.not162.17 = icmp eq ptr %181, null
  %.not163.17 = icmp eq ptr %181, %.3135.lcssa
  %or.cond.17 = or i1 %.not162.17, %.not163.17
  br i1 %or.cond.17, label %186, label %182

182:                                              ; preds = %179
  %183 = load ptr, ptr %181, align 8, !tbaa !13
  %184 = getelementptr inbounds i8, ptr %183, i64 8
  %185 = load ptr, ptr %184, align 8
  tail call void %185(ptr noundef nonnull align 8 dereferenceable(292) %181) #10
  br label %186

186:                                              ; preds = %182, %179
  %187 = getelementptr inbounds i8, ptr %3, i64 144
  %188 = load ptr, ptr %187, align 16, !tbaa !5
  %.not162.18 = icmp eq ptr %188, null
  %.not163.18 = icmp eq ptr %188, %.3135.lcssa
  %or.cond.18 = or i1 %.not162.18, %.not163.18
  br i1 %or.cond.18, label %193, label %189

189:                                              ; preds = %186
  %190 = load ptr, ptr %188, align 8, !tbaa !13
  %191 = getelementptr inbounds i8, ptr %190, i64 8
  %192 = load ptr, ptr %191, align 8
  tail call void %192(ptr noundef nonnull align 8 dereferenceable(292) %188) #10
  br label %193

193:                                              ; preds = %189, %186
  %194 = getelementptr inbounds i8, ptr %3, i64 152
  %195 = load ptr, ptr %194, align 8, !tbaa !5
  %.not162.19 = icmp eq ptr %195, null
  %.not163.19 = icmp eq ptr %195, %.3135.lcssa
  %or.cond.19 = or i1 %.not162.19, %.not163.19
  br i1 %or.cond.19, label %200, label %196

196:                                              ; preds = %193
  %197 = load ptr, ptr %195, align 8, !tbaa !13
  %198 = getelementptr inbounds i8, ptr %197, i64 8
  %199 = load ptr, ptr %198, align 8
  tail call void %199(ptr noundef nonnull align 8 dereferenceable(292) %195) #10
  br label %200

200:                                              ; preds = %196, %193
  store i32 5000, ptr @TIMEOUT, align 4, !tbaa !11
  br i1 %60, label %.thread186, label %203

.thread186:                                       ; preds = %200
  %201 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30, i32 noundef 20)
  %202 = tail call noundef i32 @_Z4exitv()
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %3) #10
  br label %318

203:                                              ; preds = %200
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %3) #10
  br label %204

204:                                              ; preds = %203, %.thread182
  %.0123180 = phi i32 [ 1, %203 ], [ 2, %.thread182 ]
  %.6138 = phi ptr [ %.3135.lcssa, %203 ], [ %16, %.thread182 ]
  %205 = tail call noundef zeroext i1 @_Z10flash_syncP10SerialPortb(ptr noundef nonnull %.6138, i1 noundef zeroext false)
  %206 = icmp sge i32 %.0123180, %0
  br i1 %206, label %218, label %207

207:                                              ; preds = %204
  %208 = zext nneg i32 %.0123180 to i64
  %209 = getelementptr inbounds ptr, ptr %1, i64 %208
  %210 = load ptr, ptr %209, align 8, !tbaa !5
  %211 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %210, ptr noundef nonnull dereferenceable(1) @.str.31, i64 noundef 5) #11
  %212 = icmp eq i32 %211, 0
  br i1 %212, label %.thread188, label %213

213:                                              ; preds = %207
  %214 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %210, ptr noundef nonnull dereferenceable(1) @.str.32, i64 noundef 5) #11
  %215 = icmp eq i32 %214, 0
  br i1 %215, label %216, label %.thread

216:                                              ; preds = %213
  tail call void @_Z6rebootP10SerialPort(ptr noundef nonnull %.6138)
  br label %318

.thread188:                                       ; preds = %207
  %217 = add nuw nsw i32 %.0123180, 1
  %.not167191 = icmp ult i32 %217, %0
  br i1 %.not167191, label %.thread, label %218

218:                                              ; preds = %204, %.thread188
  %.str.34.sink = phi ptr [ @.str.33, %.thread188 ], [ @.str.34, %204 ]
  %219 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.34.sink)
  call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %4) #10
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(15) %4, ptr noundef nonnull align 1 dereferenceable(15) @__const.main.dh, i64 15, i1 false)
  %220 = load ptr, ptr %1, align 8, !tbaa !5
  %221 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %220) #11
  %sext = shl i64 %221, 32
  %222 = ashr exact i64 %sext, 32
  %223 = add nsw i64 %222, 15
  %224 = tail call ptr @llvm.stacksave.p0()
  %225 = alloca i8, i64 %223, align 16
  %226 = call noalias ptr @fopen(ptr noundef nonnull %4, ptr noundef nonnull @.str.11)
  %.not173 = icmp eq ptr %226, null
  br i1 %.not173, label %229, label %227

227:                                              ; preds = %218
  %228 = tail call i32 @fclose(ptr noundef nonnull %226)
  br label %.loopexit205

229:                                              ; preds = %218
  %230 = load ptr, ptr %1, align 8, !tbaa !5
  %231 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %225, ptr noundef nonnull dereferenceable(1) %230) #10
  %232 = and i64 %221, 2147483648
  %233 = icmp eq i64 %232, 0
  br i1 %233, label %.lr.ph.preheader, label %.loopexit205

.lr.ph.preheader:                                 ; preds = %229
  %234 = and i64 %221, 2147483647
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %241
  %indvars.iv246 = phi i64 [ %234, %.lr.ph.preheader ], [ %indvars.iv.next247, %241 ]
  %235 = getelementptr inbounds i8, ptr %225, i64 %indvars.iv246
  %236 = load i8, ptr %235, align 1, !tbaa !15
  switch i8 %236, label %241 [
    i8 47, label %237
    i8 92, label %237
  ]

237:                                              ; preds = %.lr.ph, %.lr.ph
  %238 = getelementptr inbounds i8, ptr %225, i64 %indvars.iv246
  %239 = getelementptr inbounds i8, ptr %238, i64 1
  %240 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %239, ptr noundef nonnull dereferenceable(1) %4) #10
  br label %.loopexit205

241:                                              ; preds = %.lr.ph
  %indvars.iv.next247 = add nsw i64 %indvars.iv246, -1
  %242 = icmp sgt i64 %indvars.iv246, 0
  br i1 %242, label %.lr.ph, label %.loopexit205, !llvm.loop !18

.loopexit205:                                     ; preds = %241, %229, %237, %227
  %.0126 = phi ptr [ %4, %227 ], [ %225, %237 ], [ %4, %229 ], [ %4, %241 ]
  %243 = select i1 %206, ptr null, ptr @.str.35
  %244 = call noundef zeroext i1 @_Z10flash_fileP10SerialPortPcjS1_(ptr noundef nonnull %.6138, ptr noundef nonnull %.0126, i32 noundef 0, ptr noundef %243)
  %brmerge.not = and i1 %206, %244
  br i1 %brmerge.not, label %245, label %247

245:                                              ; preds = %.loopexit205
  %246 = call noundef zeroext i1 @_Z20flash_default_configP10SerialPort(ptr noundef nonnull %.6138)
  br label %247

247:                                              ; preds = %.loopexit205, %245
  %.0127.in = phi i1 [ %246, %245 ], [ %244, %.loopexit205 ]
  %.0127 = zext i1 %.0127.in to i8
  call void @llvm.stackrestore.p0(ptr %224)
  call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %4) #10
  br label %.loopexit

.thread:                                          ; preds = %213, %.thread188
  %.1124193 = phi i32 [ %217, %.thread188 ], [ %.0123180, %213 ]
  %248 = sub nsw i32 %0, %.1124193
  %249 = and i32 %248, 1
  %.not168 = icmp eq i32 %249, 0
  br i1 %.not168, label %256, label %250

250:                                              ; preds = %.thread
  %251 = load ptr, ptr %.6138, align 8, !tbaa !13
  %252 = getelementptr inbounds i8, ptr %251, i64 8
  %253 = load ptr, ptr %252, align 8
  tail call void %253(ptr noundef nonnull align 8 dereferenceable(292) %.6138) #10
  %254 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.36)
  %255 = tail call noundef i32 @_Z4exitv()
  br label %318

256:                                              ; preds = %.thread
  %257 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.37)
  %258 = add nsw i32 %0, -1
  %.not171226 = icmp ult i32 %.1124193, %258
  br i1 %.not171226, label %.lr.ph228.preheader, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %256
  %259 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.43)
  br label %.loopexit.thread

.lr.ph228.preheader:                              ; preds = %256
  %260 = zext nneg i32 %.1124193 to i64
  %261 = zext nneg i32 %258 to i64
  br label %.lr.ph228

.lr.ph228:                                        ; preds = %.lr.ph228.preheader, %288
  %indvars.iv249 = phi i64 [ %260, %.lr.ph228.preheader ], [ %indvars.iv.next250, %288 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #10
  %262 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv249
  %263 = load ptr, ptr %262, align 8, !tbaa !5
  %264 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %263, ptr noundef nonnull @.str.38, ptr noundef nonnull %5) #10
  %.not169 = icmp eq i32 %264, 0
  br i1 %.not169, label %277, label %265

265:                                              ; preds = %.lr.ph228
  %266 = load i32, ptr %5, align 4, !tbaa !11
  %267 = getelementptr i8, ptr %262, i64 8
  %268 = load ptr, ptr %267, align 8, !tbaa !5
  %269 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.39, i32 noundef %266, ptr noundef %268)
  %270 = load ptr, ptr %267, align 8, !tbaa !5
  %271 = call noalias ptr @fopen(ptr noundef %270, ptr noundef nonnull @.str.11)
  %.not170 = icmp eq ptr %271, null
  br i1 %.not170, label %272, label %288

272:                                              ; preds = %265
  %273 = getelementptr i8, ptr %262, i64 8
  %274 = load ptr, ptr %.6138, align 8, !tbaa !13
  %275 = getelementptr inbounds i8, ptr %274, i64 8
  %276 = load ptr, ptr %275, align 8
  call void %276(ptr noundef nonnull align 8 dereferenceable(292) %.6138) #10
  br label %.thread203

277:                                              ; preds = %.lr.ph228
  %278 = load ptr, ptr %.6138, align 8, !tbaa !13
  %279 = getelementptr inbounds i8, ptr %278, i64 8
  %280 = load ptr, ptr %279, align 8
  call void %280(ptr noundef nonnull align 8 dereferenceable(292) %.6138) #10
  %281 = load ptr, ptr %262, align 8, !tbaa !5
  %282 = getelementptr i8, ptr %262, i64 8
  %283 = load ptr, ptr %282, align 8, !tbaa !5
  %284 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.41, ptr noundef %281, ptr noundef %283)
  br label %.thread203

.thread203:                                       ; preds = %272, %277
  %.sink265 = phi ptr [ %273, %272 ], [ %262, %277 ]
  %.str.40.sink = phi ptr [ @.str.40, %272 ], [ @.str.42, %277 ]
  %285 = load ptr, ptr %.sink265, align 8, !tbaa !5
  %286 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.40.sink, ptr noundef %285)
  %287 = call noundef i32 @_Z4exitv()
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #10
  br label %318

288:                                              ; preds = %265
  %289 = call i32 @fclose(ptr noundef nonnull %271)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #10
  %indvars.iv.next250 = add nuw nsw i64 %indvars.iv249, 2
  %.not171 = icmp ult i64 %indvars.iv.next250, %261
  br i1 %.not171, label %.lr.ph228, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %288
  %290 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.43)
  br i1 %.not171226, label %.lr.ph232.preheader, label %.loopexit.thread

.lr.ph232.preheader:                              ; preds = %._crit_edge
  %291 = zext nneg i32 %.1124193 to i64
  %292 = sext i32 %258 to i64
  br label %.lr.ph232

.lr.ph232:                                        ; preds = %.lr.ph232.preheader, %302
  %indvars.iv252 = phi i64 [ %291, %.lr.ph232.preheader ], [ %indvars.iv.next253, %302 ]
  %.1128229 = phi i8 [ 1, %.lr.ph232.preheader ], [ %.2129, %302 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #10
  %293 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv252
  %294 = load ptr, ptr %293, align 8, !tbaa !5
  %295 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %294, ptr noundef nonnull @.str.38, ptr noundef nonnull %6) #10
  %.not172 = icmp eq i32 %295, 0
  br i1 %.not172, label %302, label %296

296:                                              ; preds = %.lr.ph232
  %297 = getelementptr i8, ptr %293, i64 8
  %298 = load ptr, ptr %297, align 8, !tbaa !5
  %299 = load i32, ptr %6, align 4, !tbaa !11
  %300 = call noundef zeroext i1 @_Z10flash_fileP10SerialPortPcjS1_(ptr noundef nonnull %.6138, ptr noundef %298, i32 noundef %299, ptr noundef null)
  %301 = zext i1 %300 to i8
  br label %302

302:                                              ; preds = %296, %.lr.ph232
  %.2129 = phi i8 [ %301, %296 ], [ %.1128229, %.lr.ph232 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #10
  %indvars.iv.next253 = add nuw nsw i64 %indvars.iv252, 2
  %303 = icmp slt i64 %indvars.iv.next253, %292
  %304 = trunc nuw i8 %.2129 to i1
  %305 = select i1 %303, i1 %304, i1 false
  br i1 %305, label %.lr.ph232, label %.loopexit, !llvm.loop !20

.loopexit:                                        ; preds = %302, %247
  %.3130 = phi i8 [ %.0127, %247 ], [ %.2129, %302 ]
  %306 = trunc nuw i8 %.3130 to i1
  br i1 %306, label %.loopexit.thread, label %310

.loopexit.thread:                                 ; preds = %._crit_edge.thread, %._crit_edge, %.loopexit
  %307 = call noundef zeroext i1 @_Z11flash_startP10SerialPortjjj(ptr noundef nonnull %.6138, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %308 = call noundef zeroext i1 @_Z10flash_doneP10SerialPort(ptr noundef nonnull %.6138)
  %309 = zext i1 %308 to i8
  br label %310

310:                                              ; preds = %.loopexit, %.loopexit.thread
  %.4131 = phi i8 [ %309, %.loopexit.thread ], [ %.3130, %.loopexit ]
  %311 = load ptr, ptr %.6138, align 8, !tbaa !13
  %312 = getelementptr inbounds i8, ptr %311, i64 8
  %313 = load ptr, ptr %312, align 8
  call void %313(ptr noundef nonnull align 8 dereferenceable(292) %.6138) #10
  %314 = trunc nuw i8 %.4131 to i1
  %.str.44..str.45 = select i1 %314, ptr @.str.44, ptr @.str.45
  %315 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.44..str.45)
  %316 = call noundef i32 @_Z4exitv()
  %not. = xor i1 %314, true
  %317 = zext i1 %not. to i32
  br label %318

318:                                              ; preds = %.thread203, %.thread186, %31, %216, %250, %310, %21
  %.8 = phi i32 [ %36, %31 ], [ %24, %21 ], [ %317, %310 ], [ %255, %250 ], [ 0, %216 ], [ %202, %.thread186 ], [ %287, %.thread203 ]
  ret i32 %.8
}

; Function Attrs: nofree nounwind
declare void @setbuf(ptr nocapture noundef, ptr noundef) local_unnamed_addr #0

declare noundef ptr @_ZN10SerialPort4openEPKc(ptr noundef) local_unnamed_addr #7

declare noundef ptr @_ZN10SerialPort12findNextPortEb(i1 noundef zeroext) local_unnamed_addr #7

declare noundef ptr @_ZN10SerialPort7getNameEv(ptr noundef nonnull align 8 dereferenceable(292)) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #8

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { "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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 #9 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #10 = { nounwind }
attributes #11 = { 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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


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