; LLVM IR from joembedded/JesFs :: JesFs_main (main)

; 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.SFLASH_INFO = type { i32, i32, i32, i32, i32, i16, i16, i16, i16, i16, %union.SF_BUFFER, i8 }
%union.SF_BUFFER = type { [32 x i32] }
%struct.FS_DESC = type { i32, i32, i32, i32, i32, i32, i16, i8 }
%struct.FS_STAT = type { [22 x i8], i32, i32, i32, i32, i8 }

@sbuffer = external dso_local global [10000 x i8], align 16
@.str.1 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@sflash_info = external global %struct.SFLASH_INFO, align 4
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@input = external dso_local global [81 x i8], align 16
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [14 x i8], align 1
@fs_desc = external dso_local global %struct.FS_DESC, align 4
@.str.19 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [20 x i8], align 1
@fs_stat = external dso_local global %struct.FS_STAT, align 4
@.str.28 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [25 x i8], align 1
@fs_desc_b = external dso_local global %struct.FS_DESC, align 4
@.str.53 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [16 x i8], align 1

declare i32 @tb_time_get() #0

; Function Attrs: nounwind uwtable
declare dso_local void @conv_secs_to_date_sbuffer(i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @conv_tstr_to_secs(ptr noundef) #1

; Function Attrs: nounwind
declare i64 @strtoul(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  call void @tb_init()
  %13 = call i32 @tb_watchdog_init()
  call void (ptr, ...) @tb_printf(ptr noundef @.str.1)
  %14 = call signext i16 @fs_start(i8 noundef zeroext 0)
  %15 = sext i16 %14 to i32
  store i32 %15, ptr %4, align 4, !tbaa !5
  %16 = load i32, ptr %4, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.2, i32 noundef %16)
  %17 = load i32, ptr getelementptr inbounds (%struct.SFLASH_INFO, ptr @sflash_info, i32 0, i32 1), align 4, !tbaa !9
  call void (ptr, ...) @tb_printf(ptr noundef @.str.3, i32 noundef %17)
  %18 = load i32, ptr @sflash_info, align 4, !tbaa !12
  call void (ptr, ...) @tb_printf(ptr noundef @.str.4, i32 noundef %18)
  br label %19

19:                                               ; preds = %459, %0
  call void @tb_board_led_on(i8 noundef zeroext 0)
  %20 = call i32 @tb_time_get()
  call void (ptr, ...) @tb_printf(ptr noundef @.str.5)
  %21 = call signext i16 @tb_gets(ptr noundef @input, i16 noundef signext 80, i16 noundef zeroext -5536, i8 noundef zeroext 1)
  %22 = sext i16 %21 to i32
  store i32 %22, ptr %4, align 4, !tbaa !5
  %23 = call signext i16 @tb_putc(i8 noundef signext 10)
  call void @tb_watchdog_feed(i32 noundef 1)
  call void @tb_board_led_off(i8 noundef zeroext 0)
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = icmp slt i32 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %19
  call void (ptr, ...) @tb_printf(ptr noundef @.str.6)
  call void @tb_uninit()
  call void @tb_delay_ms(i32 noundef 1000)
  call void @tb_init()
  br label %459

27:                                               ; preds = %19
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %30, label %458

30:                                               ; preds = %27
  store ptr getelementptr inbounds ([81 x i8], ptr @input, i64 0, i64 1), ptr %2, align 8, !tbaa !13
  br label %31

31:                                               ; preds = %36, %30
  %32 = load ptr, ptr %2, align 8, !tbaa !13
  %33 = load i8, ptr %32, align 1, !tbaa !15
  %34 = sext i8 %33 to i32
  %35 = icmp eq i32 %34, 32
  br i1 %35, label %36, label %39

36:                                               ; preds = %31
  %37 = load ptr, ptr %2, align 8, !tbaa !13
  %38 = getelementptr inbounds i8, ptr %37, i32 1
  store ptr %38, ptr %2, align 8, !tbaa !13
  br label %31, !llvm.loop !16

39:                                               ; preds = %31
  %40 = load ptr, ptr %2, align 8, !tbaa !13
  %41 = call i64 @strtoul(ptr noundef %40, ptr noundef null, i32 noundef 0) #6
  %42 = trunc i64 %41 to i32
  store i32 %42, ptr %3, align 4, !tbaa !5
  %43 = call i32 @tb_get_ticks()
  store i32 %43, ptr %8, align 4, !tbaa !5
  %44 = load i8, ptr @input, align 16, !tbaa !15
  %45 = sext i8 %44 to i32
  switch i32 %45, label %453 [
    i32 115, label %46
    i32 105, label %58
    i32 73, label %66
    i32 83, label %70
    i32 70, label %74
    i32 111, label %92
    i32 79, label %112
    i32 99, label %131
    i32 100, label %134
    i32 118, label %137
    i32 86, label %213
    i32 87, label %215
    i32 119, label %256
    i32 114, label %265
    i32 82, label %302
    i32 101, label %329
    i32 116, label %333
    i32 122, label %337
    i32 110, label %340
    i32 113, label %362
    i32 88, label %363
    i32 84, label %375
    i32 109, label %395
  ]

46:                                               ; preds = %39
  %47 = load i32, ptr %3, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.7, i32 noundef %47)
  %48 = call signext i16 @fs_start(i8 noundef zeroext -128)
  %49 = sext i16 %48 to i32
  store i32 %49, ptr %4, align 4, !tbaa !5
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %54

52:                                               ; preds = %46
  %53 = load i32, ptr %4, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.8, i32 noundef %53)
  br label %54

54:                                               ; preds = %52, %46
  %55 = call signext i16 @fs_deepsleep()
  call void @tb_delay_ms(i32 noundef 10)
  call void @tb_uninit()
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = mul i32 %56, 1000
  call void @tb_delay_ms(i32 noundef %57)
  call void @tb_init()
  br label %58

58:                                               ; preds = %54, %39
  %59 = call signext i16 @fs_start(i8 noundef zeroext 1)
  %60 = sext i16 %59 to i32
  store i32 %60, ptr %4, align 4, !tbaa !5
  %61 = load i32, ptr %4, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.9, i32 noundef %61)
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %65, label %64

64:                                               ; preds = %58
  br label %454

65:                                               ; preds = %58
  br label %66

66:                                               ; preds = %65, %39
  %67 = call signext i16 @fs_start(i8 noundef zeroext 0)
  %68 = sext i16 %67 to i32
  store i32 %68, ptr %4, align 4, !tbaa !5
  %69 = load i32, ptr %4, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.10, i32 noundef %69)
  br label %454

70:                                               ; preds = %39
  %71 = load i32, ptr %3, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.11, i32 noundef %71)
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = mul i32 %72, 1000
  call void @tb_delay_ms(i32 noundef %73)
  br label %454

74:                                               ; preds = %39
  %75 = load ptr, ptr %2, align 8, !tbaa !13
  %76 = call i32 @atoi(ptr noundef %75) #7
  store i32 %76, ptr %5, align 4, !tbaa !5
  store ptr @.str.12, ptr %2, align 8, !tbaa !13
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = icmp eq i32 %77, 1
  br i1 %78, label %79, label %80

79:                                               ; preds = %74
  store ptr @.str.13, ptr %2, align 8, !tbaa !13
  br label %85

80:                                               ; preds = %74
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = icmp eq i32 %81, 2
  br i1 %82, label %83, label %84

83:                                               ; preds = %80
  store ptr @.str.14, ptr %2, align 8, !tbaa !13
  br label %84

84:                                               ; preds = %83, %80
  br label %85

85:                                               ; preds = %84, %79
  %86 = load i32, ptr %5, align 4, !tbaa !5
  %87 = load ptr, ptr %2, align 8, !tbaa !13
  call void (ptr, ...) @tb_printf(ptr noundef @.str.15, i32 noundef %86, ptr noundef %87)
  %88 = load i32, ptr %5, align 4, !tbaa !5
  %89 = trunc i32 %88 to i8
  %90 = call signext i16 @fs_format(i8 noundef zeroext %89)
  %91 = sext i16 %90 to i32
  call void (ptr, ...) @tb_printf(ptr noundef @.str.16, i32 noundef %91)
  br label %454

92:                                               ; preds = %39
  %93 = load ptr, ptr %2, align 8, !tbaa !13
  call void (ptr, ...) @tb_printf(ptr noundef @.str.17, ptr noundef %93)
  store i8 25, ptr %10, align 1, !tbaa !15
  %94 = load ptr, ptr %2, align 8, !tbaa !13
  %95 = load i8, ptr %94, align 1, !tbaa !15
  %96 = sext i8 %95 to i32
  %97 = icmp eq i32 %96, 126
  br i1 %97, label %98, label %105

98:                                               ; preds = %92
  %99 = load i8, ptr %10, align 1, !tbaa !15
  %100 = zext i8 %99 to i32
  %101 = and i32 %100, -17
  %102 = trunc i32 %101 to i8
  store i8 %102, ptr %10, align 1, !tbaa !15
  %103 = load ptr, ptr %2, align 8, !tbaa !13
  %104 = getelementptr inbounds i8, ptr %103, i32 1
  store ptr %104, ptr %2, align 8, !tbaa !13
  call void (ptr, ...) @tb_printf(ptr noundef @.str.18)
  br label %105

105:                                              ; preds = %98, %92
  %106 = load ptr, ptr %2, align 8, !tbaa !13
  %107 = load i8, ptr %10, align 1, !tbaa !15
  %108 = call signext i16 @fs_open(ptr noundef @fs_desc, ptr noundef %106, i8 noundef zeroext %107)
  %109 = sext i16 %108 to i32
  store i32 %109, ptr %4, align 4, !tbaa !5
  %110 = load i32, ptr %4, align 4, !tbaa !5
  %111 = load i32, ptr getelementptr inbounds (%struct.FS_DESC, ptr @fs_desc, i32 0, i32 3), align 4, !tbaa !18
  call void (ptr, ...) @tb_printf(ptr noundef @.str.19, i32 noundef %110, i32 noundef %111)
  br label %454

112:                                              ; preds = %39
  %113 = load ptr, ptr %2, align 8, !tbaa !13
  call void (ptr, ...) @tb_printf(ptr noundef @.str.20, ptr noundef %113)
  store i8 22, ptr %10, align 1, !tbaa !15
  %114 = load ptr, ptr %2, align 8, !tbaa !13
  %115 = load i8, ptr %114, align 1, !tbaa !15
  %116 = sext i8 %115 to i32
  %117 = icmp eq i32 %116, 126
  br i1 %117, label %118, label %125

118:                                              ; preds = %112
  %119 = load i8, ptr %10, align 1, !tbaa !15
  %120 = zext i8 %119 to i32
  %121 = and i32 %120, -17
  %122 = trunc i32 %121 to i8
  store i8 %122, ptr %10, align 1, !tbaa !15
  %123 = load ptr, ptr %2, align 8, !tbaa !13
  %124 = getelementptr inbounds i8, ptr %123, i32 1
  store ptr %124, ptr %2, align 8, !tbaa !13
  call void (ptr, ...) @tb_printf(ptr noundef @.str.18)
  br label %125

125:                                              ; preds = %118, %112
  %126 = load ptr, ptr %2, align 8, !tbaa !13
  %127 = load i8, ptr %10, align 1, !tbaa !15
  %128 = call signext i16 @fs_open(ptr noundef @fs_desc, ptr noundef %126, i8 noundef zeroext %127)
  %129 = sext i16 %128 to i32
  store i32 %129, ptr %4, align 4, !tbaa !5
  %130 = load i32, ptr %4, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.21, i32 noundef %130)
  br label %454

131:                                              ; preds = %39
  %132 = call signext i16 @fs_close(ptr noundef @fs_desc)
  %133 = sext i16 %132 to i32
  call void (ptr, ...) @tb_printf(ptr noundef @.str.22, i32 noundef %133)
  br label %454

134:                                              ; preds = %39
  %135 = call signext i16 @fs_delete(ptr noundef @fs_desc)
  %136 = sext i16 %135 to i32
  call void (ptr, ...) @tb_printf(ptr noundef @.str.23, i32 noundef %136)
  br label %454

137:                                              ; preds = %39
  call void (ptr, ...) @tb_printf(ptr noundef @.str.24)
  %138 = load i32, ptr getelementptr inbounds (%struct.SFLASH_INFO, ptr @sflash_info, i32 0, i32 1), align 4, !tbaa !9
  call void (ptr, ...) @tb_printf(ptr noundef @.str.3, i32 noundef %138)
  %139 = load i32, ptr getelementptr inbounds (%struct.SFLASH_INFO, ptr @sflash_info, i32 0, i32 2), align 4, !tbaa !20
  %140 = icmp eq i32 %139, -1
  br i1 %140, label %141, label %142

141:                                              ; preds = %137
  call void (ptr, ...) @tb_printf(ptr noundef @.str.25)
  br label %454

142:                                              ; preds = %137
  %143 = load i32, ptr getelementptr inbounds (%struct.SFLASH_INFO, ptr @sflash_info, i32 0, i32 4), align 4, !tbaa !21
  %144 = load i32, ptr getelementptr inbounds (%struct.SFLASH_INFO, ptr @sflash_info, i32 0, i32 4), align 4, !tbaa !21
  %145 = udiv i32 %144, 4096
  call void (ptr, ...) @tb_printf(ptr noundef @.str.26, i32 noundef %143, i32 noundef %145)
  %146 = load i32, ptr getelementptr inbounds (%struct.SFLASH_INFO, ptr @sflash_info, i32 0, i32 2), align 4, !tbaa !20
  call void @conv_secs_to_date_sbuffer(i32 noundef %146)
  call void (ptr, ...) @tb_printf(ptr noundef @.str.27, ptr noundef @sbuffer)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %198, %142
  %148 = load i32, ptr %5, align 4, !tbaa !5
  %149 = load i16, ptr getelementptr inbounds (%struct.SFLASH_INFO, ptr @sflash_info, i32 0, i32 5), align 4, !tbaa !22
  %150 = zext i16 %149 to i32
  %151 = add nsw i32 %150, 1
  %152 = icmp slt i32 %148, %151
  br i1 %152, label %153, label %201

153:                                              ; preds = %147
  %154 = load i32, ptr %5, align 4, !tbaa !5
  %155 = trunc i32 %154 to i16
  %156 = call signext i16 @fs_info(ptr noundef @fs_stat, i16 noundef zeroext %155)
  %157 = sext i16 %156 to i32
  store i32 %157, ptr %4, align 4, !tbaa !5
  %158 = load i32, ptr %4, align 4, !tbaa !5
  %159 = icmp sle i32 %158, 0
  br i1 %159, label %160, label %161

160:                                              ; preds = %153
  br label %201

161:                                              ; preds = %153
  %162 = load i32, ptr %4, align 4, !tbaa !5
  %163 = and i32 %162, 2
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %166

165:                                              ; preds = %161
  call void (ptr, ...) @tb_printf(ptr noundef @.str.28, ptr noundef @fs_stat)
  br label %197

166:                                              ; preds = %161
  %167 = load i32, ptr %4, align 4, !tbaa !5
  %168 = and i32 %167, 1
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %170, label %196

170:                                              ; preds = %166
  call void (ptr, ...) @tb_printf(ptr noundef @.str.29, ptr noundef @fs_stat)
  %171 = load i32, ptr %4, align 4, !tbaa !5
  %172 = and i32 %171, 4
  %173 = icmp ne i32 %172, 0
  br i1 %173, label %174, label %179

174:                                              ; preds = %170
  %175 = call signext i16 @fs_open(ptr noundef @fs_desc, ptr noundef @fs_stat, i8 noundef zeroext 9)
  %176 = call i32 @fs_read(ptr noundef @fs_desc, ptr noundef null, i32 noundef -1)
  %177 = call signext i16 @fs_close(ptr noundef @fs_desc)
  %178 = load i32, ptr getelementptr inbounds (%struct.FS_DESC, ptr @fs_desc, i32 0, i32 3), align 4, !tbaa !18
  call void (ptr, ...) @tb_printf(ptr noundef @.str.30, i32 noundef %178)
  br label %181

179:                                              ; preds = %170
  %180 = load i32, ptr getelementptr inbounds (%struct.FS_STAT, ptr @fs_stat, i32 0, i32 2), align 4, !tbaa !23
  call void (ptr, ...) @tb_printf(ptr noundef @.str.31, i32 noundef %180)
  br label %181

181:                                              ; preds = %179, %174
  %182 = load i8, ptr getelementptr inbounds (%struct.FS_STAT, ptr @fs_stat, i32 0, i32 5), align 4, !tbaa !25
  %183 = zext i8 %182 to i32
  %184 = and i32 %183, 16
  %185 = icmp ne i32 %184, 0
  br i1 %185, label %186, label %188

186:                                              ; preds = %181
  %187 = load i32, ptr getelementptr inbounds (%struct.FS_STAT, ptr @fs_stat, i32 0, i32 3), align 4, !tbaa !26
  call void (ptr, ...) @tb_printf(ptr noundef @.str.32, i32 noundef %187)
  br label %188

188:                                              ; preds = %186, %181
  %189 = load i8, ptr getelementptr inbounds (%struct.FS_STAT, ptr @fs_stat, i32 0, i32 5), align 4, !tbaa !25
  %190 = zext i8 %189 to i32
  %191 = and i32 %190, 64
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %194

193:                                              ; preds = %188
  call void (ptr, ...) @tb_printf(ptr noundef @.str.33)
  br label %194

194:                                              ; preds = %193, %188
  %195 = load i32, ptr getelementptr inbounds (%struct.FS_STAT, ptr @fs_stat, i32 0, i32 1), align 4, !tbaa !27
  call void @conv_secs_to_date_sbuffer(i32 noundef %195)
  call void (ptr, ...) @tb_printf(ptr noundef @.str.34, ptr noundef @sbuffer)
  br label %196

196:                                              ; preds = %194, %166
  br label %197

197:                                              ; preds = %196, %165
  br label %198

198:                                              ; preds = %197
  %199 = load i32, ptr %5, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %5, align 4, !tbaa !5
  br label %147, !llvm.loop !28

201:                                              ; preds = %160, %147
  %202 = load i16, ptr getelementptr inbounds (%struct.SFLASH_INFO, ptr @sflash_info, i32 0, i32 6), align 2, !tbaa !29
  %203 = zext i16 %202 to i32
  call void (ptr, ...) @tb_printf(ptr noundef @.str.35, i32 noundef %203)
  %204 = load i16, ptr getelementptr inbounds (%struct.SFLASH_INFO, ptr @sflash_info, i32 0, i32 5), align 4, !tbaa !22
  %205 = zext i16 %204 to i32
  call void (ptr, ...) @tb_printf(ptr noundef @.str.36, i32 noundef %205)
  %206 = load i16, ptr getelementptr inbounds (%struct.SFLASH_INFO, ptr @sflash_info, i32 0, i32 9), align 4, !tbaa !30
  %207 = icmp ne i16 %206, 0
  br i1 %207, label %208, label %211

208:                                              ; preds = %201
  %209 = load i16, ptr getelementptr inbounds (%struct.SFLASH_INFO, ptr @sflash_info, i32 0, i32 9), align 4, !tbaa !30
  %210 = zext i16 %209 to i32
  call void (ptr, ...) @tb_printf(ptr noundef @.str.37, i32 noundef %210)
  br label %211

211:                                              ; preds = %208, %201
  %212 = load i32, ptr %4, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.21, i32 noundef %212)
  br label %454

213:                                              ; preds = %39
  %214 = call signext i16 @fs_check_disk(ptr noundef @tb_printf, ptr noundef @sbuffer, i32 noundef 10000)
  br label %454

215:                                              ; preds = %39
  %216 = load i32, ptr %3, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.38, i32 noundef %216, i32 noundef 10000)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %217

217:                                              ; preds = %228, %215
  %218 = load i32, ptr %5, align 4, !tbaa !5
  %219 = icmp slt i32 %218, 10000
  br i1 %219, label %220, label %231

220:                                              ; preds = %217
  %221 = load i32, ptr %5, align 4, !tbaa !5
  %222 = srem i32 %221, 93
  %223 = add nsw i32 32, %222
  %224 = trunc i32 %223 to i8
  %225 = load i32, ptr %5, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %226
  store i8 %224, ptr %227, align 1, !tbaa !15
  br label %228

228:                                              ; preds = %220
  %229 = load i32, ptr %5, align 4, !tbaa !5
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %5, align 4, !tbaa !5
  br label %217, !llvm.loop !31

231:                                              ; preds = %217
  %232 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %232, ptr %7, align 4, !tbaa !5
  br label %233

233:                                              ; preds = %251, %231
  %234 = load i32, ptr %7, align 4, !tbaa !5
  %235 = icmp sgt i32 %234, 0
  br i1 %235, label %236, label %255

236:                                              ; preds = %233
  %237 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %237, ptr %3, align 4, !tbaa !5
  %238 = load i32, ptr %3, align 4, !tbaa !5
  %239 = icmp ugt i32 %238, 10000
  br i1 %239, label %240, label %241

240:                                              ; preds = %236
  store i32 10000, ptr %3, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %240, %236
  %242 = load i32, ptr %3, align 4, !tbaa !5
  %243 = call signext i16 @fs_write(ptr noundef @fs_desc, ptr noundef @sbuffer, i32 noundef %242)
  %244 = sext i16 %243 to i32
  store i32 %244, ptr %4, align 4, !tbaa !5
  %245 = load i32, ptr %3, align 4, !tbaa !5
  %246 = load i32, ptr %7, align 4, !tbaa !5
  %247 = load i32, ptr %4, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.39, i32 noundef %245, i32 noundef %246, i32 noundef %247)
  %248 = load i32, ptr %4, align 4, !tbaa !5
  %249 = icmp slt i32 %248, 0
  br i1 %249, label %250, label %251

250:                                              ; preds = %241
  br label %255

251:                                              ; preds = %241
  %252 = load i32, ptr %3, align 4, !tbaa !5
  %253 = load i32, ptr %7, align 4, !tbaa !5
  %254 = sub i32 %253, %252
  store i32 %254, ptr %7, align 4, !tbaa !5
  br label %233, !llvm.loop !32

255:                                              ; preds = %250, %233
  br label %454

256:                                              ; preds = %39
  %257 = load ptr, ptr %2, align 8, !tbaa !13
  call void (ptr, ...) @tb_printf(ptr noundef @.str.40, ptr noundef %257)
  %258 = load ptr, ptr %2, align 8, !tbaa !13
  %259 = load ptr, ptr %2, align 8, !tbaa !13
  %260 = call i64 @strlen(ptr noundef %259) #7
  %261 = trunc i64 %260 to i32
  %262 = call signext i16 @fs_write(ptr noundef @fs_desc, ptr noundef %258, i32 noundef %261)
  %263 = sext i16 %262 to i32
  store i32 %263, ptr %4, align 4, !tbaa !5
  %264 = load i32, ptr %4, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.21, i32 noundef %264)
  br label %454

265:                                              ; preds = %39
  %266 = load i32, ptr %3, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.41, i32 noundef %266)
  %267 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %267, ptr %7, align 4, !tbaa !5
  %268 = load i32, ptr %7, align 4, !tbaa !5
  %269 = icmp slt i32 %268, 10000
  br i1 %269, label %270, label %295

270:                                              ; preds = %265
  %271 = load i32, ptr %7, align 4, !tbaa !5
  %272 = call i32 @fs_read(ptr noundef @fs_desc, ptr noundef @sbuffer, i32 noundef %271)
  store i32 %272, ptr %4, align 4, !tbaa !5
  %273 = load i32, ptr %4, align 4, !tbaa !5
  %274 = icmp sgt i32 %273, 0
  br i1 %274, label %275, label %294

275:                                              ; preds = %270
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %276

276:                                              ; preds = %290, %275
  %277 = load i32, ptr %5, align 4, !tbaa !5
  %278 = load i32, ptr %4, align 4, !tbaa !5
  %279 = icmp slt i32 %277, %278
  br i1 %279, label %280, label %293

280:                                              ; preds = %276
  %281 = load i32, ptr %5, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %282
  %284 = load i8, ptr %283, align 1, !tbaa !15
  %285 = zext i8 %284 to i32
  call void (ptr, ...) @tb_printf(ptr noundef @.str.42, i32 noundef %285)
  %286 = load i32, ptr %5, align 4, !tbaa !5
  %287 = icmp sgt i32 %286, 60
  br i1 %287, label %288, label %289

288:                                              ; preds = %280
  call void (ptr, ...) @tb_printf(ptr noundef @.str.43)
  br label %293

289:                                              ; preds = %280
  br label %290

290:                                              ; preds = %289
  %291 = load i32, ptr %5, align 4, !tbaa !5
  %292 = add nsw i32 %291, 1
  store i32 %292, ptr %5, align 4, !tbaa !5
  br label %276, !llvm.loop !33

293:                                              ; preds = %288, %276
  call void (ptr, ...) @tb_printf(ptr noundef @.str.44)
  br label %294

294:                                              ; preds = %293, %270
  br label %299

295:                                              ; preds = %265
  %296 = load i32, ptr %7, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.45, i32 noundef %296)
  %297 = load i32, ptr %7, align 4, !tbaa !5
  %298 = call i32 @fs_read(ptr noundef @fs_desc, ptr noundef null, i32 noundef %297)
  store i32 %298, ptr %4, align 4, !tbaa !5
  br label %299

299:                                              ; preds = %295, %294
  %300 = load i32, ptr %7, align 4, !tbaa !5
  %301 = load i32, ptr %4, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.46, i32 noundef %300, i32 noundef %301)
  br label %454

302:                                              ; preds = %39
  %303 = load i32, ptr %3, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.47, i32 noundef %303, i32 noundef 10000)
  store i32 0, ptr %6, align 4, !tbaa !5
  %304 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %304, ptr %7, align 4, !tbaa !5
  br label %305

305:                                              ; preds = %319, %302
  %306 = load i32, ptr %7, align 4, !tbaa !5
  %307 = icmp sgt i32 %306, 0
  br i1 %307, label %308, label %326

308:                                              ; preds = %305
  %309 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %309, ptr %3, align 4, !tbaa !5
  %310 = load i32, ptr %3, align 4, !tbaa !5
  %311 = icmp ugt i32 %310, 10000
  br i1 %311, label %312, label %313

312:                                              ; preds = %308
  store i32 10000, ptr %3, align 4, !tbaa !5
  br label %313

313:                                              ; preds = %312, %308
  %314 = load i32, ptr %3, align 4, !tbaa !5
  %315 = call i32 @fs_read(ptr noundef @fs_desc, ptr noundef @sbuffer, i32 noundef %314)
  store i32 %315, ptr %4, align 4, !tbaa !5
  %316 = load i32, ptr %4, align 4, !tbaa !5
  %317 = icmp sle i32 %316, 0
  br i1 %317, label %318, label %319

318:                                              ; preds = %313
  br label %326

319:                                              ; preds = %313
  %320 = load i32, ptr %3, align 4, !tbaa !5
  %321 = load i32, ptr %7, align 4, !tbaa !5
  %322 = sub i32 %321, %320
  store i32 %322, ptr %7, align 4, !tbaa !5
  %323 = load i32, ptr %4, align 4, !tbaa !5
  %324 = load i32, ptr %6, align 4, !tbaa !5
  %325 = add nsw i32 %324, %323
  store i32 %325, ptr %6, align 4, !tbaa !5
  br label %305, !llvm.loop !34

326:                                              ; preds = %318, %305
  %327 = load i32, ptr %6, align 4, !tbaa !5
  %328 = load i32, ptr %4, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.48, i32 noundef %327, i32 noundef %328)
  br label %454

329:                                              ; preds = %39
  %330 = call signext i16 @fs_rewind(ptr noundef @fs_desc)
  %331 = sext i16 %330 to i32
  store i32 %331, ptr %4, align 4, !tbaa !5
  %332 = load i32, ptr %4, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.49, i32 noundef %332)
  br label %454

333:                                              ; preds = %39
  %334 = load i32, ptr getelementptr inbounds (%struct.FS_DESC, ptr @fs_desc, i32 0, i32 2), align 4, !tbaa !35
  %335 = load i32, ptr getelementptr inbounds (%struct.FS_DESC, ptr @fs_desc, i32 0, i32 3), align 4, !tbaa !18
  %336 = load i32, ptr getelementptr inbounds (%struct.FS_DESC, ptr @fs_desc, i32 0, i32 4), align 4, !tbaa !36
  call void (ptr, ...) @tb_printf(ptr noundef @.str.50, i32 noundef %334, i32 noundef %335, i32 noundef %336)
  br label %454

337:                                              ; preds = %39
  %338 = call i32 @fs_get_crc32(ptr noundef @fs_desc)
  %339 = load i32, ptr getelementptr inbounds (%struct.FS_DESC, ptr @fs_desc, i32 0, i32 4), align 4, !tbaa !36
  call void (ptr, ...) @tb_printf(ptr noundef @.str.51, i32 noundef %338, i32 noundef %339)
  br label %454

340:                                              ; preds = %39
  %341 = load ptr, ptr %2, align 8, !tbaa !13
  call void (ptr, ...) @tb_printf(ptr noundef @.str.52, ptr noundef %341)
  store i32 6, ptr %5, align 4, !tbaa !5
  %342 = load i8, ptr getelementptr inbounds (%struct.FS_DESC, ptr @fs_desc, i32 0, i32 7), align 2, !tbaa !37
  %343 = zext i8 %342 to i32
  %344 = and i32 %343, 16
  %345 = icmp ne i32 %344, 0
  br i1 %345, label %346, label %349

346:                                              ; preds = %340
  %347 = load i32, ptr %5, align 4, !tbaa !5
  %348 = or i32 %347, 16
  store i32 %348, ptr %5, align 4, !tbaa !5
  br label %349

349:                                              ; preds = %346, %340
  %350 = load ptr, ptr %2, align 8, !tbaa !13
  %351 = load i32, ptr %5, align 4, !tbaa !5
  %352 = trunc i32 %351 to i8
  %353 = call signext i16 @fs_open(ptr noundef @fs_desc_b, ptr noundef %350, i8 noundef zeroext %352)
  %354 = sext i16 %353 to i32
  store i32 %354, ptr %4, align 4, !tbaa !5
  %355 = load i32, ptr %4, align 4, !tbaa !5
  %356 = icmp ne i32 %355, 0
  br i1 %356, label %360, label %357

357:                                              ; preds = %349
  %358 = call signext i16 @fs_rename(ptr noundef @fs_desc, ptr noundef @fs_desc_b)
  %359 = sext i16 %358 to i32
  store i32 %359, ptr %4, align 4, !tbaa !5
  br label %360

360:                                              ; preds = %357, %349
  %361 = load i32, ptr %4, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.53, i32 noundef %361)
  br label %454

362:                                              ; preds = %39
  call void (ptr, ...) @tb_printf(ptr noundef @.str.54)
  call void @tb_delay_ms(i32 noundef 1000)
  call void (ptr, ...) @tb_printf(ptr noundef @.str.55)
  call void @tb_system_reset()
  br label %363

363:                                              ; preds = %362, %39
  %364 = load i32, ptr %3, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.56, i32 noundef %364)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %365

365:                                              ; preds = %371, %363
  %366 = load i32, ptr %5, align 4, !tbaa !5
  %367 = load i32, ptr %3, align 4, !tbaa !5
  %368 = icmp ult i32 %366, %367
  br i1 %368, label %369, label %374

369:                                              ; preds = %365
  %370 = load i32, ptr %5, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.57, i32 noundef %370)
  call void @tb_delay_ms(i32 noundef 1000)
  br label %371

371:                                              ; preds = %369
  %372 = load i32, ptr %5, align 4, !tbaa !5
  %373 = add nsw i32 %372, 1
  store i32 %373, ptr %5, align 4, !tbaa !5
  br label %365, !llvm.loop !38

374:                                              ; preds = %365
  br label %454

375:                                              ; preds = %39
  %376 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %376, ptr %9, align 4, !tbaa !5
  %377 = load i32, ptr %9, align 4, !tbaa !5
  %378 = icmp ne i32 %377, 0
  br i1 %378, label %379, label %391

379:                                              ; preds = %375
  %380 = load i32, ptr %9, align 4, !tbaa !5
  %381 = icmp ult i32 %380, 32
  br i1 %381, label %382, label %385

382:                                              ; preds = %379
  %383 = load ptr, ptr %2, align 8, !tbaa !13
  %384 = call i32 @conv_tstr_to_secs(ptr noundef %383)
  store i32 %384, ptr %9, align 4, !tbaa !5
  br label %385

385:                                              ; preds = %382, %379
  %386 = load i32, ptr %9, align 4, !tbaa !5
  %387 = icmp ne i32 %386, 0
  br i1 %387, label %388, label %390

388:                                              ; preds = %385
  %389 = load i32, ptr %9, align 4, !tbaa !5
  call void @tb_time_set(i32 noundef %389)
  br label %390

390:                                              ; preds = %388, %385
  br label %391

391:                                              ; preds = %390, %375
  %392 = call i32 @tb_time_get()
  store i32 %392, ptr %9, align 4, !tbaa !5
  %393 = load i32, ptr %9, align 4, !tbaa !5
  call void @conv_secs_to_date_sbuffer(i32 noundef %393)
  %394 = load i32, ptr %9, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.58, ptr noundef @sbuffer, i32 noundef %394)
  br label %454

395:                                              ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %396 = load ptr, ptr %2, align 8, !tbaa !13
  %397 = call i64 @strtol(ptr noundef %396, ptr noundef null, i32 noundef 16) #6
  %398 = trunc i64 %397 to i32
  store i32 %398, ptr %11, align 4, !tbaa !5
  %399 = load i32, ptr %11, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.59, i32 noundef %399)
  %400 = load i32, ptr %11, align 4, !tbaa !5
  call void @sflash_read(i32 noundef %400, ptr noundef @sbuffer, i16 noundef zeroext 256)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %401

401:                                              ; preds = %449, %395
  %402 = load i32, ptr %5, align 4, !tbaa !5
  %403 = icmp slt i32 %402, 16
  br i1 %403, label %404, label %452

404:                                              ; preds = %401
  %405 = load i32, ptr %11, align 4, !tbaa !5
  %406 = load i32, ptr %5, align 4, !tbaa !5
  %407 = mul nsw i32 %406, 16
  %408 = add nsw i32 %405, %407
  call void (ptr, ...) @tb_printf(ptr noundef @.str.60, i32 noundef %408)
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %409

409:                                              ; preds = %421, %404
  %410 = load i32, ptr %12, align 4, !tbaa !5
  %411 = icmp slt i32 %410, 16
  br i1 %411, label %412, label %424

412:                                              ; preds = %409
  %413 = load i32, ptr %5, align 4, !tbaa !5
  %414 = mul nsw i32 %413, 16
  %415 = load i32, ptr %12, align 4, !tbaa !5
  %416 = add nsw i32 %414, %415
  %417 = sext i32 %416 to i64
  %418 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %417
  %419 = load i8, ptr %418, align 1, !tbaa !15
  %420 = zext i8 %419 to i32
  call void (ptr, ...) @tb_printf(ptr noundef @.str.61, i32 noundef %420)
  br label %421

421:                                              ; preds = %412
  %422 = load i32, ptr %12, align 4, !tbaa !5
  %423 = add nsw i32 %422, 1
  store i32 %423, ptr %12, align 4, !tbaa !5
  br label %409, !llvm.loop !39

424:                                              ; preds = %409
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %425

425:                                              ; preds = %445, %424
  %426 = load i32, ptr %12, align 4, !tbaa !5
  %427 = icmp slt i32 %426, 16
  br i1 %427, label %428, label %448

428:                                              ; preds = %425
  %429 = load i32, ptr %5, align 4, !tbaa !5
  %430 = mul nsw i32 %429, 16
  %431 = load i32, ptr %12, align 4, !tbaa !5
  %432 = add nsw i32 %430, %431
  %433 = sext i32 %432 to i64
  %434 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %433
  %435 = load i8, ptr %434, align 1, !tbaa !15
  %436 = zext i8 %435 to i32
  store i32 %436, ptr %4, align 4, !tbaa !5
  %437 = load i32, ptr %4, align 4, !tbaa !5
  %438 = icmp slt i32 %437, 32
  br i1 %438, label %442, label %439

439:                                              ; preds = %428
  %440 = load i32, ptr %4, align 4, !tbaa !5
  %441 = icmp sgt i32 %440, 127
  br i1 %441, label %442, label %443

442:                                              ; preds = %439, %428
  store i32 46, ptr %4, align 4, !tbaa !5
  br label %443

443:                                              ; preds = %442, %439
  %444 = load i32, ptr %4, align 4, !tbaa !5
  call void (ptr, ...) @tb_printf(ptr noundef @.str.42, i32 noundef %444)
  br label %445

445:                                              ; preds = %443
  %446 = load i32, ptr %12, align 4, !tbaa !5
  %447 = add nsw i32 %446, 1
  store i32 %447, ptr %12, align 4, !tbaa !5
  br label %425, !llvm.loop !40

448:                                              ; preds = %425
  call void (ptr, ...) @tb_printf(ptr noundef @.str.44)
  br label %449

449:                                              ; preds = %448
  %450 = load i32, ptr %5, align 4, !tbaa !5
  %451 = add nsw i32 %450, 1
  store i32 %451, ptr %5, align 4, !tbaa !5
  br label %401, !llvm.loop !41

452:                                              ; preds = %401
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %454

453:                                              ; preds = %39
  call void (ptr, ...) @tb_printf(ptr noundef @.str.62)
  br label %454

454:                                              ; preds = %453, %452, %391, %374, %360, %337, %333, %329, %326, %299, %256, %255, %213, %211, %141, %134, %131, %125, %105, %85, %70, %66, %64
  %455 = load i32, ptr %8, align 4, !tbaa !5
  %456 = call i32 @tb_get_ticks()
  %457 = call i32 @tb_deltaticks_to_ms(i32 noundef %455, i32 noundef %456)
  call void (ptr, ...) @tb_printf(ptr noundef @.str.63, i32 noundef %457)
  br label %458

458:                                              ; preds = %454, %27
  br label %459

459:                                              ; preds = %458, %26
  br label %19
}

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

declare void @tb_init() #0

declare i32 @tb_watchdog_init() #0

declare void @tb_printf(ptr noundef, ...) #0

declare signext i16 @fs_start(i8 noundef zeroext) #0

declare void @tb_board_led_on(i8 noundef zeroext) #0

declare signext i16 @tb_gets(ptr noundef, i16 noundef signext, i16 noundef zeroext, i8 noundef zeroext) #0

declare signext i16 @tb_putc(i8 noundef signext) #0

declare void @tb_watchdog_feed(i32 noundef) #0

declare void @tb_board_led_off(i8 noundef zeroext) #0

declare void @tb_uninit() #0

declare void @tb_delay_ms(i32 noundef) #0

declare i32 @tb_get_ticks() #0

declare signext i16 @fs_deepsleep() #0

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

declare signext i16 @fs_format(i8 noundef zeroext) #0

declare signext i16 @fs_open(ptr noundef, ptr noundef, i8 noundef zeroext) #0

declare signext i16 @fs_close(ptr noundef) #0

declare signext i16 @fs_delete(ptr noundef) #0

declare signext i16 @fs_info(ptr noundef, i16 noundef zeroext) #0

declare i32 @fs_read(ptr noundef, ptr noundef, i32 noundef) #0

declare signext i16 @fs_check_disk(ptr noundef, ptr noundef, i32 noundef) #0

declare signext i16 @fs_write(ptr noundef, ptr noundef, i32 noundef) #0

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

declare signext i16 @fs_rewind(ptr noundef) #0

declare i32 @fs_get_crc32(ptr noundef) #0

declare signext i16 @fs_rename(ptr noundef, ptr noundef) #0

declare void @tb_system_reset() #0

declare void @tb_time_set(i32 noundef) #0

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

declare void @sflash_read(i32 noundef, ptr noundef, i16 noundef zeroext) #0

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

declare i32 @tb_deltaticks_to_ms(i32 noundef, i32 noundef) #0

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 4}
!10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !11, i64 20, !11, i64 22, !11, i64 24, !11, i64 26, !11, i64 28, !7, i64 32, !7, i64 160}
!11 = !{!"short", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !6, i64 12}
!19 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !11, i64 24, !7, i64 26}
!20 = !{!10, !6, i64 8}
!21 = !{!10, !6, i64 16}
!22 = !{!10, !11, i64 20}
!23 = !{!24, !6, i64 28}
!24 = !{!"", !7, i64 0, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !7, i64 40}
!25 = !{!24, !7, i64 40}
!26 = !{!24, !6, i64 32}
!27 = !{!24, !6, i64 24}
!28 = distinct !{!28, !17}
!29 = !{!10, !11, i64 22}
!30 = !{!10, !11, i64 28}
!31 = distinct !{!31, !17}
!32 = distinct !{!32, !17}
!33 = distinct !{!33, !17}
!34 = distinct !{!34, !17}
!35 = !{!19, !6, i64 8}
!36 = !{!19, !6, i64 16}
!37 = !{!19, !7, i64 26}
!38 = distinct !{!38, !17}
!39 = distinct !{!39, !17}
!40 = distinct !{!40, !17}
!41 = distinct !{!41, !17}


; 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.SFLASH_INFO = type { i32, i32, i32, i32, i32, i16, i16, i16, i16, i16, %union.SF_BUFFER, i8 }
%union.SF_BUFFER = type { [32 x i32] }
%struct.FS_DESC = type { i32, i32, i32, i32, i32, i32, i16, i8 }
%struct.FS_STAT = type { [22 x i8], i32, i32, i32, i32, i8 }

@sbuffer = external dso_local global [10000 x i8], align 16
@.str.1 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@sflash_info = external local_unnamed_addr global %struct.SFLASH_INFO, align 4
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@input = external dso_local global [81 x i8], align 16
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [14 x i8], align 1
@fs_desc = external dso_local global %struct.FS_DESC, align 4
@.str.19 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [20 x i8], align 1
@fs_stat = external dso_local global %struct.FS_STAT, align 4
@.str.28 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [25 x i8], align 1
@fs_desc_b = external dso_local global %struct.FS_DESC, align 4
@.str.53 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [16 x i8], align 1

declare i32 @tb_time_get() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @conv_secs_to_date_sbuffer(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @conv_tstr_to_secs(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  tail call void @tb_init() #7
  %1 = tail call i32 @tb_watchdog_init() #7
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.1) #7
  %2 = tail call signext i16 @fs_start(i8 noundef zeroext 0) #7
  %3 = sext i16 %2 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.2, i32 noundef %3) #7
  %4 = load i32, ptr getelementptr inbounds (i8, ptr @sflash_info, i64 4), align 4, !tbaa !5
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.3, i32 noundef %4) #7
  %5 = load i32, ptr @sflash_info, align 4, !tbaa !11
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.4, i32 noundef %5) #7
  br label %6

6:                                                ; preds = %.backedge, %0
  tail call void @tb_board_led_on(i8 noundef zeroext 0) #7
  %7 = tail call i32 @tb_time_get() #7
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.5) #7
  %8 = tail call signext i16 @tb_gets(ptr noundef nonnull @input, i16 noundef signext 80, i16 noundef zeroext -5536, i8 noundef zeroext 1) #7
  %9 = sext i16 %8 to i32
  %10 = tail call signext i16 @tb_putc(i8 noundef signext 10) #7
  tail call void @tb_watchdog_feed(i32 noundef 1) #7
  tail call void @tb_board_led_off(i8 noundef zeroext 0) #7
  %11 = icmp slt i16 %8, 0
  br i1 %11, label %12, label %13

12:                                               ; preds = %6
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.6) #7
  tail call void @tb_uninit() #7
  tail call void @tb_delay_ms(i32 noundef 1000) #7
  tail call void @tb_init() #7
  br label %.backedge

13:                                               ; preds = %6
  %.not = icmp eq i16 %8, 0
  br i1 %.not, label %.backedge, label %.preheader186

.backedge:                                        ; preds = %13, %.loopexit, %12
  br label %6

.preheader186:                                    ; preds = %13, %.preheader186
  %.0131 = phi ptr [ %16, %.preheader186 ], [ getelementptr inbounds (i8, ptr @input, i64 1), %13 ]
  %14 = load i8, ptr %.0131, align 1, !tbaa !12
  %15 = icmp eq i8 %14, 32
  %16 = getelementptr inbounds i8, ptr %.0131, i64 1
  br i1 %15, label %.preheader186, label %17, !llvm.loop !13

17:                                               ; preds = %.preheader186
  %18 = tail call i64 @strtoul(ptr nocapture noundef nonnull %.0131, ptr noundef null, i32 noundef 0) #7
  %19 = trunc i64 %18 to i32
  %20 = tail call i32 @tb_get_ticks() #7
  %21 = load i8, ptr @input, align 16, !tbaa !12
  switch i8 %21, label %268 [
    i8 115, label %22
    i8 105, label %29
    i8 73, label %32
    i8 83, label %35
    i8 70, label %37
    i8 111, label %42
    i8 79, label %50
    i8 99, label %57
    i8 100, label %60
    i8 118, label %63
    i8 86, label %113
    i8 87, label %vector.ph
    i8 119, label %130
    i8 114, label %135
    i8 82, label %148
    i8 101, label %156
    i8 116, label %159
    i8 122, label %163
    i8 110, label %166
    i8 113, label %173
    i8 88, label %174
    i8 84, label %176
    i8 109, label %183
  ]

22:                                               ; preds = %17
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.7, i32 noundef %19) #7
  %23 = tail call signext i16 @fs_start(i8 noundef zeroext -128) #7
  %.not174 = icmp eq i16 %23, 0
  br i1 %.not174, label %26, label %24

24:                                               ; preds = %22
  %25 = sext i16 %23 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.8, i32 noundef %25) #7
  br label %26

26:                                               ; preds = %24, %22
  %27 = tail call signext i16 @fs_deepsleep() #7
  tail call void @tb_delay_ms(i32 noundef 10) #7
  tail call void @tb_uninit() #7
  %28 = mul i32 %19, 1000
  tail call void @tb_delay_ms(i32 noundef %28) #7
  tail call void @tb_init() #7
  br label %29

29:                                               ; preds = %26, %17
  %30 = tail call signext i16 @fs_start(i8 noundef zeroext 1) #7
  %31 = sext i16 %30 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.9, i32 noundef %31) #7
  %.not175 = icmp eq i16 %30, 0
  br i1 %.not175, label %.loopexit, label %32

32:                                               ; preds = %29, %17
  %33 = tail call signext i16 @fs_start(i8 noundef zeroext 0) #7
  %34 = sext i16 %33 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.10, i32 noundef %34) #7
  br label %.loopexit

35:                                               ; preds = %17
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.11, i32 noundef %19) #7
  %36 = mul i32 %19, 1000
  tail call void @tb_delay_ms(i32 noundef %36) #7
  br label %.loopexit

37:                                               ; preds = %17
  %38 = tail call i32 @atoi(ptr nocapture noundef %.0131) #8
  %switch.selectcmp = icmp eq i32 %38, 2
  %switch.select = select i1 %switch.selectcmp, ptr @.str.14, ptr @.str.12
  %switch.selectcmp176 = icmp eq i32 %38, 1
  %switch.select177 = select i1 %switch.selectcmp176, ptr @.str.13, ptr %switch.select
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.15, i32 noundef %38, ptr noundef nonnull %switch.select177) #7
  %39 = trunc i32 %38 to i8
  %40 = tail call signext i16 @fs_format(i8 noundef zeroext %39) #7
  %41 = sext i16 %40 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.16, i32 noundef %41) #7
  br label %.loopexit

42:                                               ; preds = %17
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.17, ptr noundef nonnull %.0131) #7
  %43 = load i8, ptr %.0131, align 1, !tbaa !12
  %44 = icmp eq i8 %43, 126
  br i1 %44, label %45, label %46

45:                                               ; preds = %42
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.18) #7
  br label %46

46:                                               ; preds = %45, %42
  %.0133 = phi i8 [ 9, %45 ], [ 25, %42 ]
  %.2 = phi ptr [ %16, %45 ], [ %.0131, %42 ]
  %47 = tail call signext i16 @fs_open(ptr noundef nonnull @fs_desc, ptr noundef nonnull %.2, i8 noundef zeroext %.0133) #7
  %48 = sext i16 %47 to i32
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @fs_desc, i64 12), align 4, !tbaa !15
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.19, i32 noundef %48, i32 noundef %49) #7
  br label %.loopexit

50:                                               ; preds = %17
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.20, ptr noundef nonnull %.0131) #7
  %51 = load i8, ptr %.0131, align 1, !tbaa !12
  %52 = icmp eq i8 %51, 126
  br i1 %52, label %53, label %54

53:                                               ; preds = %50
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.18) #7
  br label %54

54:                                               ; preds = %53, %50
  %.1134 = phi i8 [ 6, %53 ], [ 22, %50 ]
  %.3 = phi ptr [ %16, %53 ], [ %.0131, %50 ]
  %55 = tail call signext i16 @fs_open(ptr noundef nonnull @fs_desc, ptr noundef nonnull %.3, i8 noundef zeroext %.1134) #7
  %56 = sext i16 %55 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.21, i32 noundef %56) #7
  br label %.loopexit

57:                                               ; preds = %17
  %58 = tail call signext i16 @fs_close(ptr noundef nonnull @fs_desc) #7
  %59 = sext i16 %58 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.22, i32 noundef %59) #7
  br label %.loopexit

60:                                               ; preds = %17
  %61 = tail call signext i16 @fs_delete(ptr noundef nonnull @fs_desc) #7
  %62 = sext i16 %61 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.23, i32 noundef %62) #7
  br label %.loopexit

63:                                               ; preds = %17
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.24) #7
  %64 = load i32, ptr getelementptr inbounds (i8, ptr @sflash_info, i64 4), align 4, !tbaa !5
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.3, i32 noundef %64) #7
  %65 = load i32, ptr getelementptr inbounds (i8, ptr @sflash_info, i64 8), align 4, !tbaa !17
  %66 = icmp eq i32 %65, -1
  br i1 %66, label %67, label %68

67:                                               ; preds = %63
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.25) #7
  br label %.loopexit

68:                                               ; preds = %63
  %69 = load i32, ptr getelementptr inbounds (i8, ptr @sflash_info, i64 16), align 4, !tbaa !18
  %70 = lshr i32 %69, 12
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.26, i32 noundef %69, i32 noundef %70) #7
  %71 = load i32, ptr getelementptr inbounds (i8, ptr @sflash_info, i64 8), align 4, !tbaa !17
  tail call void @conv_secs_to_date_sbuffer(i32 noundef %71)
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.27, ptr noundef nonnull @sbuffer) #7
  br label %72

72:                                               ; preds = %68, %100
  %.0139203 = phi i32 [ 0, %68 ], [ %101, %100 ]
  %73 = trunc i32 %.0139203 to i16
  %74 = tail call signext i16 @fs_info(ptr noundef nonnull @fs_stat, i16 noundef zeroext %73) #7
  %75 = sext i16 %74 to i32
  %76 = icmp slt i16 %74, 1
  br i1 %76, label %104, label %77

77:                                               ; preds = %72
  %78 = and i32 %75, 2
  %.not168 = icmp eq i32 %78, 0
  br i1 %.not168, label %80, label %79

79:                                               ; preds = %77
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.28, ptr noundef nonnull @fs_stat) #7
  br label %100

80:                                               ; preds = %77
  %81 = and i32 %75, 1
  %.not169 = icmp eq i32 %81, 0
  br i1 %.not169, label %100, label %82

82:                                               ; preds = %80
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.29, ptr noundef nonnull @fs_stat) #7
  %83 = and i32 %75, 4
  %.not170 = icmp eq i32 %83, 0
  br i1 %.not170, label %88, label %84

84:                                               ; preds = %82
  %85 = tail call signext i16 @fs_open(ptr noundef nonnull @fs_desc, ptr noundef nonnull @fs_stat, i8 noundef zeroext 9) #7
  %86 = tail call i32 @fs_read(ptr noundef nonnull @fs_desc, ptr noundef null, i32 noundef -1) #7
  %87 = tail call signext i16 @fs_close(ptr noundef nonnull @fs_desc) #7
  br label %88

88:                                               ; preds = %82, %84
  %.sink226 = phi ptr [ getelementptr inbounds (i8, ptr @fs_desc, i64 12), %84 ], [ getelementptr inbounds (i8, ptr @fs_stat, i64 28), %82 ]
  %.str.31.sink = phi ptr [ @.str.30, %84 ], [ @.str.31, %82 ]
  %89 = load i32, ptr %.sink226, align 4, !tbaa !19
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull %.str.31.sink, i32 noundef %89) #7
  %90 = load i8, ptr getelementptr inbounds (i8, ptr @fs_stat, i64 40), align 4, !tbaa !20
  %91 = and i8 %90, 16
  %.not171 = icmp eq i8 %91, 0
  br i1 %.not171, label %94, label %92

92:                                               ; preds = %88
  %93 = load i32, ptr getelementptr inbounds (i8, ptr @fs_stat, i64 32), align 4, !tbaa !22
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.32, i32 noundef %93) #7
  %.pre = load i8, ptr getelementptr inbounds (i8, ptr @fs_stat, i64 40), align 4, !tbaa !20
  br label %94

94:                                               ; preds = %92, %88
  %95 = phi i8 [ %.pre, %92 ], [ %90, %88 ]
  %96 = and i8 %95, 64
  %.not172 = icmp eq i8 %96, 0
  br i1 %.not172, label %98, label %97

97:                                               ; preds = %94
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.33) #7
  br label %98

98:                                               ; preds = %97, %94
  %99 = load i32, ptr getelementptr inbounds (i8, ptr @fs_stat, i64 24), align 4, !tbaa !23
  tail call void @conv_secs_to_date_sbuffer(i32 noundef %99)
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.34, ptr noundef nonnull @sbuffer) #7
  br label %100

100:                                              ; preds = %79, %98, %80
  %101 = add nuw nsw i32 %.0139203, 1
  %102 = load i16, ptr getelementptr inbounds (i8, ptr @sflash_info, i64 20), align 4, !tbaa !24
  %103 = zext i16 %102 to i32
  %.not167.not = icmp ult i32 %.0139203, %103
  br i1 %.not167.not, label %72, label %104, !llvm.loop !25

104:                                              ; preds = %72, %100
  %105 = load i16, ptr getelementptr inbounds (i8, ptr @sflash_info, i64 22), align 2, !tbaa !26
  %106 = zext i16 %105 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.35, i32 noundef %106) #7
  %107 = load i16, ptr getelementptr inbounds (i8, ptr @sflash_info, i64 20), align 4, !tbaa !24
  %108 = zext i16 %107 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.36, i32 noundef %108) #7
  %109 = load i16, ptr getelementptr inbounds (i8, ptr @sflash_info, i64 28), align 4, !tbaa !27
  %.not173 = icmp eq i16 %109, 0
  br i1 %.not173, label %112, label %110

110:                                              ; preds = %104
  %111 = zext i16 %109 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.37, i32 noundef %111) #7
  br label %112

112:                                              ; preds = %110, %104
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.21, i32 noundef %75) #7
  br label %.loopexit

113:                                              ; preds = %17
  %114 = tail call signext i16 @fs_check_disk(ptr noundef nonnull @tb_printf, ptr noundef nonnull @sbuffer, i32 noundef 10000) #7
  br label %.loopexit

vector.ph:                                        ; preds = %17
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.38, i32 noundef %19, i32 noundef 10000) #7
  br label %vector.body

vector.body:                                      ; preds = %vector.body.1, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next.1, %vector.body.1 ]
  %vec.ind = phi <16 x i16> [ <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, %vector.ph ], [ %vec.ind.next.1, %vector.body.1 ]
  %115 = urem <16 x i16> %vec.ind, <i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93>
  %116 = trunc nuw nsw <16 x i16> %115 to <16 x i8>
  %117 = add nuw nsw <16 x i8> %116, <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>
  %118 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %index
  store <16 x i8> %117, ptr %118, align 16, !tbaa !12
  %119 = icmp eq i64 %index, 9984
  br i1 %119, label %.preheader181, label %vector.body.1, !llvm.loop !28

vector.body.1:                                    ; preds = %vector.body
  %index.next = or disjoint i64 %index, 16
  %vec.ind.next = add <16 x i16> %vec.ind, <i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16>
  %120 = urem <16 x i16> %vec.ind.next, <i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93, i16 93>
  %121 = trunc nuw nsw <16 x i16> %120 to <16 x i8>
  %122 = add nuw nsw <16 x i8> %121, <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>
  %123 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %index.next
  store <16 x i8> %122, ptr %123, align 16, !tbaa !12
  %index.next.1 = add nuw nsw i64 %index, 32
  %vec.ind.next.1 = add <16 x i16> %vec.ind, <i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32>
  br label %vector.body

.preheader181:                                    ; preds = %vector.body
  %124 = icmp sgt i32 %19, 0
  br i1 %124, label %.lr.ph201, label %.loopexit

.lr.ph201:                                        ; preds = %.preheader181, %.lr.ph201
  %.0136200 = phi i32 [ %128, %.lr.ph201 ], [ %19, %.preheader181 ]
  %spec.store.select = tail call i32 @llvm.umin.i32(i32 %.0136200, i32 10000)
  %125 = tail call signext i16 @fs_write(ptr noundef nonnull @fs_desc, ptr noundef nonnull @sbuffer, i32 noundef %spec.store.select) #7
  %126 = sext i16 %125 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.39, i32 noundef %spec.store.select, i32 noundef %.0136200, i32 noundef %126) #7
  %127 = icmp sgt i16 %125, -1
  %128 = sub nsw i32 %.0136200, %spec.store.select
  %129 = icmp sgt i32 %128, 0
  %or.cond204 = select i1 %127, i1 %129, i1 false
  br i1 %or.cond204, label %.lr.ph201, label %.loopexit, !llvm.loop !31

130:                                              ; preds = %17
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.40, ptr noundef nonnull %.0131) #7
  %131 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.0131) #8
  %132 = trunc i64 %131 to i32
  %133 = tail call signext i16 @fs_write(ptr noundef nonnull @fs_desc, ptr noundef nonnull %.0131, i32 noundef %132) #7
  %134 = sext i16 %133 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.21, i32 noundef %134) #7
  br label %.loopexit

135:                                              ; preds = %17
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.41, i32 noundef %19) #7
  %136 = icmp slt i32 %19, 10000
  br i1 %136, label %137, label %145

137:                                              ; preds = %135
  %138 = tail call i32 @fs_read(ptr noundef nonnull @fs_desc, ptr noundef nonnull @sbuffer, i32 noundef %19) #7
  %139 = icmp sgt i32 %138, 0
  br i1 %139, label %.preheader182.preheader, label %147

.preheader182.preheader:                          ; preds = %137
  %wide.trip.count = zext nneg i32 %138 to i64
  br label %.preheader182

140:                                              ; preds = %.preheader182
  %indvars.iv.next214 = add nuw nsw i64 %indvars.iv213, 1
  %exitcond217.not = icmp eq i64 %indvars.iv.next214, %wide.trip.count
  br i1 %exitcond217.not, label %.loopexit183, label %.preheader182, !llvm.loop !32

.preheader182:                                    ; preds = %.preheader182.preheader, %140
  %indvars.iv213 = phi i64 [ 0, %.preheader182.preheader ], [ %indvars.iv.next214, %140 ]
  %141 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %indvars.iv213
  %142 = load i8, ptr %141, align 1, !tbaa !12
  %143 = zext i8 %142 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %143) #7
  %exitcond216 = icmp eq i64 %indvars.iv213, 61
  br i1 %exitcond216, label %144, label %140

144:                                              ; preds = %.preheader182
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.43) #7
  br label %.loopexit183

.loopexit183:                                     ; preds = %140, %144
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.44) #7
  br label %147

145:                                              ; preds = %135
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.45, i32 noundef %19) #7
  %146 = tail call i32 @fs_read(ptr noundef nonnull @fs_desc, ptr noundef null, i32 noundef %19) #7
  br label %147

147:                                              ; preds = %137, %.loopexit183, %145
  %.2145 = phi i32 [ %138, %.loopexit183 ], [ %138, %137 ], [ %146, %145 ]
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.46, i32 noundef %19, i32 noundef %.2145) #7
  br label %.loopexit

148:                                              ; preds = %17
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.47, i32 noundef %19, i32 noundef 10000) #7
  %149 = icmp sgt i32 %19, 0
  br i1 %149, label %.lr.ph193, label %._crit_edge

.lr.ph193:                                        ; preds = %148, %152
  %.1137192 = phi i32 [ %153, %152 ], [ %19, %148 ]
  %.0138191 = phi i32 [ %154, %152 ], [ 0, %148 ]
  %spec.store.select1 = tail call i32 @llvm.umin.i32(i32 %.1137192, i32 10000)
  %150 = tail call i32 @fs_read(ptr noundef nonnull @fs_desc, ptr noundef nonnull @sbuffer, i32 noundef %spec.store.select1) #7
  %151 = icmp slt i32 %150, 1
  br i1 %151, label %._crit_edge, label %152

152:                                              ; preds = %.lr.ph193
  %153 = sub nsw i32 %.1137192, %spec.store.select1
  %154 = add nuw nsw i32 %150, %.0138191
  %155 = icmp sgt i32 %153, 0
  br i1 %155, label %.lr.ph193, label %._crit_edge, !llvm.loop !33

._crit_edge:                                      ; preds = %152, %.lr.ph193, %148
  %.0138.lcssa = phi i32 [ 0, %148 ], [ %.0138191, %.lr.ph193 ], [ %154, %152 ]
  %.4147 = phi i32 [ %9, %148 ], [ %150, %.lr.ph193 ], [ %150, %152 ]
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.48, i32 noundef %.0138.lcssa, i32 noundef %.4147) #7
  br label %.loopexit

156:                                              ; preds = %17
  %157 = tail call signext i16 @fs_rewind(ptr noundef nonnull @fs_desc) #7
  %158 = sext i16 %157 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.49, i32 noundef %158) #7
  br label %.loopexit

159:                                              ; preds = %17
  %160 = load i32, ptr getelementptr inbounds (i8, ptr @fs_desc, i64 8), align 4, !tbaa !34
  %161 = load i32, ptr getelementptr inbounds (i8, ptr @fs_desc, i64 12), align 4, !tbaa !15
  %162 = load i32, ptr getelementptr inbounds (i8, ptr @fs_desc, i64 16), align 4, !tbaa !35
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.50, i32 noundef %160, i32 noundef %161, i32 noundef %162) #7
  br label %.loopexit

163:                                              ; preds = %17
  %164 = tail call i32 @fs_get_crc32(ptr noundef nonnull @fs_desc) #7
  %165 = load i32, ptr getelementptr inbounds (i8, ptr @fs_desc, i64 16), align 4, !tbaa !35
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.51, i32 noundef %164, i32 noundef %165) #7
  br label %.loopexit

166:                                              ; preds = %17
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.52, ptr noundef nonnull %.0131) #7
  %167 = load i8, ptr getelementptr inbounds (i8, ptr @fs_desc, i64 26), align 2, !tbaa !36
  %168 = and i8 %167, 16
  %spec.select = or disjoint i8 %168, 6
  %169 = tail call signext i16 @fs_open(ptr noundef nonnull @fs_desc_b, ptr noundef nonnull %.0131, i8 noundef zeroext %spec.select) #7
  %.not166 = icmp eq i16 %169, 0
  br i1 %.not166, label %170, label %172

170:                                              ; preds = %166
  %171 = tail call signext i16 @fs_rename(ptr noundef nonnull @fs_desc, ptr noundef nonnull @fs_desc_b) #7
  br label %172

172:                                              ; preds = %170, %166
  %.5148.in = phi i16 [ %169, %166 ], [ %171, %170 ]
  %.5148 = sext i16 %.5148.in to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.53, i32 noundef %.5148) #7
  br label %.loopexit

173:                                              ; preds = %17
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.54) #7
  tail call void @tb_delay_ms(i32 noundef 1000) #7
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.55) #7
  tail call void @tb_system_reset() #7
  br label %174

174:                                              ; preds = %173, %17
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.56, i32 noundef %19) #7
  %.not205 = icmp eq i32 %19, 0
  br i1 %.not205, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %174, %.lr.ph
  %.4190 = phi i32 [ %175, %.lr.ph ], [ 0, %174 ]
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.57, i32 noundef %.4190) #7
  tail call void @tb_delay_ms(i32 noundef 1000) #7
  %175 = add nuw i32 %.4190, 1
  %exitcond212.not = icmp eq i32 %175, %19
  br i1 %exitcond212.not, label %.loopexit, label %.lr.ph, !llvm.loop !37

176:                                              ; preds = %17
  %.not163 = icmp eq i32 %19, 0
  br i1 %.not163, label %181, label %177

177:                                              ; preds = %176
  %178 = icmp ult i32 %19, 32
  br i1 %178, label %179, label %.thread

179:                                              ; preds = %177
  %180 = tail call i32 @conv_tstr_to_secs(ptr noundef nonnull %.0131)
  %.not164 = icmp eq i32 %180, 0
  br i1 %.not164, label %181, label %.thread

.thread:                                          ; preds = %177, %179
  %.0135180 = phi i32 [ %180, %179 ], [ %19, %177 ]
  tail call void @tb_time_set(i32 noundef %.0135180) #7
  br label %181

181:                                              ; preds = %179, %.thread, %176
  %182 = tail call i32 @tb_time_get() #7
  tail call void @conv_secs_to_date_sbuffer(i32 noundef %182)
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.58, ptr noundef nonnull @sbuffer, i32 noundef %182) #7
  br label %.loopexit

183:                                              ; preds = %17
  %184 = tail call i64 @strtol(ptr nocapture noundef nonnull %.0131, ptr noundef null, i32 noundef 16) #7
  %185 = trunc i64 %184 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.59, i32 noundef %185) #7
  tail call void @sflash_read(i32 noundef %185, ptr noundef nonnull @sbuffer, i16 noundef zeroext 256) #7
  br label %.preheader.preheader

.preheader.preheader:                             ; preds = %183, %.preheader.preheader
  %indvars.iv = phi i64 [ 0, %183 ], [ %indvars.iv.next, %.preheader.preheader ]
  %186 = shl nuw nsw i64 %indvars.iv, 4
  %187 = add i64 %186, %184
  %188 = trunc i64 %187 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.60, i32 noundef %188) #7
  %189 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %186
  %190 = load i8, ptr %189, align 16, !tbaa !12
  %191 = zext i8 %190 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %191) #7
  %192 = or disjoint i64 %186, 1
  %193 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %192
  %194 = load i8, ptr %193, align 1, !tbaa !12
  %195 = zext i8 %194 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %195) #7
  %196 = or disjoint i64 %186, 2
  %197 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %196
  %198 = load i8, ptr %197, align 2, !tbaa !12
  %199 = zext i8 %198 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %199) #7
  %200 = or disjoint i64 %186, 3
  %201 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %200
  %202 = load i8, ptr %201, align 1, !tbaa !12
  %203 = zext i8 %202 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %203) #7
  %204 = or disjoint i64 %186, 4
  %205 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %204
  %206 = load i8, ptr %205, align 4, !tbaa !12
  %207 = zext i8 %206 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %207) #7
  %208 = or disjoint i64 %186, 5
  %209 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %208
  %210 = load i8, ptr %209, align 1, !tbaa !12
  %211 = zext i8 %210 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %211) #7
  %212 = or disjoint i64 %186, 6
  %213 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %212
  %214 = load i8, ptr %213, align 2, !tbaa !12
  %215 = zext i8 %214 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %215) #7
  %216 = or disjoint i64 %186, 7
  %217 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %216
  %218 = load i8, ptr %217, align 1, !tbaa !12
  %219 = zext i8 %218 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %219) #7
  %220 = or disjoint i64 %186, 8
  %221 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %220
  %222 = load i8, ptr %221, align 8, !tbaa !12
  %223 = zext i8 %222 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %223) #7
  %224 = or disjoint i64 %186, 9
  %225 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %224
  %226 = load i8, ptr %225, align 1, !tbaa !12
  %227 = zext i8 %226 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %227) #7
  %228 = or disjoint i64 %186, 10
  %229 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %228
  %230 = load i8, ptr %229, align 2, !tbaa !12
  %231 = zext i8 %230 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %231) #7
  %232 = or disjoint i64 %186, 11
  %233 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %232
  %234 = load i8, ptr %233, align 1, !tbaa !12
  %235 = zext i8 %234 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %235) #7
  %236 = or disjoint i64 %186, 12
  %237 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %236
  %238 = load i8, ptr %237, align 4, !tbaa !12
  %239 = zext i8 %238 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %239) #7
  %240 = or disjoint i64 %186, 13
  %241 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %240
  %242 = load i8, ptr %241, align 1, !tbaa !12
  %243 = zext i8 %242 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %243) #7
  %244 = or disjoint i64 %186, 14
  %245 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %244
  %246 = load i8, ptr %245, align 2, !tbaa !12
  %247 = zext i8 %246 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %247) #7
  %248 = or disjoint i64 %186, 15
  %249 = getelementptr inbounds [10000 x i8], ptr @sbuffer, i64 0, i64 %248
  %250 = load i8, ptr %249, align 1, !tbaa !12
  %251 = zext i8 %250 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.61, i32 noundef %251) #7
  %252 = load i8, ptr %189, align 16, !tbaa !12
  %or.cond = icmp slt i8 %252, 32
  %narrow = select i1 %or.cond, i8 46, i8 %252
  %spec.store.select3 = zext i8 %narrow to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3) #7
  %253 = load i8, ptr %193, align 1, !tbaa !12
  %or.cond.1 = icmp slt i8 %253, 32
  %narrow.1 = select i1 %or.cond.1, i8 46, i8 %253
  %spec.store.select3.1 = zext i8 %narrow.1 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.1) #7
  %254 = load i8, ptr %197, align 2, !tbaa !12
  %or.cond.2 = icmp slt i8 %254, 32
  %narrow.2 = select i1 %or.cond.2, i8 46, i8 %254
  %spec.store.select3.2 = zext i8 %narrow.2 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.2) #7
  %255 = load i8, ptr %201, align 1, !tbaa !12
  %or.cond.3 = icmp slt i8 %255, 32
  %narrow.3 = select i1 %or.cond.3, i8 46, i8 %255
  %spec.store.select3.3 = zext i8 %narrow.3 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.3) #7
  %256 = load i8, ptr %205, align 4, !tbaa !12
  %or.cond.4 = icmp slt i8 %256, 32
  %narrow.4 = select i1 %or.cond.4, i8 46, i8 %256
  %spec.store.select3.4 = zext i8 %narrow.4 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.4) #7
  %257 = load i8, ptr %209, align 1, !tbaa !12
  %or.cond.5 = icmp slt i8 %257, 32
  %narrow.5 = select i1 %or.cond.5, i8 46, i8 %257
  %spec.store.select3.5 = zext i8 %narrow.5 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.5) #7
  %258 = load i8, ptr %213, align 2, !tbaa !12
  %or.cond.6 = icmp slt i8 %258, 32
  %narrow.6 = select i1 %or.cond.6, i8 46, i8 %258
  %spec.store.select3.6 = zext i8 %narrow.6 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.6) #7
  %259 = load i8, ptr %217, align 1, !tbaa !12
  %or.cond.7 = icmp slt i8 %259, 32
  %narrow.7 = select i1 %or.cond.7, i8 46, i8 %259
  %spec.store.select3.7 = zext i8 %narrow.7 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.7) #7
  %260 = load i8, ptr %221, align 8, !tbaa !12
  %or.cond.8 = icmp slt i8 %260, 32
  %narrow.8 = select i1 %or.cond.8, i8 46, i8 %260
  %spec.store.select3.8 = zext i8 %narrow.8 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.8) #7
  %261 = load i8, ptr %225, align 1, !tbaa !12
  %or.cond.9 = icmp slt i8 %261, 32
  %narrow.9 = select i1 %or.cond.9, i8 46, i8 %261
  %spec.store.select3.9 = zext i8 %narrow.9 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.9) #7
  %262 = load i8, ptr %229, align 2, !tbaa !12
  %or.cond.10 = icmp slt i8 %262, 32
  %narrow.10 = select i1 %or.cond.10, i8 46, i8 %262
  %spec.store.select3.10 = zext i8 %narrow.10 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.10) #7
  %263 = load i8, ptr %233, align 1, !tbaa !12
  %or.cond.11 = icmp slt i8 %263, 32
  %narrow.11 = select i1 %or.cond.11, i8 46, i8 %263
  %spec.store.select3.11 = zext i8 %narrow.11 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.11) #7
  %264 = load i8, ptr %237, align 4, !tbaa !12
  %or.cond.12 = icmp slt i8 %264, 32
  %narrow.12 = select i1 %or.cond.12, i8 46, i8 %264
  %spec.store.select3.12 = zext i8 %narrow.12 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.12) #7
  %265 = load i8, ptr %241, align 1, !tbaa !12
  %or.cond.13 = icmp slt i8 %265, 32
  %narrow.13 = select i1 %or.cond.13, i8 46, i8 %265
  %spec.store.select3.13 = zext i8 %narrow.13 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.13) #7
  %266 = load i8, ptr %245, align 2, !tbaa !12
  %or.cond.14 = icmp slt i8 %266, 32
  %narrow.14 = select i1 %or.cond.14, i8 46, i8 %266
  %spec.store.select3.14 = zext i8 %narrow.14 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.14) #7
  %267 = load i8, ptr %249, align 1, !tbaa !12
  %or.cond.15 = icmp slt i8 %267, 32
  %narrow.15 = select i1 %or.cond.15, i8 46, i8 %267
  %spec.store.select3.15 = zext i8 %narrow.15 to i32
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.42, i32 noundef %spec.store.select3.15) #7
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.44) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 16
  br i1 %exitcond.not, label %.loopexit, label %.preheader.preheader, !llvm.loop !38

268:                                              ; preds = %17
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.62) #7
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader.preheader, %.lr.ph, %.lr.ph201, %174, %.preheader181, %29, %268, %181, %172, %163, %159, %156, %._crit_edge, %147, %130, %113, %112, %67, %60, %57, %54, %46, %37, %35, %32
  %269 = tail call i32 @tb_get_ticks() #7
  %270 = tail call i32 @tb_deltaticks_to_ms(i32 noundef %20, i32 noundef %269) #7
  tail call void (ptr, ...) @tb_printf(ptr noundef nonnull @.str.63, i32 noundef %270) #7
  br label %.backedge
}

declare void @tb_init() local_unnamed_addr #0

declare i32 @tb_watchdog_init() local_unnamed_addr #0

declare void @tb_printf(ptr noundef, ...) #0

declare signext i16 @fs_start(i8 noundef zeroext) local_unnamed_addr #0

declare void @tb_board_led_on(i8 noundef zeroext) local_unnamed_addr #0

declare signext i16 @tb_gets(ptr noundef, i16 noundef signext, i16 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #0

declare signext i16 @tb_putc(i8 noundef signext) local_unnamed_addr #0

declare void @tb_watchdog_feed(i32 noundef) local_unnamed_addr #0

declare void @tb_board_led_off(i8 noundef zeroext) local_unnamed_addr #0

declare void @tb_uninit() local_unnamed_addr #0

declare void @tb_delay_ms(i32 noundef) local_unnamed_addr #0

declare i32 @tb_get_ticks() local_unnamed_addr #0

declare signext i16 @fs_deepsleep() local_unnamed_addr #0

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

declare signext i16 @fs_format(i8 noundef zeroext) local_unnamed_addr #0

declare signext i16 @fs_open(ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #0

declare signext i16 @fs_close(ptr noundef) local_unnamed_addr #0

declare signext i16 @fs_delete(ptr noundef) local_unnamed_addr #0

declare signext i16 @fs_info(ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

declare i32 @fs_read(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare signext i16 @fs_check_disk(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare signext i16 @fs_write(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

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

declare signext i16 @fs_rewind(ptr noundef) local_unnamed_addr #0

declare i32 @fs_get_crc32(ptr noundef) local_unnamed_addr #0

declare signext i16 @fs_rename(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @tb_system_reset() local_unnamed_addr #0

declare void @tb_time_set(i32 noundef) local_unnamed_addr #0

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

declare void @sflash_read(i32 noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

declare i32 @tb_deltaticks_to_ms(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #6

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { noreturn nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 4}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 20, !10, i64 22, !10, i64 24, !10, i64 26, !10, i64 28, !8, i64 32, !8, i64 160}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!8, !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !7, i64 12}
!16 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !10, i64 24, !8, i64 26}
!17 = !{!6, !7, i64 8}
!18 = !{!6, !7, i64 16}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !8, i64 40}
!21 = !{!"", !8, i64 0, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !8, i64 40}
!22 = !{!21, !7, i64 32}
!23 = !{!21, !7, i64 24}
!24 = !{!6, !10, i64 20}
!25 = distinct !{!25, !14}
!26 = !{!6, !10, i64 22}
!27 = !{!6, !10, i64 28}
!28 = distinct !{!28, !14, !29, !30}
!29 = !{!"llvm.loop.isvectorized", i32 1}
!30 = !{!"llvm.loop.unroll.runtime.disable"}
!31 = distinct !{!31, !14}
!32 = distinct !{!32, !14}
!33 = distinct !{!33, !14}
!34 = !{!16, !7, i64 8}
!35 = !{!16, !7, i64 16}
!36 = !{!16, !8, i64 26}
!37 = distinct !{!37, !14}
!38 = distinct !{!38, !14}


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