; LLVM IR from carlk3/no-OS-FatFS-SD-SPI-RPi-Pico :: example/tests (simple)

; 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.FIL = type { %struct.FFOBJID, i8, i8, i64, i32, i64, i64, ptr, ptr, [512 x i8] }
%struct.FFOBJID = type { ptr, i16, i8, i8, i32, i64, i32, i32, i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@stdout = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @simple() #0 {
  %1 = alloca [243 x i8], align 16
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %struct.FIL, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca [10 x i8], align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca [255 x i8], align 16
  %13 = alloca i8, align 1
  %14 = alloca i32, align 4
  %15 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  call void @llvm.lifetime.start.p0(i64 243, ptr %1) #5
  call void @llvm.memset.p0.i64(ptr align 16 %1, i8 0, i64 243, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %16 = getelementptr inbounds [243 x i8], ptr %1, i64 0, i64 0
  %17 = call i32 @f_getcwd(ptr noundef %16, i32 noundef 243)
  store i32 %17, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = icmp ne i32 0, %18
  br i1 %19, label %20, label %25

20:                                               ; preds = %0
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = call ptr @FRESULT_str(i32 noundef %21)
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %22, i32 noundef %23)
  store i32 1, ptr %3, align 4
  br label %255

25:                                               ; preds = %0
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @llvm.lifetime.start.p0(i64 616, ptr %4) #5
  %27 = call i32 @f_open(ptr noundef %4, ptr noundef @.str.3, i8 noundef zeroext 3)
  store i32 %27, ptr %2, align 4, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = icmp ne i32 0, %28
  %30 = zext i1 %29 to i64
  %31 = select i1 %29, ptr @.str.5, ptr @.str.6
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %31)
  %33 = load ptr, ptr @stdout, align 8, !tbaa !9
  %34 = call i32 @fflush(ptr noundef %33)
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = icmp ne i32 0, %35
  br i1 %36, label %37, label %45

37:                                               ; preds = %25
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = icmp ne i32 4, %38
  br i1 %39, label %40, label %45

40:                                               ; preds = %37
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = call ptr @FRESULT_str(i32 noundef %41)
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef %42, i32 noundef %43)
  store i32 1, ptr %3, align 4
  br label %254

45:                                               ; preds = %37, %25
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = icmp eq i32 4, %46
  br i1 %47, label %48, label %112

48:                                               ; preds = %45
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %50 = load ptr, ptr @stdout, align 8, !tbaa !9
  %51 = call i32 @fflush(ptr noundef %50)
  %52 = call i32 @f_open(ptr noundef %4, ptr noundef @.str.3, i8 noundef zeroext 11)
  store i32 %52, ptr %2, align 4, !tbaa !5
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = icmp ne i32 0, %53
  %55 = zext i1 %54 to i64
  %56 = select i1 %54, ptr @.str.5, ptr @.str.6
  %57 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %56)
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = icmp ne i32 0, %58
  br i1 %59, label %60, label %65

60:                                               ; preds = %48
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = call ptr @FRESULT_str(i32 noundef %61)
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef %62, i32 noundef %63)
  br label %65

65:                                               ; preds = %60, %48
  %66 = load ptr, ptr @stdout, align 8, !tbaa !9
  %67 = call i32 @fflush(ptr noundef %66)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %88, %65
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = icmp slt i32 %69, 10
  br i1 %70, label %72, label %71

71:                                               ; preds = %68
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %91

72:                                               ; preds = %68
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %73, i32 noundef 10)
  %75 = load ptr, ptr @stdout, align 8, !tbaa !9
  %76 = call i32 @fflush(ptr noundef %75)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef %4, ptr noundef @.str.10, i32 noundef %77)
  store i32 %78, ptr %6, align 4, !tbaa !5
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = icmp slt i32 %79, 0
  br i1 %80, label %81, label %87

81:                                               ; preds = %72
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  %83 = load i32, ptr %2, align 4, !tbaa !5
  %84 = call ptr @FRESULT_str(i32 noundef %83)
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, ptr noundef %84, i32 noundef %85)
  br label %87

87:                                               ; preds = %81, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %5, align 4, !tbaa !5
  br label %68, !llvm.loop !11

91:                                               ; preds = %71
  %92 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, i32 noundef 10, i32 noundef 10)
  %93 = load ptr, ptr @stdout, align 8, !tbaa !9
  %94 = call i32 @fflush(ptr noundef %93)
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  %96 = call i32 @f_lseek(ptr noundef %4, i64 noundef 0)
  store i32 %96, ptr %2, align 4, !tbaa !5
  %97 = load i32, ptr %2, align 4, !tbaa !5
  %98 = icmp ne i32 0, %97
  %99 = zext i1 %98 to i64
  %100 = select i1 %98, ptr @.str.5, ptr @.str.6
  %101 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %100)
  %102 = load i32, ptr %2, align 4, !tbaa !5
  %103 = icmp ne i32 0, %102
  br i1 %103, label %104, label %109

104:                                              ; preds = %91
  %105 = load i32, ptr %2, align 4, !tbaa !5
  %106 = call ptr @FRESULT_str(i32 noundef %105)
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, ptr noundef %106, i32 noundef %107)
  br label %109

109:                                              ; preds = %104, %91
  %110 = load ptr, ptr @stdout, align 8, !tbaa !9
  %111 = call i32 @fflush(ptr noundef %110)
  br label %112

112:                                              ; preds = %109, %45
  br label %113

113:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %157, %113
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = icmp slt i32 %115, 10
  br i1 %116, label %118, label %117

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

118:                                              ; preds = %114
  %119 = load i32, ptr %7, align 4, !tbaa !5
  %120 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, i32 noundef %119, i32 noundef 10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %121 = getelementptr inbounds %struct.FIL, ptr %4, i32 0, i32 3
  %122 = load i64, ptr %121, align 8, !tbaa !13
  store i64 %122, ptr %8, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 10, ptr %9) #5
  %123 = getelementptr inbounds [10 x i8], ptr %9, i64 0, i64 0
  %124 = call ptr @f_gets(ptr noundef %123, i32 noundef 10, ptr noundef %4)
  %125 = icmp ne ptr %124, null
  br i1 %125, label %128, label %126

126:                                              ; preds = %118
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  br label %128

128:                                              ; preds = %126, %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %129 = getelementptr inbounds [10 x i8], ptr %9, i64 0, i64 0
  %130 = call i64 @strtol(ptr noundef %129, ptr noundef %10, i32 noundef 10) #5
  %131 = trunc i64 %130 to i32
  store i32 %131, ptr %11, align 4, !tbaa !5
  %132 = load ptr, ptr %10, align 8, !tbaa !9
  %133 = getelementptr inbounds [10 x i8], ptr %9, i64 0, i64 0
  %134 = icmp eq ptr %132, %133
  br i1 %134, label %145, label %135

135:                                              ; preds = %128
  %136 = load ptr, ptr %10, align 8, !tbaa !9
  %137 = load i8, ptr %136, align 1, !tbaa !19
  %138 = sext i8 %137 to i32
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %146

140:                                              ; preds = %135
  %141 = load ptr, ptr %10, align 8, !tbaa !9
  %142 = load i8, ptr %141, align 1, !tbaa !19
  %143 = sext i8 %142 to i32
  %144 = icmp ne i32 %143, 10
  br i1 %144, label %145, label %146

145:                                              ; preds = %140, %128
  store i32 7, ptr %3, align 4
  br label %154

146:                                              ; preds = %140, %135
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %11, align 4, !tbaa !5
  %149 = load i64, ptr %8, align 8, !tbaa !18
  %150 = call i32 @f_lseek(ptr noundef %4, i64 noundef %149)
  %151 = load i32, ptr %11, align 4, !tbaa !5
  %152 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef %4, ptr noundef @.str.10, i32 noundef %151)
  %153 = call i32 @f_sync(ptr noundef %4)
  store i32 0, ptr %3, align 4
  br label %154

154:                                              ; preds = %146, %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 10, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %155 = load i32, ptr %3, align 4
  switch i32 %155, label %258 [
    i32 0, label %156
    i32 7, label %157
  ]

156:                                              ; preds = %154
  br label %157

157:                                              ; preds = %156, %154
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %7, align 4, !tbaa !5
  br label %114, !llvm.loop !20

160:                                              ; preds = %117
  %161 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, i32 noundef 10, i32 noundef 10)
  %162 = load ptr, ptr @stdout, align 8, !tbaa !9
  %163 = call i32 @fflush(ptr noundef %162)
  %164 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  %165 = call i32 @f_close(ptr noundef %4)
  store i32 %165, ptr %2, align 4, !tbaa !5
  %166 = load i32, ptr %2, align 4, !tbaa !5
  %167 = icmp ne i32 0, %166
  %168 = zext i1 %167 to i64
  %169 = select i1 %167, ptr @.str.5, ptr @.str.6
  %170 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %169)
  %171 = load i32, ptr %2, align 4, !tbaa !5
  %172 = icmp ne i32 0, %171
  br i1 %172, label %173, label %178

173:                                              ; preds = %160
  %174 = load i32, ptr %2, align 4, !tbaa !5
  %175 = call ptr @FRESULT_str(i32 noundef %174)
  %176 = load i32, ptr %2, align 4, !tbaa !5
  %177 = call i32 (ptr, ...) @printf(ptr noundef @.str.20, ptr noundef %175, i32 noundef %176)
  br label %178

178:                                              ; preds = %173, %160
  %179 = load ptr, ptr @stdout, align 8, !tbaa !9
  %180 = call i32 @fflush(ptr noundef %179)
  call void @ls(ptr noundef @.str.21)
  %181 = call i32 @f_chdir(ptr noundef @.str.22)
  store i32 %181, ptr %2, align 4, !tbaa !5
  %182 = load i32, ptr %2, align 4, !tbaa !5
  %183 = icmp ne i32 0, %182
  br i1 %183, label %184, label %189

184:                                              ; preds = %178
  %185 = load i32, ptr %2, align 4, !tbaa !5
  %186 = call ptr @FRESULT_str(i32 noundef %185)
  %187 = load i32, ptr %2, align 4, !tbaa !5
  %188 = call i32 (ptr, ...) @printf(ptr noundef @.str.23, ptr noundef %186, i32 noundef %187)
  br label %189

189:                                              ; preds = %184, %178
  call void @ls(ptr noundef @.str.21)
  call void @llvm.lifetime.start.p0(i64 255, ptr %12) #5
  call void @llvm.memset.p0.i64(ptr align 16 %12, i8 0, i64 255, i1 false)
  %190 = getelementptr inbounds [255 x i8], ptr %12, i64 0, i64 0
  %191 = getelementptr inbounds [243 x i8], ptr %1, i64 0, i64 0
  %192 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %190, i64 noundef 255, ptr noundef @.str.24, ptr noundef %191, ptr noundef @.str.3) #5
  %193 = getelementptr inbounds [255 x i8], ptr %12, i64 0, i64 0
  %194 = call i32 (ptr, ...) @printf(ptr noundef @.str.25, ptr noundef %193)
  %195 = getelementptr inbounds [255 x i8], ptr %12, i64 0, i64 0
  %196 = call i32 @f_open(ptr noundef %4, ptr noundef %195, i8 noundef zeroext 1)
  store i32 %196, ptr %2, align 4, !tbaa !5
  %197 = load i32, ptr %2, align 4, !tbaa !5
  %198 = icmp ne i32 0, %197
  %199 = zext i1 %198 to i64
  %200 = select i1 %198, ptr @.str.5, ptr @.str.6
  %201 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %200)
  %202 = load i32, ptr %2, align 4, !tbaa !5
  %203 = icmp ne i32 0, %202
  br i1 %203, label %204, label %209

204:                                              ; preds = %189
  %205 = load i32, ptr %2, align 4, !tbaa !5
  %206 = call ptr @FRESULT_str(i32 noundef %205)
  %207 = load i32, ptr %2, align 4, !tbaa !5
  %208 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef %206, i32 noundef %207)
  br label %209

209:                                              ; preds = %204, %189
  %210 = load ptr, ptr @stdout, align 8, !tbaa !9
  %211 = call i32 @fflush(ptr noundef %210)
  %212 = call i32 (ptr, ...) @printf(ptr noundef @.str.26)
  br label %213

213:                                              ; preds = %234, %209
  %214 = getelementptr inbounds %struct.FIL, ptr %4, i32 0, i32 3
  %215 = load i64, ptr %214, align 8, !tbaa !13
  %216 = getelementptr inbounds %struct.FIL, ptr %4, i32 0, i32 0
  %217 = getelementptr inbounds %struct.FFOBJID, ptr %216, i32 0, i32 5
  %218 = load i64, ptr %217, align 8, !tbaa !21
  %219 = icmp eq i64 %215, %218
  %220 = xor i1 %219, true
  br i1 %220, label %221, label %235

221:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %222 = call i32 @f_read(ptr noundef %4, ptr noundef %13, i32 noundef 1, ptr noundef %14)
  store i32 %222, ptr %2, align 4, !tbaa !5
  %223 = load i32, ptr %2, align 4, !tbaa !5
  %224 = icmp ne i32 0, %223
  br i1 %224, label %225, label %230

225:                                              ; preds = %221
  %226 = load i32, ptr %2, align 4, !tbaa !5
  %227 = call ptr @FRESULT_str(i32 noundef %226)
  %228 = load i32, ptr %2, align 4, !tbaa !5
  %229 = call i32 (ptr, ...) @printf(ptr noundef @.str.27, ptr noundef %227, i32 noundef %228)
  br label %234

230:                                              ; preds = %221
  %231 = load i8, ptr %13, align 1, !tbaa !19
  %232 = sext i8 %231 to i32
  %233 = call i32 (ptr, ...) @printf(ptr noundef @.str.28, i32 noundef %232)
  br label %234

234:                                              ; preds = %230, %225
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  br label %213, !llvm.loop !22

235:                                              ; preds = %213
  %236 = getelementptr inbounds [255 x i8], ptr %12, i64 0, i64 0
  %237 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, ptr noundef %236)
  %238 = call i32 @f_close(ptr noundef %4)
  store i32 %238, ptr %2, align 4, !tbaa !5
  %239 = load i32, ptr %2, align 4, !tbaa !5
  %240 = icmp ne i32 0, %239
  %241 = zext i1 %240 to i64
  %242 = select i1 %240, ptr @.str.5, ptr @.str.6
  %243 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %242)
  %244 = load i32, ptr %2, align 4, !tbaa !5
  %245 = icmp ne i32 0, %244
  br i1 %245, label %246, label %251

246:                                              ; preds = %235
  %247 = load i32, ptr %2, align 4, !tbaa !5
  %248 = call ptr @FRESULT_str(i32 noundef %247)
  %249 = load i32, ptr %2, align 4, !tbaa !5
  %250 = call i32 (ptr, ...) @printf(ptr noundef @.str.20, ptr noundef %248, i32 noundef %249)
  br label %251

251:                                              ; preds = %246, %235
  %252 = load ptr, ptr @stdout, align 8, !tbaa !9
  %253 = call i32 @fflush(ptr noundef %252)
  call void @llvm.lifetime.end.p0(i64 255, ptr %12) #5
  store i32 0, ptr %3, align 4
  br label %254

254:                                              ; preds = %251, %40
  call void @llvm.lifetime.end.p0(i64 616, ptr %4) #5
  br label %255

255:                                              ; preds = %254, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 243, ptr %1) #5
  %256 = load i32, ptr %3, align 4
  switch i32 %256, label %258 [
    i32 0, label %257
    i32 1, label %257
  ]

257:                                              ; preds = %255, %255
  ret void

258:                                              ; preds = %255, %154
  unreachable
}

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

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

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

declare i32 @f_getcwd(ptr noundef, i32 noundef) #1

declare ptr @FRESULT_str(i32 noundef) #1

declare i32 @f_open(ptr noundef, ptr noundef, i8 noundef zeroext) #1

declare i32 @fflush(ptr noundef) #1

declare i32 @f_printf(ptr noundef, ptr noundef, ...) #1

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

declare i32 @f_lseek(ptr noundef, i64 noundef) #1

declare ptr @f_gets(ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nounwind
declare i64 @strtol(ptr noundef, ptr noundef, i32 noundef) #4

declare i32 @f_sync(ptr noundef) #1

declare i32 @f_close(ptr noundef) #1

declare void @ls(ptr noundef) #1

declare i32 @f_chdir(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #4

declare i32 @f_read(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !17, i64 56}
!14 = !{!"", !15, i64 0, !7, i64 48, !7, i64 49, !17, i64 56, !6, i64 64, !17, i64 72, !17, i64 80, !10, i64 88, !10, i64 96, !7, i64 104}
!15 = !{!"", !10, i64 0, !16, i64 8, !7, i64 10, !7, i64 11, !6, i64 12, !17, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44}
!16 = !{!"short", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!17, !17, i64 0}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !12}
!21 = !{!14, !17, i64 16}
!22 = distinct !{!22, !12}


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

%struct.FIL = type { %struct.FFOBJID, i8, i8, i64, i32, i64, i64, ptr, ptr, [512 x i8] }
%struct.FFOBJID = type { ptr, i16, i8, i8, i32, i64, i32, i32, i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @simple() local_unnamed_addr #0 {
  %1 = alloca [243 x i8], align 16
  %2 = alloca %struct.FIL, align 8
  %3 = alloca [10 x i8], align 1
  %4 = alloca ptr, align 8
  %5 = alloca [255 x i8], align 16
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  call void @llvm.lifetime.start.p0(i64 243, ptr nonnull %1) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(243) %1, i8 0, i64 243, i1 false)
  %9 = call i32 @f_getcwd(ptr noundef nonnull %1, i32 noundef 243) #6
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %13, label %10

10:                                               ; preds = %0
  %11 = call ptr @FRESULT_str(i32 noundef %9) #6
  %12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %11, i32 noundef %9)
  br label %227

13:                                               ; preds = %0
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  call void @llvm.lifetime.start.p0(i64 616, ptr nonnull %2) #6
  %15 = call i32 @f_open(ptr noundef nonnull %2, ptr noundef nonnull @.str.3, i8 noundef zeroext 3) #6
  %.not72 = icmp eq i32 %15, 0
  %16 = select i1 %.not72, ptr @.str.6, ptr @.str.5
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %16)
  %18 = load ptr, ptr @stdout, align 8, !tbaa !5
  %19 = call i32 @fflush(ptr noundef %18)
  switch i32 %15, label %20 [
    i32 4, label %23
    i32 0, label %149
  ]

20:                                               ; preds = %13
  %21 = call ptr @FRESULT_str(i32 noundef %15) #6
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef %21, i32 noundef %15)
  br label %226

23:                                               ; preds = %13
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %25 = load ptr, ptr @stdout, align 8, !tbaa !5
  %26 = call i32 @fflush(ptr noundef %25)
  %27 = call i32 @f_open(ptr noundef nonnull %2, ptr noundef nonnull @.str.3, i8 noundef zeroext 11) #6
  %.not61 = icmp eq i32 %27, 0
  %28 = select i1 %.not61, ptr @.str.6, ptr @.str.5
  %29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %28)
  br i1 %.not61, label %33, label %30

30:                                               ; preds = %23
  %31 = call ptr @FRESULT_str(i32 noundef %27) #6
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef %31, i32 noundef %27)
  br label %33

33:                                               ; preds = %30, %23
  %34 = load ptr, ptr @stdout, align 8, !tbaa !5
  %35 = call i32 @fflush(ptr noundef %34)
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef 0, i32 noundef 10)
  %37 = load ptr, ptr @stdout, align 8, !tbaa !5
  %38 = call i32 @fflush(ptr noundef %37)
  %39 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 0) #6
  %40 = icmp slt i32 %39, 0
  br i1 %40, label %41, label %45

41:                                               ; preds = %33
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %43 = call ptr @FRESULT_str(i32 noundef %27) #6
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %43, i32 noundef %27)
  br label %45

45:                                               ; preds = %41, %33
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef 1, i32 noundef 10)
  %47 = load ptr, ptr @stdout, align 8, !tbaa !5
  %48 = call i32 @fflush(ptr noundef %47)
  %49 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 1) #6
  %50 = icmp slt i32 %49, 0
  br i1 %50, label %51, label %55

51:                                               ; preds = %45
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %53 = call ptr @FRESULT_str(i32 noundef %27) #6
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %53, i32 noundef %27)
  br label %55

55:                                               ; preds = %51, %45
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef 2, i32 noundef 10)
  %57 = load ptr, ptr @stdout, align 8, !tbaa !5
  %58 = call i32 @fflush(ptr noundef %57)
  %59 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 2) #6
  %60 = icmp slt i32 %59, 0
  br i1 %60, label %61, label %65

61:                                               ; preds = %55
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %63 = call ptr @FRESULT_str(i32 noundef %27) #6
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %63, i32 noundef %27)
  br label %65

65:                                               ; preds = %61, %55
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef 3, i32 noundef 10)
  %67 = load ptr, ptr @stdout, align 8, !tbaa !5
  %68 = call i32 @fflush(ptr noundef %67)
  %69 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 3) #6
  %70 = icmp slt i32 %69, 0
  br i1 %70, label %71, label %75

71:                                               ; preds = %65
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %73 = call ptr @FRESULT_str(i32 noundef %27) #6
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %73, i32 noundef %27)
  br label %75

75:                                               ; preds = %71, %65
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef 4, i32 noundef 10)
  %77 = load ptr, ptr @stdout, align 8, !tbaa !5
  %78 = call i32 @fflush(ptr noundef %77)
  %79 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 4) #6
  %80 = icmp slt i32 %79, 0
  br i1 %80, label %81, label %85

81:                                               ; preds = %75
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %83 = call ptr @FRESULT_str(i32 noundef %27) #6
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %83, i32 noundef %27)
  br label %85

85:                                               ; preds = %81, %75
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef 5, i32 noundef 10)
  %87 = load ptr, ptr @stdout, align 8, !tbaa !5
  %88 = call i32 @fflush(ptr noundef %87)
  %89 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 5) #6
  %90 = icmp slt i32 %89, 0
  br i1 %90, label %91, label %95

91:                                               ; preds = %85
  %92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %93 = call ptr @FRESULT_str(i32 noundef %27) #6
  %94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %93, i32 noundef %27)
  br label %95

95:                                               ; preds = %91, %85
  %96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef 6, i32 noundef 10)
  %97 = load ptr, ptr @stdout, align 8, !tbaa !5
  %98 = call i32 @fflush(ptr noundef %97)
  %99 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 6) #6
  %100 = icmp slt i32 %99, 0
  br i1 %100, label %101, label %105

101:                                              ; preds = %95
  %102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %103 = call ptr @FRESULT_str(i32 noundef %27) #6
  %104 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %103, i32 noundef %27)
  br label %105

105:                                              ; preds = %101, %95
  %106 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef 7, i32 noundef 10)
  %107 = load ptr, ptr @stdout, align 8, !tbaa !5
  %108 = call i32 @fflush(ptr noundef %107)
  %109 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 7) #6
  %110 = icmp slt i32 %109, 0
  br i1 %110, label %111, label %115

111:                                              ; preds = %105
  %112 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %113 = call ptr @FRESULT_str(i32 noundef %27) #6
  %114 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %113, i32 noundef %27)
  br label %115

115:                                              ; preds = %111, %105
  %116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef 8, i32 noundef 10)
  %117 = load ptr, ptr @stdout, align 8, !tbaa !5
  %118 = call i32 @fflush(ptr noundef %117)
  %119 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 8) #6
  %120 = icmp slt i32 %119, 0
  br i1 %120, label %121, label %125

121:                                              ; preds = %115
  %122 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %123 = call ptr @FRESULT_str(i32 noundef %27) #6
  %124 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %123, i32 noundef %27)
  br label %125

125:                                              ; preds = %121, %115
  %126 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef 9, i32 noundef 10)
  %127 = load ptr, ptr @stdout, align 8, !tbaa !5
  %128 = call i32 @fflush(ptr noundef %127)
  %129 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 9) #6
  %130 = icmp slt i32 %129, 0
  br i1 %130, label %131, label %135

131:                                              ; preds = %125
  %132 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %133 = call ptr @FRESULT_str(i32 noundef %27) #6
  %134 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %133, i32 noundef %27)
  br label %135

135:                                              ; preds = %131, %125
  %136 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, i32 noundef 10, i32 noundef 10)
  %137 = load ptr, ptr @stdout, align 8, !tbaa !5
  %138 = call i32 @fflush(ptr noundef %137)
  %139 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  %140 = call i32 @f_lseek(ptr noundef nonnull %2, i64 noundef 0) #6
  %.not62 = icmp eq i32 %140, 0
  %141 = select i1 %.not62, ptr @.str.6, ptr @.str.5
  %142 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %141)
  br i1 %.not62, label %146, label %143

143:                                              ; preds = %135
  %144 = call ptr @FRESULT_str(i32 noundef %140) #6
  %145 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, ptr noundef %144, i32 noundef %140)
  br label %146

146:                                              ; preds = %143, %135
  %147 = load ptr, ptr @stdout, align 8, !tbaa !5
  %148 = call i32 @fflush(ptr noundef %147)
  br label %149

149:                                              ; preds = %13, %146
  %150 = getelementptr inbounds i8, ptr %2, i64 56
  br label %159

151:                                              ; preds = %177
  %152 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, i32 noundef 10, i32 noundef 10)
  %153 = load ptr, ptr @stdout, align 8, !tbaa !5
  %154 = call i32 @fflush(ptr noundef %153)
  %155 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  %156 = call i32 @f_close(ptr noundef nonnull %2) #6
  %.not63 = icmp eq i32 %156, 0
  %157 = select i1 %.not63, ptr @.str.6, ptr @.str.5
  %158 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %157)
  br i1 %.not63, label %182, label %179

159:                                              ; preds = %149, %177
  %.074 = phi i32 [ 0, %149 ], [ %178, %177 ]
  %160 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, i32 noundef %.074, i32 noundef 10)
  %161 = load i64, ptr %150, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %3) #6
  %162 = call ptr @f_gets(ptr noundef nonnull %3, i32 noundef 10, ptr noundef nonnull %2) #6
  %.not69 = icmp eq ptr %162, null
  br i1 %.not69, label %163, label %165

163:                                              ; preds = %159
  %164 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  br label %165

165:                                              ; preds = %163, %159
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %166 = call i64 @strtol(ptr noundef nonnull %3, ptr noundef nonnull %4, i32 noundef 10) #6
  %167 = trunc i64 %166 to i32
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = icmp eq ptr %168, %3
  br i1 %169, label %177, label %170

170:                                              ; preds = %165
  %171 = load i8, ptr %168, align 1, !tbaa !15
  switch i8 %171, label %177 [
    i8 0, label %172
    i8 10, label %172
  ]

172:                                              ; preds = %170, %170
  %173 = add nsw i32 %167, 1
  %174 = call i32 @f_lseek(ptr noundef nonnull %2, i64 noundef %161) #6
  %175 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef %173) #6
  %176 = call i32 @f_sync(ptr noundef nonnull %2) #6
  br label %177

177:                                              ; preds = %165, %170, %172
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %3) #6
  %178 = add nuw nsw i32 %.074, 1
  %exitcond.not = icmp eq i32 %178, 10
  br i1 %exitcond.not, label %151, label %159, !llvm.loop !16

179:                                              ; preds = %151
  %180 = call ptr @FRESULT_str(i32 noundef %156) #6
  %181 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, ptr noundef %180, i32 noundef %156)
  br label %182

182:                                              ; preds = %179, %151
  %183 = load ptr, ptr @stdout, align 8, !tbaa !5
  %184 = call i32 @fflush(ptr noundef %183)
  call void @ls(ptr noundef nonnull @.str.21) #6
  %185 = call i32 @f_chdir(ptr noundef nonnull @.str.22) #6
  %.not64 = icmp eq i32 %185, 0
  br i1 %.not64, label %189, label %186

186:                                              ; preds = %182
  %187 = call ptr @FRESULT_str(i32 noundef %185) #6
  %188 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, ptr noundef %187, i32 noundef %185)
  br label %189

189:                                              ; preds = %186, %182
  call void @ls(ptr noundef nonnull @.str.21) #6
  call void @llvm.lifetime.start.p0(i64 255, ptr nonnull %5) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(255) %5, i8 0, i64 255, i1 false)
  %190 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %5, i64 noundef 255, ptr noundef nonnull @.str.24, ptr noundef nonnull %1, ptr noundef nonnull @.str.3) #6
  %191 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25, ptr noundef nonnull %5)
  %192 = call i32 @f_open(ptr noundef nonnull %2, ptr noundef nonnull %5, i8 noundef zeroext 1) #6
  %.not65 = icmp eq i32 %192, 0
  %193 = select i1 %.not65, ptr @.str.6, ptr @.str.5
  %194 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %193)
  br i1 %.not65, label %198, label %195

195:                                              ; preds = %189
  %196 = call ptr @FRESULT_str(i32 noundef %192) #6
  %197 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef %196, i32 noundef %192)
  br label %198

198:                                              ; preds = %195, %189
  %199 = load ptr, ptr @stdout, align 8, !tbaa !5
  %200 = call i32 @fflush(ptr noundef %199)
  %201 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26)
  %202 = getelementptr inbounds i8, ptr %2, i64 16
  %203 = load i64, ptr %150, align 8, !tbaa !9
  %204 = load i64, ptr %202, align 8, !tbaa !18
  %.not6675 = icmp eq i64 %203, %204
  br i1 %.not6675, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %198, %213
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %205 = call i32 @f_read(ptr noundef nonnull %2, ptr noundef nonnull %6, i32 noundef 1, ptr noundef nonnull %7) #6
  %.not68 = icmp eq i32 %205, 0
  br i1 %.not68, label %209, label %206

206:                                              ; preds = %.lr.ph
  %207 = call ptr @FRESULT_str(i32 noundef %205) #6
  %208 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27, ptr noundef %207, i32 noundef %205)
  br label %213

209:                                              ; preds = %.lr.ph
  %210 = load i8, ptr %6, align 1, !tbaa !15
  %211 = sext i8 %210 to i32
  %212 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28, i32 noundef %211)
  br label %213

213:                                              ; preds = %209, %206
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  %214 = load i64, ptr %150, align 8, !tbaa !9
  %215 = load i64, ptr %202, align 8, !tbaa !18
  %.not66 = icmp eq i64 %214, %215
  br i1 %.not66, label %._crit_edge, label %.lr.ph, !llvm.loop !19

._crit_edge:                                      ; preds = %213, %198
  %216 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef nonnull %5)
  %217 = call i32 @f_close(ptr noundef nonnull %2) #6
  %.not67 = icmp eq i32 %217, 0
  %218 = select i1 %.not67, ptr @.str.6, ptr @.str.5
  %219 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %218)
  br i1 %.not67, label %223, label %220

220:                                              ; preds = %._crit_edge
  %221 = call ptr @FRESULT_str(i32 noundef %217) #6
  %222 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, ptr noundef %221, i32 noundef %217)
  br label %223

223:                                              ; preds = %220, %._crit_edge
  %224 = load ptr, ptr @stdout, align 8, !tbaa !5
  %225 = call i32 @fflush(ptr noundef %224)
  call void @llvm.lifetime.end.p0(i64 255, ptr nonnull %5) #6
  br label %226

226:                                              ; preds = %223, %20
  call void @llvm.lifetime.end.p0(i64 616, ptr nonnull %2) #6
  br label %227

227:                                              ; preds = %226, %10
  call void @llvm.lifetime.end.p0(i64 243, ptr nonnull %1) #6
  ret void
}

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

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

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

declare i32 @f_getcwd(ptr noundef, i32 noundef) local_unnamed_addr #4

declare ptr @FRESULT_str(i32 noundef) local_unnamed_addr #4

declare i32 @f_open(ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #4

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

declare i32 @f_printf(ptr noundef, ptr noundef, ...) local_unnamed_addr #4

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

declare i32 @f_lseek(ptr noundef, i64 noundef) local_unnamed_addr #4

declare ptr @f_gets(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #5

declare i32 @f_sync(ptr noundef) local_unnamed_addr #4

declare i32 @f_close(ptr noundef) local_unnamed_addr #4

declare void @ls(ptr noundef) local_unnamed_addr #4

declare i32 @f_chdir(ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

declare i32 @f_read(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !14, i64 56}
!10 = !{!"", !11, i64 0, !7, i64 48, !7, i64 49, !14, i64 56, !13, i64 64, !14, i64 72, !14, i64 80, !6, i64 88, !6, i64 96, !7, i64 104}
!11 = !{!"", !6, i64 0, !12, i64 8, !7, i64 10, !7, i64 11, !13, i64 12, !14, i64 16, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44}
!12 = !{!"short", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!10, !14, i64 16}
!19 = distinct !{!19, !17}


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