; LLVM IR from DroneBridge/DroneBridge :: control (i6S)

; 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.timespec = type { i64, i64 }
%struct.js_event = type { i32, i16, i8, i8 }
%struct.i6SRC = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }

@keepRunning = external hidden global i32, align 4
@.str.3 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [54 x i8], align 1
@stderr = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @intHandler(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @initialize_i6S(i32 noundef) #0

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i16 @normalize_i6S(i16 noundef signext, i16 noundef signext) #0

; Function Attrs: nounwind uwtable
define dso_local void @i6S(i32 noundef %0, i64 %1, i64 %2) #0 {
  %4 = alloca %struct.timespec, align 8
  %5 = alloca i32, align 4
  %6 = alloca [14 x i16], align 16
  %7 = alloca %struct.timespec, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.js_event, align 4
  %10 = alloca %struct.i6SRC, align 2
  %11 = alloca i32, align 4
  %12 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 0
  store i64 %1, ptr %12, align 8
  %13 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 1
  store i64 %2, ptr %13, align 8
  store i32 %0, ptr %5, align 4, !tbaa !5
  %14 = call ptr @signal(i32 noundef 2, ptr noundef @intHandler) #5
  call void @llvm.lifetime.start.p0(i64 28, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %15 = load i32, ptr %5, align 4, !tbaa !5
  %16 = call i32 @initialize_i6S(i32 noundef %15)
  store i32 %16, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 28, ptr %10) #5
  %17 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 0
  store i16 0, ptr %17, align 2, !tbaa !9
  %18 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 1
  store i16 0, ptr %18, align 2, !tbaa !12
  %19 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 2
  store i16 0, ptr %19, align 2, !tbaa !13
  %20 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 3
  store i16 0, ptr %20, align 2, !tbaa !14
  %21 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 4
  store i16 0, ptr %21, align 2, !tbaa !15
  %22 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 5
  store i16 0, ptr %22, align 2, !tbaa !16
  %23 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 6
  store i16 1, ptr %23, align 2, !tbaa !17
  %24 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 7
  store i16 0, ptr %24, align 2, !tbaa !18
  %25 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 8
  store i16 1, ptr %25, align 2, !tbaa !19
  %26 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 9
  store i16 0, ptr %26, align 2, !tbaa !20
  %27 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 10
  store i16 1, ptr %27, align 2, !tbaa !21
  %28 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 11
  store i16 0, ptr %28, align 2, !tbaa !22
  %29 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 12
  store i16 1000, ptr %29, align 2, !tbaa !23
  %30 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 13
  store i16 1000, ptr %30, align 2, !tbaa !24
  br label %31

31:                                               ; preds = %3
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void (i32, ptr, ...) @syslog(i32 noundef 6, ptr noundef @.str.3)
  br label %33

33:                                               ; preds = %31
  br label %34

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %267, %34
  %36 = load volatile i32, ptr @keepRunning, align 4, !tbaa !5
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %310

38:                                               ; preds = %35
  %39 = call i32 @nanosleep(ptr noundef %4, ptr noundef %7)
  br label %40

40:                                               ; preds = %120, %38
  %41 = load i32, ptr %8, align 4, !tbaa !5
  %42 = call i64 @read(i32 noundef %41, ptr noundef %9, i64 noundef 8)
  %43 = icmp sgt i64 %42, 0
  br i1 %43, label %44, label %121

44:                                               ; preds = %40
  %45 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 2
  %46 = load i8, ptr %45, align 2, !tbaa !25
  %47 = zext i8 %46 to i32
  %48 = and i32 %47, -129
  %49 = trunc i32 %48 to i8
  store i8 %49, ptr %45, align 2, !tbaa !25
  %50 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 2
  %51 = load i8, ptr %50, align 2, !tbaa !25
  %52 = zext i8 %51 to i32
  %53 = icmp eq i32 %52, 2
  br i1 %53, label %54, label %84

54:                                               ; preds = %44
  %55 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 3
  %56 = load i8, ptr %55, align 1, !tbaa !27
  %57 = zext i8 %56 to i32
  switch i32 %57, label %82 [
    i32 0, label %58
    i32 1, label %62
    i32 2, label %66
    i32 3, label %70
    i32 4, label %74
    i32 5, label %78
  ]

58:                                               ; preds = %54
  %59 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 1
  %60 = load i16, ptr %59, align 4, !tbaa !28
  %61 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 0
  store i16 %60, ptr %61, align 2, !tbaa !9
  br label %83

62:                                               ; preds = %54
  %63 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 1
  %64 = load i16, ptr %63, align 4, !tbaa !28
  %65 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 1
  store i16 %64, ptr %65, align 2, !tbaa !12
  br label %83

66:                                               ; preds = %54
  %67 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 1
  %68 = load i16, ptr %67, align 4, !tbaa !28
  %69 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 2
  store i16 %68, ptr %69, align 2, !tbaa !13
  br label %83

70:                                               ; preds = %54
  %71 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 1
  %72 = load i16, ptr %71, align 4, !tbaa !28
  %73 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 3
  store i16 %72, ptr %73, align 2, !tbaa !14
  br label %83

74:                                               ; preds = %54
  %75 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 1
  %76 = load i16, ptr %75, align 4, !tbaa !28
  %77 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 4
  store i16 %76, ptr %77, align 2, !tbaa !15
  br label %83

78:                                               ; preds = %54
  %79 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 1
  %80 = load i16, ptr %79, align 4, !tbaa !28
  %81 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 5
  store i16 %80, ptr %81, align 2, !tbaa !16
  br label %83

82:                                               ; preds = %54
  br label %83

83:                                               ; preds = %82, %78, %74, %70, %66, %62, %58
  br label %120

84:                                               ; preds = %44
  %85 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 2
  %86 = load i8, ptr %85, align 2, !tbaa !25
  %87 = zext i8 %86 to i32
  %88 = icmp eq i32 %87, 1
  br i1 %88, label %89, label %119

89:                                               ; preds = %84
  %90 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 3
  %91 = load i8, ptr %90, align 1, !tbaa !27
  %92 = zext i8 %91 to i32
  switch i32 %92, label %117 [
    i32 0, label %93
    i32 1, label %97
    i32 2, label %101
    i32 3, label %105
    i32 4, label %109
    i32 5, label %113
  ]

93:                                               ; preds = %89
  %94 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 1
  %95 = load i16, ptr %94, align 4, !tbaa !28
  %96 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 6
  store i16 %95, ptr %96, align 2, !tbaa !17
  br label %118

97:                                               ; preds = %89
  %98 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 1
  %99 = load i16, ptr %98, align 4, !tbaa !28
  %100 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 7
  store i16 %99, ptr %100, align 2, !tbaa !18
  br label %118

101:                                              ; preds = %89
  %102 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 1
  %103 = load i16, ptr %102, align 4, !tbaa !28
  %104 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 8
  store i16 %103, ptr %104, align 2, !tbaa !19
  br label %118

105:                                              ; preds = %89
  %106 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 1
  %107 = load i16, ptr %106, align 4, !tbaa !28
  %108 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 9
  store i16 %107, ptr %108, align 2, !tbaa !20
  br label %118

109:                                              ; preds = %89
  %110 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 1
  %111 = load i16, ptr %110, align 4, !tbaa !28
  %112 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 10
  store i16 %111, ptr %112, align 2, !tbaa !21
  br label %118

113:                                              ; preds = %89
  %114 = getelementptr inbounds %struct.js_event, ptr %9, i32 0, i32 1
  %115 = load i16, ptr %114, align 4, !tbaa !28
  %116 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 11
  store i16 %115, ptr %116, align 2, !tbaa !22
  br label %118

117:                                              ; preds = %89
  br label %118

118:                                              ; preds = %117, %113, %109, %105, %101, %97, %93
  br label %119

119:                                              ; preds = %118, %84
  br label %120

120:                                              ; preds = %119, %83
  br label %40, !llvm.loop !29

121:                                              ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %122 = call ptr @__errno_location() #6
  %123 = load i32, ptr %122, align 4, !tbaa !5
  store i32 %123, ptr %11, align 4, !tbaa !5
  %124 = load i32, ptr %11, align 4, !tbaa !5
  %125 = icmp ne i32 %124, 11
  br i1 %125, label %126, label %147

126:                                              ; preds = %121
  %127 = load i32, ptr %11, align 4, !tbaa !5
  %128 = icmp eq i32 %127, 19
  br i1 %128, label %129, label %136

129:                                              ; preds = %126
  br label %130

130:                                              ; preds = %129
  %131 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  call void (i32, ptr, ...) @syslog(i32 noundef 4, ptr noundef @.str.4)
  br label %132

132:                                              ; preds = %130
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %5, align 4, !tbaa !5
  %135 = call i32 @initialize_i6S(i32 noundef %134)
  store i32 %135, ptr %8, align 4, !tbaa !5
  br label %146

136:                                              ; preds = %126
  br label %137

137:                                              ; preds = %136
  %138 = load ptr, ptr @stderr, align 8, !tbaa !31
  %139 = load i32, ptr %11, align 4, !tbaa !5
  %140 = call ptr @strerror(i32 noundef %139) #5
  %141 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef @.str.5, ptr noundef %140) #5
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = call ptr @strerror(i32 noundef %142) #5
  call void (i32, ptr, ...) @syslog(i32 noundef 3, ptr noundef @.str.5, ptr noundef %143)
  br label %144

144:                                              ; preds = %137
  br label %145

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145, %133
  br label %147

147:                                              ; preds = %146, %121
  %148 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 6
  %149 = load i16, ptr %148, align 2, !tbaa !17
  %150 = sext i16 %149 to i32
  %151 = icmp eq i32 %150, 1
  br i1 %151, label %152, label %154

152:                                              ; preds = %147
  %153 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 6
  store i16 1000, ptr %153, align 2, !tbaa !17
  br label %162

154:                                              ; preds = %147
  %155 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 6
  %156 = load i16, ptr %155, align 2, !tbaa !17
  %157 = sext i16 %156 to i32
  %158 = icmp eq i32 %157, 0
  br i1 %158, label %159, label %161

159:                                              ; preds = %154
  %160 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 6
  store i16 2000, ptr %160, align 2, !tbaa !17
  br label %161

161:                                              ; preds = %159, %154
  br label %162

162:                                              ; preds = %161, %152
  %163 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 11
  %164 = load i16, ptr %163, align 2, !tbaa !22
  %165 = sext i16 %164 to i32
  %166 = icmp eq i32 %165, 0
  br i1 %166, label %167, label %169

167:                                              ; preds = %162
  %168 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 11
  store i16 1000, ptr %168, align 2, !tbaa !22
  br label %177

169:                                              ; preds = %162
  %170 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 11
  %171 = load i16, ptr %170, align 2, !tbaa !22
  %172 = sext i16 %171 to i32
  %173 = icmp eq i32 %172, 1
  br i1 %173, label %174, label %176

174:                                              ; preds = %169
  %175 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 11
  store i16 2000, ptr %175, align 2, !tbaa !22
  br label %176

176:                                              ; preds = %174, %169
  br label %177

177:                                              ; preds = %176, %167
  %178 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 7
  %179 = load i16, ptr %178, align 2, !tbaa !18
  %180 = sext i16 %179 to i32
  %181 = icmp eq i32 %180, 0
  br i1 %181, label %182, label %189

182:                                              ; preds = %177
  %183 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 8
  %184 = load i16, ptr %183, align 2, !tbaa !19
  %185 = sext i16 %184 to i32
  %186 = icmp eq i32 %185, 1
  br i1 %186, label %187, label %189

187:                                              ; preds = %182
  %188 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 12
  store i16 1000, ptr %188, align 2, !tbaa !23
  br label %204

189:                                              ; preds = %182, %177
  %190 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 7
  %191 = load i16, ptr %190, align 2, !tbaa !18
  %192 = sext i16 %191 to i32
  %193 = icmp eq i32 %192, 0
  br i1 %193, label %194, label %201

194:                                              ; preds = %189
  %195 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 8
  %196 = load i16, ptr %195, align 2, !tbaa !19
  %197 = sext i16 %196 to i32
  %198 = icmp eq i32 %197, 0
  br i1 %198, label %199, label %201

199:                                              ; preds = %194
  %200 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 12
  store i16 1500, ptr %200, align 2, !tbaa !23
  br label %203

201:                                              ; preds = %194, %189
  %202 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 12
  store i16 2000, ptr %202, align 2, !tbaa !23
  br label %203

203:                                              ; preds = %201, %199
  br label %204

204:                                              ; preds = %203, %187
  %205 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 9
  %206 = load i16, ptr %205, align 2, !tbaa !20
  %207 = sext i16 %206 to i32
  %208 = icmp eq i32 %207, 0
  br i1 %208, label %209, label %216

209:                                              ; preds = %204
  %210 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 10
  %211 = load i16, ptr %210, align 2, !tbaa !21
  %212 = sext i16 %211 to i32
  %213 = icmp eq i32 %212, 1
  br i1 %213, label %214, label %216

214:                                              ; preds = %209
  %215 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 13
  store i16 1000, ptr %215, align 2, !tbaa !24
  br label %231

216:                                              ; preds = %209, %204
  %217 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 9
  %218 = load i16, ptr %217, align 2, !tbaa !20
  %219 = sext i16 %218 to i32
  %220 = icmp eq i32 %219, 0
  br i1 %220, label %221, label %228

221:                                              ; preds = %216
  %222 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 10
  %223 = load i16, ptr %222, align 2, !tbaa !21
  %224 = sext i16 %223 to i32
  %225 = icmp eq i32 %224, 0
  br i1 %225, label %226, label %228

226:                                              ; preds = %221
  %227 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 13
  store i16 1500, ptr %227, align 2, !tbaa !24
  br label %230

228:                                              ; preds = %221, %216
  %229 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 13
  store i16 2000, ptr %229, align 2, !tbaa !24
  br label %230

230:                                              ; preds = %228, %226
  br label %231

231:                                              ; preds = %230, %214
  %232 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 0
  %233 = load i16, ptr %232, align 2, !tbaa !9
  %234 = sext i16 %233 to i32
  %235 = icmp eq i32 %234, 32766
  br i1 %235, label %236, label %240

236:                                              ; preds = %231
  %237 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 0
  %238 = load i16, ptr %237, align 2, !tbaa !9
  %239 = add i16 %238, 1
  store i16 %239, ptr %237, align 2, !tbaa !9
  br label %240

240:                                              ; preds = %236, %231
  %241 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 1
  %242 = load i16, ptr %241, align 2, !tbaa !12
  %243 = sext i16 %242 to i32
  %244 = icmp eq i32 %243, 32766
  br i1 %244, label %245, label %249

245:                                              ; preds = %240
  %246 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 1
  %247 = load i16, ptr %246, align 2, !tbaa !12
  %248 = add i16 %247, 1
  store i16 %248, ptr %246, align 2, !tbaa !12
  br label %249

249:                                              ; preds = %245, %240
  %250 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 2
  %251 = load i16, ptr %250, align 2, !tbaa !13
  %252 = sext i16 %251 to i32
  %253 = icmp eq i32 %252, 32766
  br i1 %253, label %254, label %258

254:                                              ; preds = %249
  %255 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 2
  %256 = load i16, ptr %255, align 2, !tbaa !13
  %257 = add i16 %256, 1
  store i16 %257, ptr %255, align 2, !tbaa !13
  br label %258

258:                                              ; preds = %254, %249
  %259 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 3
  %260 = load i16, ptr %259, align 2, !tbaa !14
  %261 = sext i16 %260 to i32
  %262 = icmp eq i32 %261, 32766
  br i1 %262, label %263, label %267

263:                                              ; preds = %258
  %264 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 3
  %265 = load i16, ptr %264, align 2, !tbaa !14
  %266 = add i16 %265, 1
  store i16 %266, ptr %264, align 2, !tbaa !14
  br label %267

267:                                              ; preds = %263, %258
  %268 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 0
  %269 = load i16, ptr %268, align 2, !tbaa !9
  %270 = call zeroext i16 @normalize_i6S(i16 noundef signext %269, i16 noundef signext 500)
  %271 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 0
  store i16 %270, ptr %271, align 16, !tbaa !33
  %272 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 1
  %273 = load i16, ptr %272, align 2, !tbaa !12
  %274 = call zeroext i16 @normalize_i6S(i16 noundef signext %273, i16 noundef signext 500)
  %275 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 1
  store i16 %274, ptr %275, align 2, !tbaa !33
  %276 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 2
  %277 = load i16, ptr %276, align 2, !tbaa !13
  %278 = call zeroext i16 @normalize_i6S(i16 noundef signext %277, i16 noundef signext 500)
  %279 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 2
  store i16 %278, ptr %279, align 4, !tbaa !33
  %280 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 3
  %281 = load i16, ptr %280, align 2, !tbaa !14
  %282 = call zeroext i16 @normalize_i6S(i16 noundef signext %281, i16 noundef signext 500)
  %283 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 3
  store i16 %282, ptr %283, align 2, !tbaa !33
  %284 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 4
  %285 = load i16, ptr %284, align 2, !tbaa !15
  %286 = call zeroext i16 @normalize_i6S(i16 noundef signext %285, i16 noundef signext 500)
  %287 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 4
  store i16 %286, ptr %287, align 8, !tbaa !33
  %288 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 5
  %289 = load i16, ptr %288, align 2, !tbaa !16
  %290 = call zeroext i16 @normalize_i6S(i16 noundef signext %289, i16 noundef signext 500)
  %291 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 5
  store i16 %290, ptr %291, align 2, !tbaa !33
  %292 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 6
  %293 = load i16, ptr %292, align 2, !tbaa !17
  %294 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 6
  store i16 %293, ptr %294, align 4, !tbaa !33
  %295 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 12
  %296 = load i16, ptr %295, align 2, !tbaa !23
  %297 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 7
  store i16 %296, ptr %297, align 2, !tbaa !33
  %298 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 13
  %299 = load i16, ptr %298, align 2, !tbaa !24
  %300 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 8
  store i16 %299, ptr %300, align 16, !tbaa !33
  %301 = getelementptr inbounds %struct.i6SRC, ptr %10, i32 0, i32 11
  %302 = load i16, ptr %301, align 2, !tbaa !22
  %303 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 9
  store i16 %302, ptr %303, align 2, !tbaa !33
  %304 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 10
  store i16 1000, ptr %304, align 4, !tbaa !33
  %305 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 11
  store i16 1000, ptr %305, align 2, !tbaa !33
  %306 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 12
  store i16 1000, ptr %306, align 8, !tbaa !33
  %307 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 13
  store i16 1000, ptr %307, align 2, !tbaa !33
  %308 = getelementptr inbounds [14 x i16], ptr %6, i64 0, i64 0
  %309 = call i32 @send_rc_packet(ptr noundef %308)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %35, !llvm.loop !34

310:                                              ; preds = %35
  %311 = load i32, ptr %8, align 4, !tbaa !5
  %312 = call i32 @close(i32 noundef %311)
  call void (...) @close_raw_interfaces()
  call void @llvm.lifetime.end.p0(i64 28, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 28, ptr %6) #5
  ret void
}

; Function Attrs: nounwind
declare ptr @signal(i32 noundef, ptr noundef) #3

declare i32 @nanosleep(ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #4

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #3

declare i32 @send_rc_packet(ptr noundef) #2

declare i32 @close(i32 noundef) #2

declare void @close_raw_interfaces(...) #2

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

!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, !11, i64 0}
!10 = !{!"i6SRC", !11, i64 0, !11, i64 2, !11, i64 4, !11, i64 6, !11, i64 8, !11, i64 10, !11, i64 12, !11, i64 14, !11, i64 16, !11, i64 18, !11, i64 20, !11, i64 22, !11, i64 24, !11, i64 26}
!11 = !{!"short", !7, i64 0}
!12 = !{!10, !11, i64 2}
!13 = !{!10, !11, i64 4}
!14 = !{!10, !11, i64 6}
!15 = !{!10, !11, i64 8}
!16 = !{!10, !11, i64 10}
!17 = !{!10, !11, i64 12}
!18 = !{!10, !11, i64 14}
!19 = !{!10, !11, i64 16}
!20 = !{!10, !11, i64 18}
!21 = !{!10, !11, i64 20}
!22 = !{!10, !11, i64 22}
!23 = !{!10, !11, i64 24}
!24 = !{!10, !11, i64 26}
!25 = !{!26, !7, i64 6}
!26 = !{!"js_event", !6, i64 0, !11, i64 4, !7, i64 6, !7, i64 7}
!27 = !{!26, !7, i64 7}
!28 = !{!26, !11, i64 4}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!32, !32, i64 0}
!32 = !{!"any pointer", !7, i64 0}
!33 = !{!11, !11, i64 0}
!34 = distinct !{!34, !30}


; 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.timespec = type { i64, i64 }
%struct.js_event = type { i32, i16, i8, i8 }

@keepRunning = external hidden global i32, align 4
@.str.3 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [54 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @intHandler(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @initialize_i6S(i32 noundef) local_unnamed_addr #0

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

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

declare void @syslog(i32 noundef, ptr noundef, ...) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i16 @normalize_i6S(i16 noundef signext, i16 noundef signext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @i6S(i32 noundef %0, i64 %1, i64 %2) local_unnamed_addr #0 {
  %4 = alloca %struct.timespec, align 8
  %5 = alloca [14 x i16], align 16
  %6 = alloca %struct.timespec, align 8
  %7 = alloca %struct.js_event, align 4
  store i64 %1, ptr %4, align 8
  %8 = getelementptr inbounds i8, ptr %4, i64 8
  store i64 %2, ptr %8, align 8
  %9 = tail call ptr @signal(i32 noundef 2, ptr noundef nonnull @intHandler) #7
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %10 = tail call i32 @initialize_i6S(i32 noundef %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  tail call void (i32, ptr, ...) @syslog(i32 noundef 6, ptr noundef nonnull @.str.3) #7
  %12 = load volatile i32, ptr @keepRunning, align 4, !tbaa !5
  %.not69 = icmp eq i32 %12, 0
  br i1 %.not69, label %._crit_edge85, label %.lr.ph84

.lr.ph84:                                         ; preds = %3
  %13 = getelementptr inbounds i8, ptr %7, i64 6
  %14 = getelementptr inbounds i8, ptr %7, i64 7
  %15 = getelementptr inbounds i8, ptr %7, i64 4
  %16 = getelementptr inbounds i8, ptr %5, i64 2
  %17 = getelementptr inbounds i8, ptr %5, i64 4
  %18 = getelementptr inbounds i8, ptr %5, i64 6
  %19 = getelementptr inbounds i8, ptr %5, i64 8
  %20 = getelementptr inbounds i8, ptr %5, i64 10
  %21 = getelementptr inbounds i8, ptr %5, i64 12
  %22 = getelementptr inbounds i8, ptr %5, i64 14
  %23 = getelementptr inbounds i8, ptr %5, i64 16
  %24 = getelementptr inbounds i8, ptr %5, i64 18
  %25 = getelementptr inbounds i8, ptr %5, i64 20
  br label %26

26:                                               ; preds = %.lr.ph84, %77
  %.082 = phi i32 [ %10, %.lr.ph84 ], [ %.1, %77 ]
  %.sroa.0.081 = phi i16 [ 0, %.lr.ph84 ], [ %.sroa.0.3, %77 ]
  %.sroa.8.080 = phi i16 [ 0, %.lr.ph84 ], [ %.sroa.8.3, %77 ]
  %.sroa.14.079 = phi i16 [ 0, %.lr.ph84 ], [ %.sroa.14.3, %77 ]
  %.sroa.20.078 = phi i16 [ 0, %.lr.ph84 ], [ %.sroa.20.3, %77 ]
  %.sroa.26.077 = phi i16 [ 0, %.lr.ph84 ], [ %.sroa.26.1.lcssa, %77 ]
  %.sroa.29.076 = phi i16 [ 0, %.lr.ph84 ], [ %.sroa.29.1.lcssa, %77 ]
  %.sroa.32.075 = phi i16 [ 1, %.lr.ph84 ], [ %.sroa.32.3, %77 ]
  %.sroa.39.074 = phi i16 [ 0, %.lr.ph84 ], [ %.sroa.39.1.lcssa, %77 ]
  %.sroa.43.073 = phi i16 [ 1, %.lr.ph84 ], [ %.sroa.43.1.lcssa, %77 ]
  %.sroa.47.072 = phi i16 [ 0, %.lr.ph84 ], [ %.sroa.47.1.lcssa, %77 ]
  %.sroa.51.071 = phi i16 [ 1, %.lr.ph84 ], [ %.sroa.51.1.lcssa, %77 ]
  %.sroa.55.070 = phi i16 [ 0, %.lr.ph84 ], [ %.sroa.55.3, %77 ]
  %27 = call i32 @nanosleep(ptr noundef nonnull %4, ptr noundef nonnull %6) #7
  %28 = call i64 @read(i32 noundef %.082, ptr noundef nonnull %7, i64 noundef 8) #7
  %29 = icmp sgt i64 %28, 0
  br i1 %29, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %26, %60
  %.sroa.0.157 = phi i16 [ %.sroa.0.2, %60 ], [ %.sroa.0.081, %26 ]
  %.sroa.8.156 = phi i16 [ %.sroa.8.2, %60 ], [ %.sroa.8.080, %26 ]
  %.sroa.14.155 = phi i16 [ %.sroa.14.2, %60 ], [ %.sroa.14.079, %26 ]
  %.sroa.20.154 = phi i16 [ %.sroa.20.2, %60 ], [ %.sroa.20.078, %26 ]
  %.sroa.26.153 = phi i16 [ %.sroa.26.2, %60 ], [ %.sroa.26.077, %26 ]
  %.sroa.29.152 = phi i16 [ %.sroa.29.2, %60 ], [ %.sroa.29.076, %26 ]
  %.sroa.32.151 = phi i16 [ %.sroa.32.2, %60 ], [ %.sroa.32.075, %26 ]
  %.sroa.39.150 = phi i16 [ %.sroa.39.2, %60 ], [ %.sroa.39.074, %26 ]
  %.sroa.43.149 = phi i16 [ %.sroa.43.2, %60 ], [ %.sroa.43.073, %26 ]
  %.sroa.47.148 = phi i16 [ %.sroa.47.2, %60 ], [ %.sroa.47.072, %26 ]
  %.sroa.51.147 = phi i16 [ %.sroa.51.2, %60 ], [ %.sroa.51.071, %26 ]
  %.sroa.55.146 = phi i16 [ %.sroa.55.2, %60 ], [ %.sroa.55.070, %26 ]
  %30 = load i8, ptr %13, align 2, !tbaa !9
  %31 = and i8 %30, 127
  store i8 %31, ptr %13, align 2, !tbaa !9
  switch i8 %31, label %60 [
    i8 2, label %32
    i8 1, label %46
  ]

32:                                               ; preds = %.lr.ph
  %33 = load i8, ptr %14, align 1, !tbaa !12
  switch i8 %33, label %60 [
    i8 0, label %34
    i8 1, label %36
    i8 2, label %38
    i8 3, label %40
    i8 4, label %42
    i8 5, label %44
  ]

34:                                               ; preds = %32
  %35 = load i16, ptr %15, align 4, !tbaa !13
  br label %60

36:                                               ; preds = %32
  %37 = load i16, ptr %15, align 4, !tbaa !13
  br label %60

38:                                               ; preds = %32
  %39 = load i16, ptr %15, align 4, !tbaa !13
  br label %60

40:                                               ; preds = %32
  %41 = load i16, ptr %15, align 4, !tbaa !13
  br label %60

42:                                               ; preds = %32
  %43 = load i16, ptr %15, align 4, !tbaa !13
  br label %60

44:                                               ; preds = %32
  %45 = load i16, ptr %15, align 4, !tbaa !13
  br label %60

46:                                               ; preds = %.lr.ph
  %47 = load i8, ptr %14, align 1, !tbaa !12
  switch i8 %47, label %60 [
    i8 0, label %48
    i8 1, label %50
    i8 2, label %52
    i8 3, label %54
    i8 4, label %56
    i8 5, label %58
  ]

48:                                               ; preds = %46
  %49 = load i16, ptr %15, align 4, !tbaa !13
  br label %60

50:                                               ; preds = %46
  %51 = load i16, ptr %15, align 4, !tbaa !13
  br label %60

52:                                               ; preds = %46
  %53 = load i16, ptr %15, align 4, !tbaa !13
  br label %60

54:                                               ; preds = %46
  %55 = load i16, ptr %15, align 4, !tbaa !13
  br label %60

56:                                               ; preds = %46
  %57 = load i16, ptr %15, align 4, !tbaa !13
  br label %60

58:                                               ; preds = %46
  %59 = load i16, ptr %15, align 4, !tbaa !13
  br label %60

60:                                               ; preds = %.lr.ph, %46, %58, %56, %54, %52, %50, %48, %34, %36, %38, %40, %42, %44, %32
  %.sroa.55.2 = phi i16 [ %.sroa.55.146, %32 ], [ %.sroa.55.146, %44 ], [ %.sroa.55.146, %42 ], [ %.sroa.55.146, %40 ], [ %.sroa.55.146, %38 ], [ %.sroa.55.146, %36 ], [ %.sroa.55.146, %34 ], [ %.sroa.55.146, %46 ], [ %59, %58 ], [ %.sroa.55.146, %56 ], [ %.sroa.55.146, %54 ], [ %.sroa.55.146, %52 ], [ %.sroa.55.146, %50 ], [ %.sroa.55.146, %48 ], [ %.sroa.55.146, %.lr.ph ]
  %.sroa.51.2 = phi i16 [ %.sroa.51.147, %32 ], [ %.sroa.51.147, %44 ], [ %.sroa.51.147, %42 ], [ %.sroa.51.147, %40 ], [ %.sroa.51.147, %38 ], [ %.sroa.51.147, %36 ], [ %.sroa.51.147, %34 ], [ %.sroa.51.147, %46 ], [ %.sroa.51.147, %58 ], [ %57, %56 ], [ %.sroa.51.147, %54 ], [ %.sroa.51.147, %52 ], [ %.sroa.51.147, %50 ], [ %.sroa.51.147, %48 ], [ %.sroa.51.147, %.lr.ph ]
  %.sroa.47.2 = phi i16 [ %.sroa.47.148, %32 ], [ %.sroa.47.148, %44 ], [ %.sroa.47.148, %42 ], [ %.sroa.47.148, %40 ], [ %.sroa.47.148, %38 ], [ %.sroa.47.148, %36 ], [ %.sroa.47.148, %34 ], [ %.sroa.47.148, %46 ], [ %.sroa.47.148, %58 ], [ %.sroa.47.148, %56 ], [ %55, %54 ], [ %.sroa.47.148, %52 ], [ %.sroa.47.148, %50 ], [ %.sroa.47.148, %48 ], [ %.sroa.47.148, %.lr.ph ]
  %.sroa.43.2 = phi i16 [ %.sroa.43.149, %32 ], [ %.sroa.43.149, %44 ], [ %.sroa.43.149, %42 ], [ %.sroa.43.149, %40 ], [ %.sroa.43.149, %38 ], [ %.sroa.43.149, %36 ], [ %.sroa.43.149, %34 ], [ %.sroa.43.149, %46 ], [ %.sroa.43.149, %58 ], [ %.sroa.43.149, %56 ], [ %.sroa.43.149, %54 ], [ %53, %52 ], [ %.sroa.43.149, %50 ], [ %.sroa.43.149, %48 ], [ %.sroa.43.149, %.lr.ph ]
  %.sroa.39.2 = phi i16 [ %.sroa.39.150, %32 ], [ %.sroa.39.150, %44 ], [ %.sroa.39.150, %42 ], [ %.sroa.39.150, %40 ], [ %.sroa.39.150, %38 ], [ %.sroa.39.150, %36 ], [ %.sroa.39.150, %34 ], [ %.sroa.39.150, %46 ], [ %.sroa.39.150, %58 ], [ %.sroa.39.150, %56 ], [ %.sroa.39.150, %54 ], [ %.sroa.39.150, %52 ], [ %51, %50 ], [ %.sroa.39.150, %48 ], [ %.sroa.39.150, %.lr.ph ]
  %.sroa.32.2 = phi i16 [ %.sroa.32.151, %32 ], [ %.sroa.32.151, %44 ], [ %.sroa.32.151, %42 ], [ %.sroa.32.151, %40 ], [ %.sroa.32.151, %38 ], [ %.sroa.32.151, %36 ], [ %.sroa.32.151, %34 ], [ %.sroa.32.151, %46 ], [ %.sroa.32.151, %58 ], [ %.sroa.32.151, %56 ], [ %.sroa.32.151, %54 ], [ %.sroa.32.151, %52 ], [ %.sroa.32.151, %50 ], [ %49, %48 ], [ %.sroa.32.151, %.lr.ph ]
  %.sroa.29.2 = phi i16 [ %.sroa.29.152, %32 ], [ %45, %44 ], [ %.sroa.29.152, %42 ], [ %.sroa.29.152, %40 ], [ %.sroa.29.152, %38 ], [ %.sroa.29.152, %36 ], [ %.sroa.29.152, %34 ], [ %.sroa.29.152, %46 ], [ %.sroa.29.152, %58 ], [ %.sroa.29.152, %56 ], [ %.sroa.29.152, %54 ], [ %.sroa.29.152, %52 ], [ %.sroa.29.152, %50 ], [ %.sroa.29.152, %48 ], [ %.sroa.29.152, %.lr.ph ]
  %.sroa.26.2 = phi i16 [ %.sroa.26.153, %32 ], [ %.sroa.26.153, %44 ], [ %43, %42 ], [ %.sroa.26.153, %40 ], [ %.sroa.26.153, %38 ], [ %.sroa.26.153, %36 ], [ %.sroa.26.153, %34 ], [ %.sroa.26.153, %46 ], [ %.sroa.26.153, %58 ], [ %.sroa.26.153, %56 ], [ %.sroa.26.153, %54 ], [ %.sroa.26.153, %52 ], [ %.sroa.26.153, %50 ], [ %.sroa.26.153, %48 ], [ %.sroa.26.153, %.lr.ph ]
  %.sroa.20.2 = phi i16 [ %.sroa.20.154, %32 ], [ %.sroa.20.154, %44 ], [ %.sroa.20.154, %42 ], [ %41, %40 ], [ %.sroa.20.154, %38 ], [ %.sroa.20.154, %36 ], [ %.sroa.20.154, %34 ], [ %.sroa.20.154, %46 ], [ %.sroa.20.154, %58 ], [ %.sroa.20.154, %56 ], [ %.sroa.20.154, %54 ], [ %.sroa.20.154, %52 ], [ %.sroa.20.154, %50 ], [ %.sroa.20.154, %48 ], [ %.sroa.20.154, %.lr.ph ]
  %.sroa.14.2 = phi i16 [ %.sroa.14.155, %32 ], [ %.sroa.14.155, %44 ], [ %.sroa.14.155, %42 ], [ %.sroa.14.155, %40 ], [ %39, %38 ], [ %.sroa.14.155, %36 ], [ %.sroa.14.155, %34 ], [ %.sroa.14.155, %46 ], [ %.sroa.14.155, %58 ], [ %.sroa.14.155, %56 ], [ %.sroa.14.155, %54 ], [ %.sroa.14.155, %52 ], [ %.sroa.14.155, %50 ], [ %.sroa.14.155, %48 ], [ %.sroa.14.155, %.lr.ph ]
  %.sroa.8.2 = phi i16 [ %.sroa.8.156, %32 ], [ %.sroa.8.156, %44 ], [ %.sroa.8.156, %42 ], [ %.sroa.8.156, %40 ], [ %.sroa.8.156, %38 ], [ %37, %36 ], [ %.sroa.8.156, %34 ], [ %.sroa.8.156, %46 ], [ %.sroa.8.156, %58 ], [ %.sroa.8.156, %56 ], [ %.sroa.8.156, %54 ], [ %.sroa.8.156, %52 ], [ %.sroa.8.156, %50 ], [ %.sroa.8.156, %48 ], [ %.sroa.8.156, %.lr.ph ]
  %.sroa.0.2 = phi i16 [ %.sroa.0.157, %32 ], [ %.sroa.0.157, %44 ], [ %.sroa.0.157, %42 ], [ %.sroa.0.157, %40 ], [ %.sroa.0.157, %38 ], [ %.sroa.0.157, %36 ], [ %35, %34 ], [ %.sroa.0.157, %46 ], [ %.sroa.0.157, %58 ], [ %.sroa.0.157, %56 ], [ %.sroa.0.157, %54 ], [ %.sroa.0.157, %52 ], [ %.sroa.0.157, %50 ], [ %.sroa.0.157, %48 ], [ %.sroa.0.157, %.lr.ph ]
  %61 = call i64 @read(i32 noundef %.082, ptr noundef nonnull %7, i64 noundef 8) #7
  %62 = icmp sgt i64 %61, 0
  br i1 %62, label %.lr.ph, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %60, %26
  %.sroa.55.1.lcssa = phi i16 [ %.sroa.55.070, %26 ], [ %.sroa.55.2, %60 ]
  %.sroa.51.1.lcssa = phi i16 [ %.sroa.51.071, %26 ], [ %.sroa.51.2, %60 ]
  %.sroa.47.1.lcssa = phi i16 [ %.sroa.47.072, %26 ], [ %.sroa.47.2, %60 ]
  %.sroa.43.1.lcssa = phi i16 [ %.sroa.43.073, %26 ], [ %.sroa.43.2, %60 ]
  %.sroa.39.1.lcssa = phi i16 [ %.sroa.39.074, %26 ], [ %.sroa.39.2, %60 ]
  %.sroa.32.1.lcssa = phi i16 [ %.sroa.32.075, %26 ], [ %.sroa.32.2, %60 ]
  %.sroa.29.1.lcssa = phi i16 [ %.sroa.29.076, %26 ], [ %.sroa.29.2, %60 ]
  %.sroa.26.1.lcssa = phi i16 [ %.sroa.26.077, %26 ], [ %.sroa.26.2, %60 ]
  %.sroa.20.1.lcssa = phi i16 [ %.sroa.20.078, %26 ], [ %.sroa.20.2, %60 ]
  %.sroa.14.1.lcssa = phi i16 [ %.sroa.14.079, %26 ], [ %.sroa.14.2, %60 ]
  %.sroa.8.1.lcssa = phi i16 [ %.sroa.8.080, %26 ], [ %.sroa.8.2, %60 ]
  %.sroa.0.1.lcssa = phi i16 [ %.sroa.0.081, %26 ], [ %.sroa.0.2, %60 ]
  %63 = tail call ptr @__errno_location() #8
  %64 = load i32, ptr %63, align 4, !tbaa !5
  switch i32 %64, label %68 [
    i32 11, label %73
    i32 19, label %65
  ]

65:                                               ; preds = %._crit_edge
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void (i32, ptr, ...) @syslog(i32 noundef 4, ptr noundef nonnull @.str.4) #7
  %67 = call i32 @initialize_i6S(i32 noundef %0)
  br label %73

68:                                               ; preds = %._crit_edge
  %69 = load ptr, ptr @stderr, align 8, !tbaa !16
  %70 = call ptr @strerror(i32 noundef %64) #7
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef nonnull @.str.5, ptr noundef %70) #9
  %72 = call ptr @strerror(i32 noundef %64) #7
  call void (i32, ptr, ...) @syslog(i32 noundef 3, ptr noundef nonnull @.str.5, ptr noundef %72) #7
  br label %73

73:                                               ; preds = %._crit_edge, %65, %68
  %.1 = phi i32 [ %67, %65 ], [ %.082, %68 ], [ %.082, %._crit_edge ]
  switch i16 %.sroa.32.1.lcssa, label %.fold.split [
    i16 1, label %75
    i16 0, label %74
  ]

74:                                               ; preds = %73
  br label %75

.fold.split:                                      ; preds = %73
  br label %75

75:                                               ; preds = %73, %.fold.split, %74
  %.sroa.32.3 = phi i16 [ 2000, %74 ], [ 1000, %73 ], [ %.sroa.32.1.lcssa, %.fold.split ]
  switch i16 %.sroa.55.1.lcssa, label %.fold.split44 [
    i16 0, label %77
    i16 1, label %76
  ]

76:                                               ; preds = %75
  br label %77

.fold.split44:                                    ; preds = %75
  br label %77

77:                                               ; preds = %75, %.fold.split44, %76
  %.sroa.55.3 = phi i16 [ 2000, %76 ], [ 1000, %75 ], [ %.sroa.55.1.lcssa, %.fold.split44 ]
  %78 = icmp eq i16 %.sroa.39.1.lcssa, 0
  %79 = icmp eq i16 %.sroa.43.1.lcssa, 1
  %or.cond = select i1 %78, i1 %79, i1 false
  %80 = icmp eq i16 %.sroa.43.1.lcssa, 0
  %or.cond7 = select i1 %78, i1 %80, i1 false
  %. = select i1 %or.cond7, i16 1500, i16 2000
  %.sroa.62.0 = select i1 %or.cond, i16 1000, i16 %.
  %81 = icmp eq i16 %.sroa.47.1.lcssa, 0
  %82 = icmp eq i16 %.sroa.51.1.lcssa, 1
  %or.cond11 = select i1 %81, i1 %82, i1 false
  %83 = icmp eq i16 %.sroa.51.1.lcssa, 0
  %or.cond15 = select i1 %81, i1 %83, i1 false
  %.45 = select i1 %or.cond15, i16 1500, i16 2000
  %.sroa.67.0 = select i1 %or.cond11, i16 1000, i16 %.45
  %84 = icmp eq i16 %.sroa.0.1.lcssa, 32766
  %.sroa.0.3 = select i1 %84, i16 32767, i16 %.sroa.0.1.lcssa
  %85 = icmp eq i16 %.sroa.8.1.lcssa, 32766
  %.sroa.8.3 = select i1 %85, i16 32767, i16 %.sroa.8.1.lcssa
  %86 = icmp eq i16 %.sroa.14.1.lcssa, 32766
  %.sroa.14.3 = select i1 %86, i16 32767, i16 %.sroa.14.1.lcssa
  %87 = icmp eq i16 %.sroa.20.1.lcssa, 32766
  %.sroa.20.3 = select i1 %87, i16 32767, i16 %.sroa.20.1.lcssa
  %88 = call zeroext i16 @normalize_i6S(i16 noundef signext %.sroa.0.3, i16 noundef signext 500)
  store i16 %88, ptr %5, align 16, !tbaa !18
  %89 = call zeroext i16 @normalize_i6S(i16 noundef signext %.sroa.8.3, i16 noundef signext 500)
  store i16 %89, ptr %16, align 2, !tbaa !18
  %90 = call zeroext i16 @normalize_i6S(i16 noundef signext %.sroa.14.3, i16 noundef signext 500)
  store i16 %90, ptr %17, align 4, !tbaa !18
  %91 = call zeroext i16 @normalize_i6S(i16 noundef signext %.sroa.20.3, i16 noundef signext 500)
  store i16 %91, ptr %18, align 2, !tbaa !18
  %92 = call zeroext i16 @normalize_i6S(i16 noundef signext %.sroa.26.1.lcssa, i16 noundef signext 500)
  store i16 %92, ptr %19, align 8, !tbaa !18
  %93 = call zeroext i16 @normalize_i6S(i16 noundef signext %.sroa.29.1.lcssa, i16 noundef signext 500)
  store i16 %93, ptr %20, align 2, !tbaa !18
  store i16 %.sroa.32.3, ptr %21, align 4, !tbaa !18
  store i16 %.sroa.62.0, ptr %22, align 2, !tbaa !18
  store i16 %.sroa.67.0, ptr %23, align 16, !tbaa !18
  store i16 %.sroa.55.3, ptr %24, align 2, !tbaa !18
  store <4 x i16> <i16 1000, i16 1000, i16 1000, i16 1000>, ptr %25, align 4, !tbaa !18
  %94 = call i32 @send_rc_packet(ptr noundef nonnull %5) #7
  %95 = load volatile i32, ptr @keepRunning, align 4, !tbaa !5
  %.not = icmp eq i32 %95, 0
  br i1 %.not, label %._crit_edge85, label %26, !llvm.loop !19

._crit_edge85:                                    ; preds = %77, %3
  %.0.lcssa = phi i32 [ %10, %3 ], [ %.1, %77 ]
  %96 = call i32 @close(i32 noundef %.0.lcssa) #7
  call void (...) @close_raw_interfaces() #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %5) #7
  ret void
}

; Function Attrs: nounwind
declare ptr @signal(i32 noundef, ptr noundef) local_unnamed_addr #4

declare i32 @nanosleep(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree
declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #6

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #4

declare i32 @send_rc_packet(ptr noundef) local_unnamed_addr #3

declare i32 @close(i32 noundef) local_unnamed_addr #3

declare void @close_raw_interfaces(...) local_unnamed_addr #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !7, i64 6}
!10 = !{!"js_event", !6, i64 0, !11, i64 4, !7, i64 6, !7, i64 7}
!11 = !{!"short", !7, i64 0}
!12 = !{!10, !7, i64 7}
!13 = !{!10, !11, i64 4}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!11, !11, i64 0}
!19 = distinct !{!19, !15}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass