; LLVM IR from carlk3/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico :: examples/command_line/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
@__func__.simple = external hidden unnamed_addr constant [7 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 [23 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [1 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 [16 x i8], align 16
  %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, ...) @info_message_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, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 36, ptr noundef @.str.1, ptr noundef %22, i32 noundef %23)
  store i32 1, ptr %3, align 4
  br label %266

25:                                               ; preds = %0
  %26 = call i32 (ptr, ...) @info_message_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, ...) @info_message_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, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 46, ptr noundef @.str.7, ptr noundef %42, i32 noundef %43)
  store i32 1, ptr %3, align 4
  br label %265

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 %117

48:                                               ; preds = %45
  %49 = call i32 (ptr, ...) @info_message_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, ...) @info_message_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, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 55, ptr noundef @.str.7, ptr noundef %62, i32 noundef %63)
  store i32 1, ptr %3, align 4
  br label %265

65:                                               ; preds = %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 = %91, %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
  br label %94

72:                                               ; preds = %68
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = call i32 (ptr, ...) @info_message_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, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 68, 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, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 69, ptr noundef @.str.12, ptr noundef %84, i32 noundef %85)
  store i32 1, ptr %3, align 4
  br label %88

87:                                               ; preds = %72
  store i32 0, ptr %3, align 4
  br label %88

88:                                               ; preds = %87, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %89 = load i32, ptr %3, align 4
  switch i32 %89, label %94 [
    i32 0, label %90
  ]

90:                                               ; preds = %88
  br label %91

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

94:                                               ; preds = %88, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %95 = load i32, ptr %3, align 4
  switch i32 %95, label %265 [
    i32 2, label %96
  ]

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

109:                                              ; preds = %96
  %110 = load i32, ptr %2, align 4, !tbaa !5
  %111 = call ptr @FRESULT_str(i32 noundef %110)
  %112 = load i32, ptr %2, align 4, !tbaa !5
  %113 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 80, ptr noundef @.str.15, ptr noundef %111, i32 noundef %112)
  store i32 1, ptr %3, align 4
  br label %265

114:                                              ; preds = %96
  %115 = load ptr, ptr @stdout, align 8, !tbaa !9
  %116 = call i32 @fflush(ptr noundef %115)
  br label %117

117:                                              ; preds = %114, %45
  br label %118

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

119:                                              ; preds = %174, %118
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = icmp slt i32 %120, 10
  br i1 %121, label %123, label %122

122:                                              ; preds = %119
  store i32 5, ptr %3, align 4
  br label %177

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

131:                                              ; preds = %123
  %132 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 95, ptr noundef @.str.17)
  store i32 1, ptr %3, align 4
  br label %171

133:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %134 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 0
  %135 = call i64 @strtol(ptr noundef %134, ptr noundef %10, i32 noundef 10) #5
  %136 = trunc i64 %135 to i32
  store i32 %136, ptr %11, align 4, !tbaa !5
  %137 = load ptr, ptr %10, align 8, !tbaa !9
  %138 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 0
  %139 = icmp eq ptr %137, %138
  br i1 %139, label %140, label %142

140:                                              ; preds = %133
  %141 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 101, ptr noundef @.str.18)
  store i32 7, ptr %3, align 4
  br label %170

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

147:                                              ; preds = %142
  %148 = load ptr, ptr %10, align 8, !tbaa !9
  %149 = load i8, ptr %148, align 1, !tbaa !19
  %150 = sext i8 %149 to i32
  %151 = icmp ne i32 %150, 10
  br i1 %151, label %152, label %154

152:                                              ; preds = %147
  %153 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 105, ptr noundef @.str.19)
  store i32 7, ptr %3, align 4
  br label %170

154:                                              ; preds = %147, %142
  %155 = load i32, ptr %11, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %11, align 4, !tbaa !5
  %157 = load i64, ptr %8, align 8, !tbaa !18
  %158 = call i32 @f_lseek(ptr noundef %4, i64 noundef %157)
  store i32 %158, ptr %2, align 4, !tbaa !5
  %159 = load i32, ptr %2, align 4, !tbaa !5
  %160 = icmp ne i32 0, %159
  br i1 %160, label %161, label %166

161:                                              ; preds = %154
  %162 = load i32, ptr %2, align 4, !tbaa !5
  %163 = call ptr @FRESULT_str(i32 noundef %162)
  %164 = load i32, ptr %2, align 4, !tbaa !5
  %165 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 113, ptr noundef @.str.15, ptr noundef %163, i32 noundef %164)
  store i32 1, ptr %3, align 4
  br label %170

166:                                              ; preds = %154
  %167 = load i32, ptr %11, align 4, !tbaa !5
  %168 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef %4, ptr noundef @.str.10, i32 noundef %167)
  %169 = call i32 @f_sync(ptr noundef %4)
  store i32 0, ptr %3, align 4
  br label %170

170:                                              ; preds = %166, %161, %152, %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %171

171:                                              ; preds = %170, %131
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %172 = load i32, ptr %3, align 4
  switch i32 %172, label %177 [
    i32 0, label %173
    i32 7, label %174
  ]

173:                                              ; preds = %171
  br label %174

174:                                              ; preds = %173, %171
  %175 = load i32, ptr %7, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %7, align 4, !tbaa !5
  br label %119, !llvm.loop !20

177:                                              ; preds = %171, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %178 = load i32, ptr %3, align 4
  switch i32 %178, label %265 [
    i32 5, label %179
  ]

179:                                              ; preds = %177
  %180 = call i32 (ptr, ...) @info_message_printf(ptr noundef @.str.20, i32 noundef 10, i32 noundef 10)
  %181 = load ptr, ptr @stdout, align 8, !tbaa !9
  %182 = call i32 @fflush(ptr noundef %181)
  %183 = call i32 (ptr, ...) @info_message_printf(ptr noundef @.str.21)
  %184 = call i32 @f_close(ptr noundef %4)
  store i32 %184, ptr %2, align 4, !tbaa !5
  %185 = load i32, ptr %2, align 4, !tbaa !5
  %186 = icmp ne i32 0, %185
  %187 = zext i1 %186 to i64
  %188 = select i1 %186, ptr @.str.5, ptr @.str.6
  %189 = call i32 (ptr, ...) @info_message_printf(ptr noundef @.str.4, ptr noundef %188)
  %190 = load i32, ptr %2, align 4, !tbaa !5
  %191 = icmp ne i32 0, %190
  br i1 %191, label %192, label %197

192:                                              ; preds = %179
  %193 = load i32, ptr %2, align 4, !tbaa !5
  %194 = call ptr @FRESULT_str(i32 noundef %193)
  %195 = load i32, ptr %2, align 4, !tbaa !5
  %196 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 130, ptr noundef @.str.22, ptr noundef %194, i32 noundef %195)
  store i32 1, ptr %3, align 4
  br label %265

197:                                              ; preds = %179
  %198 = load ptr, ptr @stdout, align 8, !tbaa !9
  %199 = call i32 @fflush(ptr noundef %198)
  call void @ls(ptr noundef @.str.23)
  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)
  %200 = getelementptr inbounds [255 x i8], ptr %12, i64 0, i64 0
  %201 = getelementptr inbounds [243 x i8], ptr %1, i64 0, i64 0
  %202 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %200, i64 noundef 255, ptr noundef @.str.24, ptr noundef %201, ptr noundef @.str.3) #5
  %203 = getelementptr inbounds [255 x i8], ptr %12, i64 0, i64 0
  %204 = call i32 (ptr, ...) @info_message_printf(ptr noundef @.str.25, ptr noundef %203)
  %205 = getelementptr inbounds [255 x i8], ptr %12, i64 0, i64 0
  %206 = call i32 @f_open(ptr noundef %4, ptr noundef %205, i8 noundef zeroext 1)
  store i32 %206, ptr %2, align 4, !tbaa !5
  %207 = load i32, ptr %2, align 4, !tbaa !5
  %208 = icmp ne i32 0, %207
  %209 = zext i1 %208 to i64
  %210 = select i1 %208, ptr @.str.5, ptr @.str.6
  %211 = call i32 (ptr, ...) @info_message_printf(ptr noundef @.str.4, ptr noundef %210)
  %212 = load i32, ptr %2, align 4, !tbaa !5
  %213 = icmp ne i32 0, %212
  br i1 %213, label %214, label %219

214:                                              ; preds = %197
  %215 = load i32, ptr %2, align 4, !tbaa !5
  %216 = call ptr @FRESULT_str(i32 noundef %215)
  %217 = load i32, ptr %2, align 4, !tbaa !5
  %218 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 144, ptr noundef @.str.7, ptr noundef %216, i32 noundef %217)
  store i32 1, ptr %3, align 4
  br label %264

219:                                              ; preds = %197
  %220 = load ptr, ptr @stdout, align 8, !tbaa !9
  %221 = call i32 @fflush(ptr noundef %220)
  %222 = call i32 (ptr, ...) @info_message_printf(ptr noundef @.str.26)
  br label %223

223:                                              ; preds = %244, %219
  %224 = getelementptr inbounds %struct.FIL, ptr %4, i32 0, i32 3
  %225 = load i64, ptr %224, align 8, !tbaa !13
  %226 = getelementptr inbounds %struct.FIL, ptr %4, i32 0, i32 0
  %227 = getelementptr inbounds %struct.FFOBJID, ptr %226, i32 0, i32 5
  %228 = load i64, ptr %227, align 8, !tbaa !21
  %229 = icmp eq i64 %225, %228
  %230 = xor i1 %229, true
  br i1 %230, label %231, label %245

231:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %232 = call i32 @f_read(ptr noundef %4, ptr noundef %13, i32 noundef 1, ptr noundef %14)
  store i32 %232, ptr %2, align 4, !tbaa !5
  %233 = load i32, ptr %2, align 4, !tbaa !5
  %234 = icmp ne i32 0, %233
  br i1 %234, label %235, label %240

235:                                              ; preds = %231
  %236 = load i32, ptr %2, align 4, !tbaa !5
  %237 = call ptr @FRESULT_str(i32 noundef %236)
  %238 = load i32, ptr %2, align 4, !tbaa !5
  %239 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 155, ptr noundef @.str.27, ptr noundef %237, i32 noundef %238)
  br label %244

240:                                              ; preds = %231
  %241 = load i8, ptr %13, align 1, !tbaa !19
  %242 = sext i8 %241 to i32
  %243 = call i32 (ptr, ...) @info_message_printf(ptr noundef @.str.28, i32 noundef %242)
  br label %244

244:                                              ; preds = %240, %235
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  br label %223, !llvm.loop !22

245:                                              ; preds = %223
  %246 = getelementptr inbounds [255 x i8], ptr %12, i64 0, i64 0
  %247 = call i32 (ptr, ...) @info_message_printf(ptr noundef @.str.29, ptr noundef %246)
  %248 = call i32 @f_close(ptr noundef %4)
  store i32 %248, ptr %2, align 4, !tbaa !5
  %249 = load i32, ptr %2, align 4, !tbaa !5
  %250 = icmp ne i32 0, %249
  %251 = zext i1 %250 to i64
  %252 = select i1 %250, ptr @.str.5, ptr @.str.6
  %253 = call i32 (ptr, ...) @info_message_printf(ptr noundef @.str.4, ptr noundef %252)
  %254 = load i32, ptr %2, align 4, !tbaa !5
  %255 = icmp ne i32 0, %254
  br i1 %255, label %256, label %261

256:                                              ; preds = %245
  %257 = load i32, ptr %2, align 4, !tbaa !5
  %258 = call ptr @FRESULT_str(i32 noundef %257)
  %259 = load i32, ptr %2, align 4, !tbaa !5
  %260 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef @__func__.simple, i32 noundef 163, ptr noundef @.str.22, ptr noundef %258, i32 noundef %259)
  br label %261

261:                                              ; preds = %256, %245
  %262 = load ptr, ptr @stdout, align 8, !tbaa !9
  %263 = call i32 @fflush(ptr noundef %262)
  store i32 0, ptr %3, align 4
  br label %264

264:                                              ; preds = %261, %214
  call void @llvm.lifetime.end.p0(i64 255, ptr %12) #5
  br label %265

265:                                              ; preds = %264, %192, %177, %109, %94, %60, %40
  call void @llvm.lifetime.end.p0(i64 616, ptr %4) #5
  br label %266

266:                                              ; preds = %265, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 243, ptr %1) #5
  %267 = load i32, ptr %3, align 4
  switch i32 %267, label %269 [
    i32 0, label %268
    i32 1, label %268
  ]

268:                                              ; preds = %266, %266
  ret void

269:                                              ; preds = %266
  unreachable
}

declare i32 @info_message_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 i32 @error_message_printf(ptr noundef, i32 noundef, ptr 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

; 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
@__func__.simple = external hidden unnamed_addr constant [7 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 [23 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [1 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 [16 x i8], align 16
  %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, ...) @info_message_printf(ptr noundef nonnull @.str) #6
  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, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 36, ptr noundef nonnull @.str.1, ptr noundef %11, i32 noundef %9) #6
  br label %182

13:                                               ; preds = %0
  %14 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.2) #6
  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
  %.not87 = icmp eq i32 %15, 0
  %16 = select i1 %.not87, ptr @.str.6, ptr @.str.5
  %17 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.4, ptr noundef nonnull %16) #6
  %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 %102
  ]

20:                                               ; preds = %13
  %21 = call ptr @FRESULT_str(i32 noundef %15) #6
  %22 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 46, ptr noundef nonnull @.str.7, ptr noundef %21, i32 noundef %15) #6
  br label %181

23:                                               ; preds = %13
  %24 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.8) #6
  %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
  %.not69 = icmp eq i32 %27, 0
  %28 = select i1 %.not69, ptr @.str.6, ptr @.str.5
  %29 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.4, ptr noundef nonnull %28) #6
  br i1 %.not69, label %.critedge, label %30

30:                                               ; preds = %23
  %31 = call ptr @FRESULT_str(i32 noundef %27) #6
  %32 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 55, ptr noundef nonnull @.str.7, ptr noundef %31, i32 noundef %27) #6
  br label %181

.critedge:                                        ; preds = %23
  %33 = load ptr, ptr @stdout, align 8, !tbaa !5
  %34 = call i32 @fflush(ptr noundef %33)
  %35 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.9, i32 noundef 0, i32 noundef 10) #6
  %36 = load ptr, ptr @stdout, align 8, !tbaa !5
  %37 = call i32 @fflush(ptr noundef %36)
  %38 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 0) #6
  %39 = icmp sgt i32 %38, -1
  br i1 %39, label %.critedge.1, label %92

.critedge.1:                                      ; preds = %.critedge
  %40 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.9, i32 noundef 1, i32 noundef 10) #6
  %41 = load ptr, ptr @stdout, align 8, !tbaa !5
  %42 = call i32 @fflush(ptr noundef %41)
  %43 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 1) #6
  %44 = icmp sgt i32 %43, -1
  br i1 %44, label %.critedge.2, label %92

.critedge.2:                                      ; preds = %.critedge.1
  %45 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.9, i32 noundef 2, i32 noundef 10) #6
  %46 = load ptr, ptr @stdout, align 8, !tbaa !5
  %47 = call i32 @fflush(ptr noundef %46)
  %48 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 2) #6
  %49 = icmp sgt i32 %48, -1
  br i1 %49, label %.critedge.3, label %92

.critedge.3:                                      ; preds = %.critedge.2
  %50 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.9, i32 noundef 3, i32 noundef 10) #6
  %51 = load ptr, ptr @stdout, align 8, !tbaa !5
  %52 = call i32 @fflush(ptr noundef %51)
  %53 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 3) #6
  %54 = icmp sgt i32 %53, -1
  br i1 %54, label %.critedge.4, label %92

.critedge.4:                                      ; preds = %.critedge.3
  %55 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.9, i32 noundef 4, i32 noundef 10) #6
  %56 = load ptr, ptr @stdout, align 8, !tbaa !5
  %57 = call i32 @fflush(ptr noundef %56)
  %58 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 4) #6
  %59 = icmp sgt i32 %58, -1
  br i1 %59, label %.critedge.5, label %92

.critedge.5:                                      ; preds = %.critedge.4
  %60 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.9, i32 noundef 5, i32 noundef 10) #6
  %61 = load ptr, ptr @stdout, align 8, !tbaa !5
  %62 = call i32 @fflush(ptr noundef %61)
  %63 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 5) #6
  %64 = icmp sgt i32 %63, -1
  br i1 %64, label %.critedge.6, label %92

.critedge.6:                                      ; preds = %.critedge.5
  %65 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.9, i32 noundef 6, i32 noundef 10) #6
  %66 = load ptr, ptr @stdout, align 8, !tbaa !5
  %67 = call i32 @fflush(ptr noundef %66)
  %68 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 6) #6
  %69 = icmp sgt i32 %68, -1
  br i1 %69, label %.critedge.7, label %92

.critedge.7:                                      ; preds = %.critedge.6
  %70 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.9, i32 noundef 7, i32 noundef 10) #6
  %71 = load ptr, ptr @stdout, align 8, !tbaa !5
  %72 = call i32 @fflush(ptr noundef %71)
  %73 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 7) #6
  %74 = icmp sgt i32 %73, -1
  br i1 %74, label %.critedge.8, label %92

.critedge.8:                                      ; preds = %.critedge.7
  %75 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.9, i32 noundef 8, i32 noundef 10) #6
  %76 = load ptr, ptr @stdout, align 8, !tbaa !5
  %77 = call i32 @fflush(ptr noundef %76)
  %78 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 8) #6
  %79 = icmp sgt i32 %78, -1
  br i1 %79, label %.critedge.9, label %92

.critedge.9:                                      ; preds = %.critedge.8
  %80 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.9, i32 noundef 9, i32 noundef 10) #6
  %81 = load ptr, ptr @stdout, align 8, !tbaa !5
  %82 = call i32 @fflush(ptr noundef %81)
  %83 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef 9) #6
  %84 = icmp sgt i32 %83, -1
  br i1 %84, label %.critedge81, label %92

.critedge81:                                      ; preds = %.critedge.9
  %85 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.13, i32 noundef 10, i32 noundef 10) #6
  %86 = load ptr, ptr @stdout, align 8, !tbaa !5
  %87 = call i32 @fflush(ptr noundef %86)
  %88 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.14) #6
  %89 = call i32 @f_lseek(ptr noundef nonnull %2, i64 noundef 0) #6
  %.not70 = icmp eq i32 %89, 0
  %90 = select i1 %.not70, ptr @.str.6, ptr @.str.5
  %91 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.4, ptr noundef nonnull %90) #6
  br i1 %.not70, label %99, label %96

92:                                               ; preds = %.critedge.9, %.critedge.8, %.critedge.7, %.critedge.6, %.critedge.5, %.critedge.4, %.critedge.3, %.critedge.2, %.critedge.1, %.critedge
  %93 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 68, ptr noundef nonnull @.str.11) #6
  %94 = call ptr @FRESULT_str(i32 noundef 0) #6
  %95 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 69, ptr noundef nonnull @.str.12, ptr noundef %94, i32 noundef 0) #6
  br label %181

96:                                               ; preds = %.critedge81
  %97 = call ptr @FRESULT_str(i32 noundef %89) #6
  %98 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 80, ptr noundef nonnull @.str.15, ptr noundef %97, i32 noundef %89) #6
  br label %181

99:                                               ; preds = %.critedge81
  %100 = load ptr, ptr @stdout, align 8, !tbaa !5
  %101 = call i32 @fflush(ptr noundef %100)
  br label %102

102:                                              ; preds = %13, %99
  %103 = getelementptr inbounds i8, ptr %2, i64 56
  br label %104

104:                                              ; preds = %102, %129
  %.089 = phi i32 [ 0, %102 ], [ %130, %129 ]
  %105 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.16, i32 noundef %.089, i32 noundef 10) #6
  %106 = load i64, ptr %103, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  %107 = call ptr @f_gets(ptr noundef nonnull %3, i32 noundef 16, ptr noundef nonnull %2) #6
  %.not71 = icmp eq ptr %107, null
  br i1 %.not71, label %.thread, label %109

.thread:                                          ; preds = %104
  %108 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 95, ptr noundef nonnull @.str.17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  br label %181

109:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %110 = call i64 @strtol(ptr noundef nonnull %3, ptr noundef nonnull %4, i32 noundef 10) #6
  %111 = trunc i64 %110 to i32
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = icmp eq ptr %112, %3
  br i1 %113, label %114, label %116

114:                                              ; preds = %109
  %115 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 101, ptr noundef nonnull @.str.18) #6
  br label %129

116:                                              ; preds = %109
  %117 = load i8, ptr %112, align 1, !tbaa !15
  switch i8 %117, label %118 [
    i8 0, label %120
    i8 10, label %120
  ]

118:                                              ; preds = %116
  %119 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 105, ptr noundef nonnull @.str.19) #6
  br label %129

120:                                              ; preds = %116, %116
  %121 = call i32 @f_lseek(ptr noundef nonnull %2, i64 noundef %106) #6
  %.not74 = icmp eq i32 %121, 0
  br i1 %.not74, label %122, label %126

122:                                              ; preds = %120
  %123 = add nsw i32 %111, 1
  %124 = call i32 (ptr, ptr, ...) @f_printf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, i32 noundef %123) #6
  %125 = call i32 @f_sync(ptr noundef nonnull %2) #6
  br label %129

126:                                              ; preds = %120
  %127 = call ptr @FRESULT_str(i32 noundef %121) #6
  %128 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 113, ptr noundef nonnull @.str.15, ptr noundef %127, i32 noundef %121) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  br label %181

129:                                              ; preds = %114, %118, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  %130 = add nuw nsw i32 %.089, 1
  %exitcond = icmp eq i32 %130, 10
  br i1 %exitcond, label %.critedge83, label %104, !llvm.loop !16

.critedge83:                                      ; preds = %129
  %131 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.20, i32 noundef 10, i32 noundef 10) #6
  %132 = load ptr, ptr @stdout, align 8, !tbaa !5
  %133 = call i32 @fflush(ptr noundef %132)
  %134 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.21) #6
  %135 = call i32 @f_close(ptr noundef nonnull %2) #6
  %.not75 = icmp eq i32 %135, 0
  %136 = select i1 %.not75, ptr @.str.6, ptr @.str.5
  %137 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.4, ptr noundef nonnull %136) #6
  br i1 %.not75, label %141, label %138

138:                                              ; preds = %.critedge83
  %139 = call ptr @FRESULT_str(i32 noundef %135) #6
  %140 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 130, ptr noundef nonnull @.str.22, ptr noundef %139, i32 noundef %135) #6
  br label %181

141:                                              ; preds = %.critedge83
  %142 = load ptr, ptr @stdout, align 8, !tbaa !5
  %143 = call i32 @fflush(ptr noundef %142)
  call void @ls(ptr noundef nonnull @.str.23) #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)
  %144 = 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
  %145 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.25, ptr noundef nonnull %5) #6
  %146 = call i32 @f_open(ptr noundef nonnull %2, ptr noundef nonnull %5, i8 noundef zeroext 1) #6
  %.not76 = icmp eq i32 %146, 0
  %147 = select i1 %.not76, ptr @.str.6, ptr @.str.5
  %148 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.4, ptr noundef nonnull %147) #6
  br i1 %.not76, label %152, label %149

149:                                              ; preds = %141
  %150 = call ptr @FRESULT_str(i32 noundef %146) #6
  %151 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 144, ptr noundef nonnull @.str.7, ptr noundef %150, i32 noundef %146) #6
  br label %180

152:                                              ; preds = %141
  %153 = load ptr, ptr @stdout, align 8, !tbaa !5
  %154 = call i32 @fflush(ptr noundef %153)
  %155 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.26) #6
  %156 = getelementptr inbounds i8, ptr %2, i64 16
  %157 = load i64, ptr %103, align 8, !tbaa !9
  %158 = load i64, ptr %156, align 8, !tbaa !18
  %.not7790 = icmp eq i64 %157, %158
  br i1 %.not7790, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %152, %167
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %159 = call i32 @f_read(ptr noundef nonnull %2, ptr noundef nonnull %6, i32 noundef 1, ptr noundef nonnull %7) #6
  %.not79 = icmp eq i32 %159, 0
  br i1 %.not79, label %163, label %160

160:                                              ; preds = %.lr.ph
  %161 = call ptr @FRESULT_str(i32 noundef %159) #6
  %162 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 155, ptr noundef nonnull @.str.27, ptr noundef %161, i32 noundef %159) #6
  br label %167

163:                                              ; preds = %.lr.ph
  %164 = load i8, ptr %6, align 1, !tbaa !15
  %165 = sext i8 %164 to i32
  %166 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.28, i32 noundef %165) #6
  br label %167

167:                                              ; preds = %163, %160
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  %168 = load i64, ptr %103, align 8, !tbaa !9
  %169 = load i64, ptr %156, align 8, !tbaa !18
  %.not77 = icmp eq i64 %168, %169
  br i1 %.not77, label %._crit_edge, label %.lr.ph, !llvm.loop !19

._crit_edge:                                      ; preds = %167, %152
  %170 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.29, ptr noundef nonnull %5) #6
  %171 = call i32 @f_close(ptr noundef nonnull %2) #6
  %.not78 = icmp eq i32 %171, 0
  %172 = select i1 %.not78, ptr @.str.6, ptr @.str.5
  %173 = call i32 (ptr, ...) @info_message_printf(ptr noundef nonnull @.str.4, ptr noundef nonnull %172) #6
  br i1 %.not78, label %177, label %174

174:                                              ; preds = %._crit_edge
  %175 = call ptr @FRESULT_str(i32 noundef %171) #6
  %176 = call i32 (ptr, i32, ptr, ...) @error_message_printf(ptr noundef nonnull @__func__.simple, i32 noundef 163, ptr noundef nonnull @.str.22, ptr noundef %175, i32 noundef %171) #6
  br label %177

177:                                              ; preds = %174, %._crit_edge
  %178 = load ptr, ptr @stdout, align 8, !tbaa !5
  %179 = call i32 @fflush(ptr noundef %178)
  br label %180

180:                                              ; preds = %177, %149
  call void @llvm.lifetime.end.p0(i64 255, ptr nonnull %5) #6
  br label %181

181:                                              ; preds = %.thread, %126, %92, %180, %138, %96, %30, %20
  call void @llvm.lifetime.end.p0(i64 616, ptr nonnull %2) #6
  br label %182

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

declare i32 @info_message_printf(ptr noundef, ...) 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 #1

declare i32 @error_message_printf(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

declare ptr @FRESULT_str(i32 noundef) local_unnamed_addr #1

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

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

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

; 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 #1

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

; 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 #1

declare i32 @f_close(ptr noundef) local_unnamed_addr #1

declare void @ls(ptr noundef) local_unnamed_addr #1

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #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,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass