; LLVM IR from cpq/bare-metal-programming-guide :: steps/step-7-webserver/ek-tm4c1294xl (net)

; 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.config = type { ptr, ptr, ptr }
%struct.mg_fs = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.mg_str = type { ptr, i64 }
%struct.mg_http_serve_opts = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.mg_connection = type { ptr, ptr, %struct.mg_addr, %struct.mg_addr, ptr, i64, %struct.mg_iobuf, %struct.mg_iobuf, ptr, ptr, ptr, ptr, [50 x i8], ptr, i32 }
%struct.mg_addr = type { i16, i32, [16 x i8], i8 }
%struct.mg_iobuf = type { ptr, i64, i64, i64 }
%struct.mg_http_message = type { %struct.mg_str, %struct.mg_str, %struct.mg_str, %struct.mg_str, [30 x %struct.mg_http_header], %struct.mg_str, %struct.mg_str, %struct.mg_str, %struct.mg_str }
%struct.mg_http_header = type { %struct.mg_str, %struct.mg_str }
%struct.user = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@s_config = external hidden global %struct.config, align 8
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [10 x i8], align 1
@s_connected = external hidden global i8, align 1
@.str.17 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [6 x i8], align 1
@s_mqtt = external hidden global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [10 x i8], align 1
@mg_fs_packed = external global %struct.mg_fs, align 8
@.str.34 = external hidden unnamed_addr constant [109 x i8], align 1
@__func__.device_dashboard_fn = external hidden unnamed_addr constant [20 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [22 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @device_dashboard_fn(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca [256 x i8], align 16
  %13 = alloca %struct.mg_str, align 8
  %14 = alloca %struct.mg_str, align 8
  %15 = alloca %struct.mg_http_serve_opts, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %16 = load i32, ptr %6, align 4, !tbaa !9
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %18, label %49

18:                                               ; preds = %4
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.mg_connection, ptr %19, i32 0, i32 14
  %21 = load i32, ptr %20, align 8
  %22 = and i32 %21, 1
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %49

24:                                               ; preds = %18
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.mg_connection, ptr %25, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.mg_connection, ptr %28, i32 0, i32 1
  %30 = load ptr, ptr %29, align 8, !tbaa !11
  %31 = call ptr @mg_timer_add(ptr noundef %27, i64 noundef 1000, i32 noundef 1, ptr noundef @timer_metrics_fn, ptr noundef %30)
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.mg_connection, ptr %32, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.mg_connection, ptr %35, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = call ptr @mg_timer_add(ptr noundef %34, i64 noundef 1000, i32 noundef 1, ptr noundef @timer_mqtt_fn, ptr noundef %37)
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.mg_connection, ptr %39, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !11
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.mg_connection, ptr %42, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = call ptr @mg_timer_add(ptr noundef %41, i64 noundef 1000, i32 noundef 1, ptr noundef @timer_sntp_fn, ptr noundef %44)
  %46 = call noalias ptr @strdup(ptr noundef @.str) #6
  store ptr %46, ptr @s_config, align 8, !tbaa !18
  %47 = call noalias ptr @strdup(ptr noundef @.str.1) #6
  store ptr %47, ptr getelementptr inbounds (%struct.config, ptr @s_config, i32 0, i32 1), align 8, !tbaa !20
  %48 = call noalias ptr @strdup(ptr noundef @.str.2) #6
  store ptr %48, ptr getelementptr inbounds (%struct.config, ptr @s_config, i32 0, i32 2), align 8, !tbaa !21
  br label %227

49:                                               ; preds = %18, %4
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = icmp eq i32 %50, 10
  br i1 %51, label %52, label %226

52:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %53, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = call ptr @getuser(ptr noundef %54)
  store ptr %55, ptr %10, align 8, !tbaa !5
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = call zeroext i1 @mg_http_match_uri(ptr noundef %56, ptr noundef @.str.3)
  br i1 %57, label %58, label %60

58:                                               ; preds = %52
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %59, i32 noundef 200, ptr noundef @.str.4, ptr noundef @.str.5)
  br label %193

60:                                               ; preds = %52
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = call zeroext i1 @mg_http_match_uri(ptr noundef %61, ptr noundef @.str.6)
  br i1 %62, label %63, label %75

63:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.mg_http_message, ptr %64, i32 0, i32 5
  %66 = getelementptr inbounds { ptr, i64 }, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8
  %68 = getelementptr inbounds { ptr, i64 }, ptr %65, i32 0, i32 1
  %69 = load i64, ptr %68, align 8
  %70 = call i64 @mg_json_get_long(ptr %67, i64 %69, ptr noundef @.str.7, i64 noundef 3)
  %71 = trunc i64 %70 to i32
  store i32 %71, ptr %11, align 4, !tbaa !9
  %72 = load i32, ptr %11, align 4, !tbaa !9
  call void @mg_log_set(i32 noundef %72)
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = load i32, ptr %11, align 4, !tbaa !9
  call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %73, i32 noundef 200, ptr noundef @.str.4, ptr noundef @.str.8, i32 noundef %74)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %192

75:                                               ; preds = %60
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = icmp eq ptr %76, null
  br i1 %77, label %78, label %83

78:                                               ; preds = %75
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = call zeroext i1 @mg_http_match_uri(ptr noundef %79, ptr noundef @.str.9)
  br i1 %80, label %81, label %83

81:                                               ; preds = %78
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %82, i32 noundef 403, ptr noundef @.str.4, ptr noundef @.str.10)
  br label %191

83:                                               ; preds = %78, %75
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = call zeroext i1 @mg_http_match_uri(ptr noundef %84, ptr noundef @.str.11)
  br i1 %85, label %86, label %95

86:                                               ; preds = %83
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = load ptr, ptr @s_config, align 8, !tbaa !18
  %89 = load ptr, ptr getelementptr inbounds (%struct.config, ptr @s_config, i32 0, i32 1), align 8, !tbaa !20
  %90 = load ptr, ptr getelementptr inbounds (%struct.config, ptr @s_config, i32 0, i32 2), align 8, !tbaa !21
  %91 = load i8, ptr @s_connected, align 1, !tbaa !22, !range !23, !noundef !24
  %92 = trunc i8 %91 to i1
  %93 = zext i1 %92 to i64
  %94 = select i1 %92, ptr @.str.17, ptr @.str.18
  call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %87, i32 noundef 200, ptr noundef null, ptr noundef @.str.12, ptr noundef @.str.13, ptr noundef %88, ptr noundef @.str.14, ptr noundef %89, ptr noundef @.str.15, ptr noundef %90, ptr noundef @.str.16, ptr noundef %94)
  br label %190

95:                                               ; preds = %83
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = call zeroext i1 @mg_http_match_uri(ptr noundef %96, ptr noundef @.str.19)
  br i1 %97, label %98, label %125

98:                                               ; preds = %95
  %99 = load ptr, ptr %10, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.user, ptr %99, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8, !tbaa !25
  %102 = call i32 @strcmp(ptr noundef %101, ptr noundef @.str.20) #7
  %103 = icmp eq i32 %102, 0
  br i1 %103, label %104, label %122

104:                                              ; preds = %98
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.mg_http_message, ptr %105, i32 0, i32 5
  call void @update_config(ptr noundef %106, ptr noundef @.str.13, ptr noundef @s_config)
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.mg_http_message, ptr %107, i32 0, i32 5
  call void @update_config(ptr noundef %108, ptr noundef @.str.14, ptr noundef getelementptr inbounds (%struct.config, ptr @s_config, i32 0, i32 1))
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.mg_http_message, ptr %109, i32 0, i32 5
  call void @update_config(ptr noundef %110, ptr noundef @.str.15, ptr noundef getelementptr inbounds (%struct.config, ptr @s_config, i32 0, i32 2))
  %111 = load ptr, ptr @s_mqtt, align 8, !tbaa !5
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %119

113:                                              ; preds = %104
  %114 = load ptr, ptr @s_mqtt, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.mg_connection, ptr %114, i32 0, i32 14
  %116 = load i32, ptr %115, align 8
  %117 = and i32 %116, -4097
  %118 = or i32 %117, 4096
  store i32 %118, ptr %115, align 8
  br label %119

119:                                              ; preds = %113, %104
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  call void (ptr, ptr, ...) @send_notification(ptr noundef %120, ptr noundef @.str.21, ptr noundef @.str.22, ptr noundef @.str.23, ptr noundef @.str.24)
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %121, i32 noundef 200, ptr noundef @.str.4, ptr noundef @.str.25)
  br label %124

122:                                              ; preds = %98
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %123, i32 noundef 403, ptr noundef @.str.4, ptr noundef @.str.10)
  br label %124

124:                                              ; preds = %122, %119
  br label %189

125:                                              ; preds = %95
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = call zeroext i1 @mg_http_match_uri(ptr noundef %126, ptr noundef @.str.26)
  br i1 %127, label %128, label %161

128:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 256, ptr %12) #6
  %129 = load i8, ptr @s_connected, align 1, !tbaa !22, !range !23, !noundef !24
  %130 = trunc i8 %129 to i1
  br i1 %130, label %131, label %159

131:                                              ; preds = %128
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.mg_http_message, ptr %132, i32 0, i32 5
  %134 = getelementptr inbounds [256 x i8], ptr %12, i64 0, i64 0
  %135 = call i32 @mg_http_get_var(ptr noundef %133, ptr noundef @.str.27, ptr noundef %134, i64 noundef 256)
  %136 = icmp sgt i32 %135, 0
  br i1 %136, label %137, label %159

137:                                              ; preds = %131
  %138 = load ptr, ptr @s_mqtt, align 8, !tbaa !5
  %139 = load ptr, ptr getelementptr inbounds (%struct.config, ptr @s_config, i32 0, i32 1), align 8, !tbaa !20
  %140 = call { ptr, i64 } @mg_str_s(ptr noundef %139)
  %141 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 0
  %142 = extractvalue { ptr, i64 } %140, 0
  store ptr %142, ptr %141, align 8
  %143 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 1
  %144 = extractvalue { ptr, i64 } %140, 1
  store i64 %144, ptr %143, align 8
  %145 = getelementptr inbounds [256 x i8], ptr %12, i64 0, i64 0
  %146 = call { ptr, i64 } @mg_str_s(ptr noundef %145)
  %147 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 0
  %148 = extractvalue { ptr, i64 } %146, 0
  store ptr %148, ptr %147, align 8
  %149 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 1
  %150 = extractvalue { ptr, i64 } %146, 1
  store i64 %150, ptr %149, align 8
  %151 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8
  %153 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 1
  %154 = load i64, ptr %153, align 8
  %155 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 0
  %156 = load ptr, ptr %155, align 8
  %157 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 1
  %158 = load i64, ptr %157, align 8
  call void @mg_mqtt_pub(ptr noundef %138, ptr %152, i64 %154, ptr %156, i64 %158, i32 noundef 1, i1 noundef zeroext false)
  br label %159

159:                                              ; preds = %137, %131, %128
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %160, i32 noundef 200, ptr noundef @.str.4, ptr noundef @.str.25)
  call void @llvm.lifetime.end.p0(i64 256, ptr %12) #6
  br label %188

161:                                              ; preds = %125
  %162 = load ptr, ptr %9, align 8, !tbaa !5
  %163 = call zeroext i1 @mg_http_match_uri(ptr noundef %162, ptr noundef @.str.28)
  br i1 %163, label %164, label %170

164:                                              ; preds = %161
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.mg_connection, ptr %165, i32 0, i32 12
  %167 = getelementptr inbounds [50 x i8], ptr %166, i64 0, i64 0
  store i8 87, ptr %167, align 8, !tbaa !27
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = load ptr, ptr %9, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @mg_ws_upgrade(ptr noundef %168, ptr noundef %169, ptr noundef null)
  br label %187

170:                                              ; preds = %161
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  %172 = call zeroext i1 @mg_http_match_uri(ptr noundef %171, ptr noundef @.str.29)
  br i1 %172, label %173, label %181

173:                                              ; preds = %170
  %174 = load ptr, ptr %5, align 8, !tbaa !5
  %175 = load ptr, ptr %10, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.user, ptr %175, i32 0, i32 0
  %177 = load ptr, ptr %176, align 8, !tbaa !25
  %178 = load ptr, ptr %10, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.user, ptr %178, i32 0, i32 2
  %180 = load ptr, ptr %179, align 8, !tbaa !28
  call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %174, i32 noundef 200, ptr noundef null, ptr noundef @.str.30, ptr noundef @.str.31, ptr noundef %177, ptr noundef @.str.32, ptr noundef %180)
  br label %186

181:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 48, ptr %15) #6
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 48, i1 false)
  %182 = getelementptr inbounds %struct.mg_http_serve_opts, ptr %15, i32 0, i32 0
  store ptr @.str.33, ptr %182, align 8, !tbaa !29
  %183 = getelementptr inbounds %struct.mg_http_serve_opts, ptr %15, i32 0, i32 5
  store ptr @mg_fs_packed, ptr %183, align 8, !tbaa !31
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  %185 = load ptr, ptr %7, align 8, !tbaa !5
  call void @mg_http_serve_dir(ptr noundef %184, ptr noundef %185, ptr noundef %15)
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #6
  br label %186

186:                                              ; preds = %181, %173
  br label %187

187:                                              ; preds = %186, %164
  br label %188

188:                                              ; preds = %187, %159
  br label %189

189:                                              ; preds = %188, %124
  br label %190

190:                                              ; preds = %189, %86
  br label %191

191:                                              ; preds = %190, %81
  br label %192

192:                                              ; preds = %191, %63
  br label %193

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

194:                                              ; preds = %193
  %195 = call zeroext i1 @mg_log_prefix(i32 noundef 3, ptr noundef @.str.34, i32 noundef 223, ptr noundef @__func__.device_dashboard_fn)
  br i1 %195, label %196, label %223

196:                                              ; preds = %194
  %197 = load ptr, ptr %5, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.mg_connection, ptr %197, i32 0, i32 5
  %199 = load i64, ptr %198, align 8, !tbaa !32
  %200 = load ptr, ptr %9, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.mg_http_message, ptr %200, i32 0, i32 0
  %202 = getelementptr inbounds %struct.mg_str, ptr %201, i32 0, i32 1
  %203 = load i64, ptr %202, align 8, !tbaa !33
  %204 = trunc i64 %203 to i32
  %205 = load ptr, ptr %9, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.mg_http_message, ptr %205, i32 0, i32 0
  %207 = getelementptr inbounds %struct.mg_str, ptr %206, i32 0, i32 0
  %208 = load ptr, ptr %207, align 8, !tbaa !36
  %209 = load ptr, ptr %9, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.mg_http_message, ptr %209, i32 0, i32 1
  %211 = getelementptr inbounds %struct.mg_str, ptr %210, i32 0, i32 1
  %212 = load i64, ptr %211, align 8, !tbaa !37
  %213 = trunc i64 %212 to i32
  %214 = load ptr, ptr %9, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.mg_http_message, ptr %214, i32 0, i32 1
  %216 = getelementptr inbounds %struct.mg_str, ptr %215, i32 0, i32 0
  %217 = load ptr, ptr %216, align 8, !tbaa !38
  %218 = load ptr, ptr %5, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.mg_connection, ptr %218, i32 0, i32 7
  %220 = getelementptr inbounds %struct.mg_iobuf, ptr %219, i32 0, i32 0
  %221 = load ptr, ptr %220, align 8, !tbaa !39
  %222 = getelementptr inbounds i8, ptr %221, i64 9
  call void (ptr, ...) @mg_log(ptr noundef @.str.35, i64 noundef %199, i32 noundef %204, ptr noundef %208, i32 noundef %213, ptr noundef %217, i32 noundef 3, ptr noundef %222)
  br label %223

223:                                              ; preds = %196, %194
  br label %224

224:                                              ; preds = %223
  br label %225

225:                                              ; preds = %224
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %226

226:                                              ; preds = %225, %49
  br label %227

227:                                              ; preds = %226, %24
  ret void
}

declare ptr @mg_timer_add(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @timer_metrics_fn(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @timer_mqtt_fn(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @timer_sntp_fn(ptr noundef) #1

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @getuser(ptr noundef) #1

declare zeroext i1 @mg_http_match_uri(ptr noundef, ptr noundef) #2

declare void @mg_http_reply(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #2

declare i64 @mg_json_get_long(ptr, i64, ptr noundef, i64 noundef) #2

declare void @mg_log_set(i32 noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden void @update_config(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @send_notification(ptr noundef, ptr noundef, ...) #1

declare i32 @mg_http_get_var(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #2

declare void @mg_mqtt_pub(ptr noundef, ptr, i64, ptr, i64, i32 noundef, i1 noundef zeroext) #2

declare { ptr, i64 } @mg_str_s(ptr noundef) #2

declare void @mg_ws_upgrade(ptr noundef, ptr noundef, ptr noundef, ...) #2

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

declare void @mg_http_serve_dir(ptr noundef, ptr noundef, ptr noundef) #2

declare zeroext i1 @mg_log_prefix(i32 noundef, ptr noundef, i32 noundef, ptr noundef) #2

declare void @mg_log(ptr noundef, ...) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"mg_connection", !6, i64 0, !6, i64 8, !13, i64 16, !13, i64 44, !6, i64 72, !16, i64 80, !17, i64 88, !17, i64 120, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !7, i64 184, !6, i64 240, !10, i64 248, !10, i64 248, !10, i64 248, !10, i64 248, !10, i64 248, !10, i64 248, !10, i64 248, !10, i64 248, !10, i64 249, !10, i64 249, !10, i64 249, !10, i64 249, !10, i64 249, !10, i64 249, !10, i64 249, !10, i64 249, !10, i64 250}
!13 = !{!"mg_addr", !14, i64 0, !10, i64 4, !7, i64 8, !15, i64 24}
!14 = !{!"short", !7, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"mg_iobuf", !6, i64 0, !16, i64 8, !16, i64 16, !16, i64 24}
!18 = !{!19, !6, i64 0}
!19 = !{!"config", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!19, !6, i64 8}
!21 = !{!19, !6, i64 16}
!22 = !{!15, !15, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!26, !6, i64 0}
!26 = !{!"user", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!7, !7, i64 0}
!28 = !{!26, !6, i64 16}
!29 = !{!30, !6, i64 0}
!30 = !{!"mg_http_serve_opts", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!31 = !{!30, !6, i64 40}
!32 = !{!12, !16, i64 80}
!33 = !{!34, !16, i64 8}
!34 = !{!"mg_http_message", !35, i64 0, !35, i64 16, !35, i64 32, !35, i64 48, !7, i64 64, !35, i64 1024, !35, i64 1040, !35, i64 1056, !35, i64 1072}
!35 = !{!"mg_str", !6, i64 0, !16, i64 8}
!36 = !{!34, !6, i64 0}
!37 = !{!34, !16, i64 24}
!38 = !{!34, !6, i64 16}
!39 = !{!12, !6, i64 120}


; 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.config = type { ptr, ptr, ptr }
%struct.mg_fs = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.mg_http_serve_opts = type { ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@s_config = external hidden global %struct.config, align 8
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [10 x i8], align 1
@s_connected = external hidden local_unnamed_addr global i8, align 1
@.str.17 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [6 x i8], align 1
@s_mqtt = external hidden local_unnamed_addr global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [10 x i8], align 1
@mg_fs_packed = external global %struct.mg_fs, align 8
@.str.34 = external hidden unnamed_addr constant [109 x i8], align 1
@__func__.device_dashboard_fn = external hidden unnamed_addr constant [20 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [22 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @device_dashboard_fn(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  %5 = alloca [256 x i8], align 16
  %6 = alloca %struct.mg_http_serve_opts, align 8
  switch i32 %1, label %113 [
    i32 1, label %7
    i32 10, label %22
  ]

7:                                                ; preds = %4
  %8 = getelementptr inbounds i8, ptr %0, i64 248
  %9 = load i32, ptr %8, align 8
  %10 = and i32 %9, 1
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %113, label %11

11:                                               ; preds = %7
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = tail call ptr @mg_timer_add(ptr noundef %13, i64 noundef 1000, i32 noundef 1, ptr noundef nonnull @timer_metrics_fn, ptr noundef %13) #6
  %15 = load ptr, ptr %12, align 8, !tbaa !5
  %16 = tail call ptr @mg_timer_add(ptr noundef %15, i64 noundef 1000, i32 noundef 1, ptr noundef nonnull @timer_mqtt_fn, ptr noundef %15) #6
  %17 = load ptr, ptr %12, align 8, !tbaa !5
  %18 = tail call ptr @mg_timer_add(ptr noundef %17, i64 noundef 1000, i32 noundef 1, ptr noundef nonnull @timer_sntp_fn, ptr noundef %17) #6
  %19 = tail call noalias ptr @strdup(ptr noundef nonnull @.str) #6
  store ptr %19, ptr @s_config, align 8, !tbaa !16
  %20 = tail call noalias ptr @strdup(ptr noundef nonnull @.str.1) #6
  store ptr %20, ptr getelementptr inbounds (i8, ptr @s_config, i64 8), align 8, !tbaa !18
  %21 = tail call noalias ptr @strdup(ptr noundef nonnull @.str.2) #6
  store ptr %21, ptr getelementptr inbounds (i8, ptr @s_config, i64 16), align 8, !tbaa !19
  br label %113

22:                                               ; preds = %4
  %23 = tail call ptr @getuser(ptr noundef %2)
  %24 = tail call zeroext i1 @mg_http_match_uri(ptr noundef %2, ptr noundef nonnull @.str.3) #6
  br i1 %24, label %25, label %26

25:                                               ; preds = %22
  tail call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %0, i32 noundef 200, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5) #6
  br label %96

26:                                               ; preds = %22
  %27 = tail call zeroext i1 @mg_http_match_uri(ptr noundef %2, ptr noundef nonnull @.str.6) #6
  br i1 %27, label %28, label %35

28:                                               ; preds = %26
  %29 = getelementptr inbounds i8, ptr %2, i64 1024
  %30 = load ptr, ptr %29, align 8
  %31 = getelementptr inbounds i8, ptr %2, i64 1032
  %32 = load i64, ptr %31, align 8
  %33 = tail call i64 @mg_json_get_long(ptr %30, i64 %32, ptr noundef nonnull @.str.7, i64 noundef 3) #6
  %34 = trunc i64 %33 to i32
  tail call void @mg_log_set(i32 noundef %34) #6
  tail call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %0, i32 noundef 200, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.8, i32 noundef %34) #6
  br label %96

35:                                               ; preds = %26
  %36 = icmp eq ptr %23, null
  br i1 %36, label %37, label %40

37:                                               ; preds = %35
  %38 = tail call zeroext i1 @mg_http_match_uri(ptr noundef %2, ptr noundef nonnull @.str.9) #6
  br i1 %38, label %39, label %40

39:                                               ; preds = %37
  tail call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %0, i32 noundef 403, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.10) #6
  br label %96

40:                                               ; preds = %37, %35
  %41 = tail call zeroext i1 @mg_http_match_uri(ptr noundef %2, ptr noundef nonnull @.str.11) #6
  br i1 %41, label %42, label %49

42:                                               ; preds = %40
  %43 = load ptr, ptr @s_config, align 8, !tbaa !16
  %44 = load ptr, ptr getelementptr inbounds (i8, ptr @s_config, i64 8), align 8, !tbaa !18
  %45 = load ptr, ptr getelementptr inbounds (i8, ptr @s_config, i64 16), align 8, !tbaa !19
  %46 = load i8, ptr @s_connected, align 1, !tbaa !20, !range !21, !noundef !22
  %47 = trunc nuw i8 %46 to i1
  %48 = select i1 %47, ptr @.str.17, ptr @.str.18
  tail call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %0, i32 noundef 200, ptr noundef null, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.13, ptr noundef %43, ptr noundef nonnull @.str.14, ptr noundef %44, ptr noundef nonnull @.str.15, ptr noundef %45, ptr noundef nonnull @.str.16, ptr noundef nonnull %48) #6
  br label %96

49:                                               ; preds = %40
  %50 = tail call zeroext i1 @mg_http_match_uri(ptr noundef %2, ptr noundef nonnull @.str.19) #6
  br i1 %50, label %51, label %64

51:                                               ; preds = %49
  %52 = load ptr, ptr %23, align 8, !tbaa !23
  %53 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %52, ptr noundef nonnull dereferenceable(1) @.str.20) #7
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %63

55:                                               ; preds = %51
  %56 = getelementptr inbounds i8, ptr %2, i64 1024
  tail call void @update_config(ptr noundef nonnull %56, ptr noundef nonnull @.str.13, ptr noundef nonnull @s_config)
  tail call void @update_config(ptr noundef nonnull %56, ptr noundef nonnull @.str.14, ptr noundef nonnull getelementptr inbounds (i8, ptr @s_config, i64 8))
  tail call void @update_config(ptr noundef nonnull %56, ptr noundef nonnull @.str.15, ptr noundef nonnull getelementptr inbounds (i8, ptr @s_config, i64 16))
  %57 = load ptr, ptr @s_mqtt, align 8, !tbaa !25
  %.not51 = icmp eq ptr %57, null
  br i1 %.not51, label %62, label %58

58:                                               ; preds = %55
  %59 = getelementptr inbounds i8, ptr %57, i64 248
  %60 = load i32, ptr %59, align 8
  %61 = or i32 %60, 4096
  store i32 %61, ptr %59, align 8
  br label %62

62:                                               ; preds = %58, %55
  tail call void (ptr, ptr, ...) @send_notification(ptr noundef %3, ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.24)
  tail call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %0, i32 noundef 200, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.25) #6
  br label %96

63:                                               ; preds = %51
  tail call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %0, i32 noundef 403, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.10) #6
  br label %96

64:                                               ; preds = %49
  %65 = tail call zeroext i1 @mg_http_match_uri(ptr noundef %2, ptr noundef nonnull @.str.26) #6
  br i1 %65, label %66, label %83

66:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #6
  %67 = load i8, ptr @s_connected, align 1, !tbaa !20, !range !21, !noundef !22
  %68 = trunc nuw i8 %67 to i1
  br i1 %68, label %69, label %82

69:                                               ; preds = %66
  %70 = getelementptr inbounds i8, ptr %2, i64 1024
  %71 = call i32 @mg_http_get_var(ptr noundef nonnull %70, ptr noundef nonnull @.str.27, ptr noundef nonnull %5, i64 noundef 256) #6
  %72 = icmp sgt i32 %71, 0
  br i1 %72, label %73, label %82

73:                                               ; preds = %69
  %74 = load ptr, ptr @s_mqtt, align 8, !tbaa !25
  %75 = load ptr, ptr getelementptr inbounds (i8, ptr @s_config, i64 8), align 8, !tbaa !18
  %76 = call { ptr, i64 } @mg_str_s(ptr noundef %75) #6
  %77 = extractvalue { ptr, i64 } %76, 0
  %78 = extractvalue { ptr, i64 } %76, 1
  %79 = call { ptr, i64 } @mg_str_s(ptr noundef nonnull %5) #6
  %80 = extractvalue { ptr, i64 } %79, 0
  %81 = extractvalue { ptr, i64 } %79, 1
  call void @mg_mqtt_pub(ptr noundef %74, ptr %77, i64 %78, ptr %80, i64 %81, i32 noundef 1, i1 noundef zeroext false) #6
  br label %82

82:                                               ; preds = %73, %69, %66
  call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %0, i32 noundef 200, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.25) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #6
  br label %96

83:                                               ; preds = %64
  %84 = tail call zeroext i1 @mg_http_match_uri(ptr noundef %2, ptr noundef nonnull @.str.28) #6
  br i1 %84, label %85, label %87

85:                                               ; preds = %83
  %86 = getelementptr inbounds i8, ptr %0, i64 184
  store i8 87, ptr %86, align 8, !tbaa !26
  tail call void (ptr, ptr, ptr, ...) @mg_ws_upgrade(ptr noundef %0, ptr noundef %2, ptr noundef null) #6
  br label %96

87:                                               ; preds = %83
  %88 = tail call zeroext i1 @mg_http_match_uri(ptr noundef %2, ptr noundef nonnull @.str.29) #6
  br i1 %88, label %89, label %93

89:                                               ; preds = %87
  %90 = load ptr, ptr %23, align 8, !tbaa !23
  %91 = getelementptr inbounds i8, ptr %23, i64 16
  %92 = load ptr, ptr %91, align 8, !tbaa !27
  tail call void (ptr, i32, ptr, ptr, ...) @mg_http_reply(ptr noundef %0, i32 noundef 200, ptr noundef null, ptr noundef nonnull @.str.30, ptr noundef nonnull @.str.31, ptr noundef %90, ptr noundef nonnull @.str.32, ptr noundef %92) #6
  br label %96

93:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #6
  %94 = getelementptr inbounds i8, ptr %6, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %94, i8 0, i64 32, i1 false)
  store ptr @.str.33, ptr %6, align 8, !tbaa !28
  %95 = getelementptr inbounds i8, ptr %6, i64 40
  store ptr @mg_fs_packed, ptr %95, align 8, !tbaa !30
  call void @mg_http_serve_dir(ptr noundef %0, ptr noundef %2, ptr noundef nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #6
  br label %96

96:                                               ; preds = %25, %39, %63, %62, %85, %93, %89, %82, %42, %28
  %97 = call zeroext i1 @mg_log_prefix(i32 noundef 3, ptr noundef nonnull @.str.34, i32 noundef 223, ptr noundef nonnull @__func__.device_dashboard_fn) #6
  br i1 %97, label %98, label %113

98:                                               ; preds = %96
  %99 = getelementptr inbounds i8, ptr %0, i64 80
  %100 = load i64, ptr %99, align 8, !tbaa !31
  %101 = getelementptr inbounds i8, ptr %2, i64 8
  %102 = load i64, ptr %101, align 8, !tbaa !32
  %103 = trunc i64 %102 to i32
  %104 = load ptr, ptr %2, align 8, !tbaa !35
  %105 = getelementptr inbounds i8, ptr %2, i64 16
  %106 = getelementptr inbounds i8, ptr %2, i64 24
  %107 = load i64, ptr %106, align 8, !tbaa !36
  %108 = trunc i64 %107 to i32
  %109 = load ptr, ptr %105, align 8, !tbaa !37
  %110 = getelementptr inbounds i8, ptr %0, i64 120
  %111 = load ptr, ptr %110, align 8, !tbaa !38
  %112 = getelementptr inbounds i8, ptr %111, i64 9
  call void (ptr, ...) @mg_log(ptr noundef nonnull @.str.35, i64 noundef %100, i32 noundef %103, ptr noundef %104, i32 noundef %108, ptr noundef %109, i32 noundef 3, ptr noundef nonnull %112) #6
  br label %113

113:                                              ; preds = %7, %96, %98, %4, %11
  ret void
}

declare ptr @mg_timer_add(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @timer_metrics_fn(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @timer_mqtt_fn(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @timer_sntp_fn(ptr noundef) #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden ptr @getuser(ptr noundef) local_unnamed_addr #1

declare zeroext i1 @mg_http_match_uri(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @mg_http_reply(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #2

declare i64 @mg_json_get_long(ptr, i64, ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @mg_log_set(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden void @update_config(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @send_notification(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

declare i32 @mg_http_get_var(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @mg_mqtt_pub(ptr noundef, ptr, i64, ptr, i64, i32 noundef, i1 noundef zeroext) local_unnamed_addr #2

declare { ptr, i64 } @mg_str_s(ptr noundef) local_unnamed_addr #2

declare void @mg_ws_upgrade(ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #2

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

declare void @mg_http_serve_dir(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare zeroext i1 @mg_log_prefix(i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @mg_log(ptr noundef, ...) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !7, i64 8}
!6 = !{!"mg_connection", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 44, !7, i64 72, !14, i64 80, !15, i64 88, !15, i64 120, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !8, i64 184, !7, i64 240, !12, i64 248, !12, i64 248, !12, i64 248, !12, i64 248, !12, i64 248, !12, i64 248, !12, i64 248, !12, i64 248, !12, i64 249, !12, i64 249, !12, i64 249, !12, i64 249, !12, i64 249, !12, i64 249, !12, i64 249, !12, i64 249, !12, i64 250}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"mg_addr", !11, i64 0, !12, i64 4, !8, i64 8, !13, i64 24}
!11 = !{!"short", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{!"long", !8, i64 0}
!15 = !{!"mg_iobuf", !7, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!16 = !{!17, !7, i64 0}
!17 = !{!"config", !7, i64 0, !7, i64 8, !7, i64 16}
!18 = !{!17, !7, i64 8}
!19 = !{!17, !7, i64 16}
!20 = !{!13, !13, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!24, !7, i64 0}
!24 = !{!"user", !7, i64 0, !7, i64 8, !7, i64 16}
!25 = !{!7, !7, i64 0}
!26 = !{!8, !8, i64 0}
!27 = !{!24, !7, i64 16}
!28 = !{!29, !7, i64 0}
!29 = !{!"mg_http_serve_opts", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!30 = !{!29, !7, i64 40}
!31 = !{!6, !14, i64 80}
!32 = !{!33, !14, i64 8}
!33 = !{!"mg_http_message", !34, i64 0, !34, i64 16, !34, i64 32, !34, i64 48, !8, i64 64, !34, i64 1024, !34, i64 1040, !34, i64 1056, !34, i64 1072}
!34 = !{!"mg_str", !7, i64 0, !14, i64 8}
!35 = !{!33, !7, i64 0}
!36 = !{!33, !14, i64 24}
!37 = !{!33, !7, i64 16}
!38 = !{!6, !7, i64 120}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass