; LLVM IR from golems/ach :: benchmark/ros/src (rosbenchmain)

; 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.mq_attr = type { i64, i64, i64, i64, [4 x i64] }

@mq_lat_attr = external dso_local global %struct.mq_attr, align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@optarg = external global ptr, align 8
@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [304 x i8], align 1
@optind = external global i32, align 4
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 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 [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i64, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 1000, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 1, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 1, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 120, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store ptr @.str, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  br label %24

24:                                               ; preds = %69, %2
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !9
  %27 = call i32 @getopt(i32 noundef %25, ptr noundef %26, ptr noundef @.str.1) #8
  store i32 %27, ptr %11, align 4, !tbaa !5
  %28 = icmp ne i32 %27, -1
  br i1 %28, label %29, label %70

29:                                               ; preds = %24
  %30 = load i32, ptr %11, align 4, !tbaa !5
  switch i32 %30, label %67 [
    i32 86, label %31
    i32 102, label %33
    i32 116, label %44
    i32 115, label %55
    i32 83, label %60
    i32 63, label %65
  ]

31:                                               ; preds = %29
  %32 = call i32 @puts(ptr noundef @.str.2)
  call void @exit(i32 noundef 0) #9
  unreachable

33:                                               ; preds = %29
  %34 = load ptr, ptr @optarg, align 8, !tbaa !9
  %35 = call double @strtod(ptr noundef %34, ptr noundef %13) #8
  %36 = fptosi double %35 to i32
  store i32 %36, ptr %6, align 4, !tbaa !5
  %37 = load ptr, ptr %13, align 8, !tbaa !9
  %38 = icmp eq ptr null, %37
  br i1 %38, label %39, label %43

39:                                               ; preds = %33
  %40 = load ptr, ptr @stderr, align 8, !tbaa !9
  %41 = load ptr, ptr @optarg, align 8, !tbaa !9
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef @.str.3, ptr noundef %41) #8
  call void @exit(i32 noundef 1) #9
  unreachable

43:                                               ; preds = %33
  br label %69

44:                                               ; preds = %29
  %45 = load ptr, ptr @optarg, align 8, !tbaa !9
  %46 = call double @strtod(ptr noundef %45, ptr noundef %13) #8
  %47 = fptosi double %46 to i32
  store i32 %47, ptr %7, align 4, !tbaa !5
  %48 = load ptr, ptr %13, align 8, !tbaa !9
  %49 = icmp eq ptr null, %48
  br i1 %49, label %50, label %54

50:                                               ; preds = %44
  %51 = load ptr, ptr @stderr, align 8, !tbaa !9
  %52 = load ptr, ptr @optarg, align 8, !tbaa !9
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef @.str.4, ptr noundef %52) #8
  call void @exit(i32 noundef 1) #9
  unreachable

54:                                               ; preds = %44
  br label %69

55:                                               ; preds = %29
  %56 = load ptr, ptr @optarg, align 8, !tbaa !9
  %57 = call i32 @atoi(ptr noundef %56) #10
  %58 = sext i32 %57 to i64
  %59 = trunc i64 %58 to i32
  store i32 %59, ptr %8, align 4, !tbaa !5
  br label %69

60:                                               ; preds = %29
  %61 = load ptr, ptr @optarg, align 8, !tbaa !9
  %62 = call i32 @atoi(ptr noundef %61) #10
  %63 = sext i32 %62 to i64
  %64 = trunc i64 %63 to i32
  store i32 %64, ptr %9, align 4, !tbaa !5
  br label %69

65:                                               ; preds = %29
  %66 = call i32 @puts(ptr noundef @.str.5)
  call void @exit(i32 noundef 0) #9
  unreachable

67:                                               ; preds = %29
  %68 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %68, ptr %12, align 8, !tbaa !9
  br label %69

69:                                               ; preds = %67, %60, %55, %54, %43
  br label %24, !llvm.loop !11

70:                                               ; preds = %24
  br label %71

71:                                               ; preds = %75, %70
  %72 = load i32, ptr @optind, align 4, !tbaa !5
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %75, label %82

75:                                               ; preds = %71
  %76 = load ptr, ptr %5, align 8, !tbaa !9
  %77 = load i32, ptr @optind, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr @optind, align 4, !tbaa !5
  %79 = sext i32 %77 to i64
  %80 = getelementptr inbounds ptr, ptr %76, i64 %79
  %81 = load ptr, ptr %80, align 8, !tbaa !9
  store ptr %81, ptr %12, align 8, !tbaa !9
  br label %71, !llvm.loop !13

82:                                               ; preds = %71
  %83 = load ptr, ptr @stderr, align 8, !tbaa !9
  %84 = load ptr, ptr %12, align 8, !tbaa !9
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.6, ptr noundef %84) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %86 = load ptr, ptr %12, align 8, !tbaa !9
  %87 = call i32 @strcasecmp(ptr noundef %86, ptr noundef @.str) #10
  %88 = icmp eq i32 0, %87
  br i1 %88, label %89, label %90

89:                                               ; preds = %82
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %100

90:                                               ; preds = %82
  %91 = load ptr, ptr %12, align 8, !tbaa !9
  %92 = call i32 @strcasecmp(ptr noundef %91, ptr noundef @.str.7) #10
  %93 = icmp eq i32 0, %92
  br i1 %93, label %94, label %95

94:                                               ; preds = %90
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %99

95:                                               ; preds = %90
  %96 = load ptr, ptr @stderr, align 8, !tbaa !9
  %97 = load ptr, ptr %12, align 8, !tbaa !9
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef @.str.8, ptr noundef %97) #8
  call void @exit(i32 noundef 1) #9
  unreachable

99:                                               ; preds = %94
  br label %100

100:                                              ; preds = %99, %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %101 = call i32 (ptr, i32, ...) @mq_open(ptr noundef @.str.9, i32 noundef 2114, i32 noundef 384, ptr noundef @mq_lat_attr) #8
  store i32 %101, ptr %15, align 4, !tbaa !5
  %102 = icmp slt i32 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %100
  call void @perror(ptr noundef @.str.10)
  call void @abort() #9
  unreachable

104:                                              ; preds = %100
  %105 = call i32 @mq_unlink(ptr noundef @.str.9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %106 = call i32 @fork() #8
  store i32 %106, ptr %16, align 4, !tbaa !5
  %107 = load i32, ptr %16, align 4, !tbaa !5
  %108 = icmp eq i32 0, %107
  br i1 %108, label %109, label %111

109:                                              ; preds = %104
  %110 = load i32, ptr %15, align 4, !tbaa !5
  call void @time_print(i32 noundef %110)
  br label %116

111:                                              ; preds = %104
  %112 = load i32, ptr %16, align 4, !tbaa !5
  %113 = icmp sgt i32 0, %112
  br i1 %113, label %114, label %115

114:                                              ; preds = %111
  call void @perror(ptr noundef @.str.11)
  call void @abort() #9
  unreachable

115:                                              ; preds = %111
  br label %116

116:                                              ; preds = %115, %109
  call void @make_realtime(i32 noundef 30)
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = load i32, ptr %9, align 4, !tbaa !5
  %119 = add nsw i32 %117, %118
  %120 = zext i32 %119 to i64
  %121 = call ptr @llvm.stacksave.p0()
  store ptr %121, ptr %17, align 8
  %122 = alloca i32, i64 %120, align 16
  store i64 %120, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  store i64 0, ptr %19, align 8, !tbaa !14
  br label %123

123:                                              ; preds = %167, %116
  %124 = load i64, ptr %19, align 8, !tbaa !14
  %125 = load i32, ptr %8, align 4, !tbaa !5
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = add nsw i32 %125, %126
  %128 = sext i32 %127 to i64
  %129 = icmp ult i64 %124, %128
  br i1 %129, label %130, label %170

130:                                              ; preds = %123
  %131 = call i32 @fork() #8
  %132 = load i64, ptr %19, align 8, !tbaa !14
  %133 = getelementptr inbounds i32, ptr %122, i64 %132
  store i32 %131, ptr %133, align 4, !tbaa !5
  %134 = load i64, ptr %19, align 8, !tbaa !14
  %135 = getelementptr inbounds i32, ptr %122, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = icmp eq i32 0, %136
  br i1 %137, label %138, label %159

138:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 1, ptr %20, align 4, !tbaa !5
  %139 = load i64, ptr %19, align 8, !tbaa !14
  %140 = load i32, ptr %8, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = icmp uge i64 %139, %141
  br i1 %142, label %143, label %144

143:                                              ; preds = %138
  call void @make_realtime(i32 noundef 0)
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %143, %138
  %145 = load i32, ptr %4, align 4, !tbaa !5
  %146 = load ptr, ptr %5, align 8, !tbaa !9
  %147 = load i64, ptr %19, align 8, !tbaa !14
  %148 = trunc i64 %147 to i32
  %149 = load i64, ptr %19, align 8, !tbaa !14
  %150 = load i32, ptr %8, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = icmp ult i64 %149, %151
  %153 = zext i1 %152 to i32
  %154 = load i32, ptr %14, align 4, !tbaa !5
  %155 = load i32, ptr %10, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = load i32, ptr %15, align 4, !tbaa !5
  %158 = call i32 @subscribe(i32 noundef %145, ptr noundef %146, i32 noundef %148, i32 noundef %153, i32 noundef %154, i64 noundef %156, i32 noundef %157)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %171

159:                                              ; preds = %130
  %160 = load i64, ptr %19, align 8, !tbaa !14
  %161 = getelementptr inbounds i32, ptr %122, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = icmp slt i32 %162, 0
  br i1 %163, label %164, label %165

164:                                              ; preds = %159
  call void @perror(ptr noundef @.str.12)
  call void @abort() #9
  unreachable

165:                                              ; preds = %159
  br label %166

166:                                              ; preds = %165
  br label %167

167:                                              ; preds = %166
  %168 = load i64, ptr %19, align 8, !tbaa !14
  %169 = add i64 %168, 1
  store i64 %169, ptr %19, align 8, !tbaa !14
  br label %123, !llvm.loop !16

170:                                              ; preds = %123
  store i32 0, ptr %21, align 4
  br label %171

171:                                              ; preds = %170, %144
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  %172 = load i32, ptr %21, align 4
  switch i32 %172, label %209 [
    i32 0, label %173
  ]

173:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %174 = call i32 @fork() #8
  store i32 %174, ptr %22, align 4, !tbaa !5
  %175 = load i32, ptr %22, align 4, !tbaa !5
  %176 = icmp eq i32 0, %175
  br i1 %176, label %177, label %182

177:                                              ; preds = %173
  %178 = load i32, ptr %4, align 4, !tbaa !5
  %179 = load ptr, ptr %5, align 8, !tbaa !9
  %180 = load i32, ptr %6, align 4, !tbaa !5
  %181 = call i32 @publish(i32 noundef %178, ptr noundef %179, i32 noundef %180)
  br label %187

182:                                              ; preds = %173
  %183 = load i32, ptr %22, align 4, !tbaa !5
  %184 = icmp sgt i32 0, %183
  br i1 %184, label %185, label %186

185:                                              ; preds = %182
  call void @perror(ptr noundef @.str.13)
  call void @abort() #9
  unreachable

186:                                              ; preds = %182
  br label %187

187:                                              ; preds = %186, %177
  %188 = load i32, ptr %7, align 4, !tbaa !5
  %189 = call i32 @sleep(i32 noundef %188)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  store i64 0, ptr %23, align 8, !tbaa !14
  br label %190

190:                                              ; preds = %200, %187
  %191 = load i64, ptr %23, align 8, !tbaa !14
  %192 = load i32, ptr %8, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = icmp ult i64 %191, %193
  br i1 %194, label %195, label %203

195:                                              ; preds = %190
  %196 = load i64, ptr %23, align 8, !tbaa !14
  %197 = getelementptr inbounds i32, ptr %122, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !5
  %199 = call i32 @kill(i32 noundef %198, i32 noundef 15) #8
  br label %200

200:                                              ; preds = %195
  %201 = load i64, ptr %23, align 8, !tbaa !14
  %202 = add i64 %201, 1
  store i64 %202, ptr %23, align 8, !tbaa !14
  br label %190, !llvm.loop !17

203:                                              ; preds = %190
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  %204 = load i32, ptr %22, align 4, !tbaa !5
  %205 = call i32 @kill(i32 noundef %204, i32 noundef 15) #8
  %206 = call i32 @usleep(i32 noundef 100000)
  %207 = load i32, ptr %16, align 4, !tbaa !5
  %208 = call i32 @kill(i32 noundef %207, i32 noundef 15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  store i32 0, ptr %21, align 4
  br label %209

209:                                              ; preds = %203, %171
  %210 = load ptr, ptr %17, align 8
  call void @llvm.stackrestore.p0(ptr %210)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  %211 = load i32, ptr %21, align 4
  switch i32 %211, label %214 [
    i32 0, label %212
    i32 1, label %212
  ]

212:                                              ; preds = %209, %209
  %213 = load i32, ptr %3, align 4
  ret i32 %213

214:                                              ; preds = %209
  unreachable
}

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

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

declare i32 @puts(ptr noundef) #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

; Function Attrs: nounwind
declare double @strtod(ptr noundef, ptr noundef) #2

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

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

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

; Function Attrs: nounwind
declare i32 @mq_open(ptr noundef, i32 noundef, ...) #2

declare void @perror(ptr noundef) #3

; Function Attrs: noreturn nounwind
declare void @abort() #4

; Function Attrs: nounwind
declare i32 @mq_unlink(ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fork() #2

; Function Attrs: nounwind uwtable
declare hidden void @time_print(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @make_realtime(i32 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #7

declare i32 @subscribe(i32 noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef, i32 noundef) #3

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

declare i32 @publish(i32 noundef, ptr noundef, i32 noundef) #3

declare i32 @sleep(i32 noundef) #3

; Function Attrs: nounwind
declare i32 @kill(i32 noundef, i32 noundef) #2

declare i32 @usleep(i32 noundef) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #7

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

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

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


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

%struct.mq_attr = type { i64, i64, i64, i64, [4 x i64] }

@mq_lat_attr = external dso_local global %struct.mq_attr, align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [304 x i8], align 1
@optind = external local_unnamed_addr global i32, align 4
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 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 [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #10
  br label %.outer

.outer:                                           ; preds = %41, %2
  %.056.ph = phi ptr [ %42, %41 ], [ @.str, %2 ]
  %.053.ph = phi i32 [ %.053.ph170, %41 ], [ 0, %2 ]
  %.051.ph = phi i32 [ %.051.ph175, %41 ], [ 1, %2 ]
  %.049.ph = phi i32 [ %.049.ph179, %41 ], [ 1, %2 ]
  %.048.ph = phi i32 [ %.048, %41 ], [ 1000, %2 ]
  br label %.outer169

.outer169:                                        ; preds = %.outer, %36
  %.053.ph170 = phi i32 [ %.053.ph, %.outer ], [ %38, %36 ]
  %.051.ph171 = phi i32 [ %.051.ph, %.outer ], [ %.051.ph175, %36 ]
  %.049.ph172 = phi i32 [ %.049.ph, %.outer ], [ %.049.ph179, %36 ]
  %.048.ph173 = phi i32 [ %.048.ph, %.outer ], [ %.048, %36 ]
  br label %.outer174

.outer174:                                        ; preds = %.outer169, %33
  %.051.ph175 = phi i32 [ %.051.ph171, %.outer169 ], [ %35, %33 ]
  %.049.ph176 = phi i32 [ %.049.ph172, %.outer169 ], [ %.049.ph179, %33 ]
  %.048.ph177 = phi i32 [ %.048.ph173, %.outer169 ], [ %.048, %33 ]
  br label %.outer178

.outer178:                                        ; preds = %.outer174, %23
  %.049.ph179 = phi i32 [ %.049.ph176, %.outer174 ], [ %26, %23 ]
  %.048.ph180 = phi i32 [ %.048.ph177, %.outer174 ], [ %.048, %23 ]
  br label %4

4:                                                ; preds = %.outer178, %13
  %.048 = phi i32 [ %16, %13 ], [ %.048.ph180, %.outer178 ]
  %5 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.1) #10
  switch i32 %5, label %41 [
    i32 -1, label %.preheader
    i32 86, label %11
    i32 102, label %13
    i32 116, label %23
    i32 115, label %33
    i32 83, label %36
    i32 63, label %39
  ]

.preheader:                                       ; preds = %4
  %optind.promoted = load i32, ptr @optind, align 4, !tbaa !5
  %6 = icmp slt i32 %optind.promoted, %0
  br i1 %6, label %.lr.ph.preheader, label %43

.lr.ph.preheader:                                 ; preds = %.preheader
  store i32 %0, ptr @optind, align 4, !tbaa !5
  %7 = sext i32 %0 to i64
  %8 = getelementptr ptr, ptr %1, i64 %7
  %9 = getelementptr i8, ptr %8, i64 -8
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  br label %43

11:                                               ; preds = %4
  %12 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  tail call void @exit(i32 noundef 0) #11
  unreachable

13:                                               ; preds = %4
  %14 = load ptr, ptr @optarg, align 8, !tbaa !9
  %15 = call double @strtod(ptr noundef %14, ptr noundef nonnull %3) #10
  %16 = fptosi double %15 to i32
  %17 = load ptr, ptr %3, align 8, !tbaa !9
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %4, !llvm.loop !11

19:                                               ; preds = %13
  %20 = load ptr, ptr @stderr, align 8, !tbaa !9
  %21 = load ptr, ptr @optarg, align 8, !tbaa !9
  %22 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str.3, ptr noundef %21) #12
  tail call void @exit(i32 noundef 1) #11
  unreachable

23:                                               ; preds = %4
  %24 = load ptr, ptr @optarg, align 8, !tbaa !9
  %25 = call double @strtod(ptr noundef %24, ptr noundef nonnull %3) #10
  %26 = fptosi double %25 to i32
  %27 = load ptr, ptr %3, align 8, !tbaa !9
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %.outer178, !llvm.loop !11

29:                                               ; preds = %23
  %30 = load ptr, ptr @stderr, align 8, !tbaa !9
  %31 = load ptr, ptr @optarg, align 8, !tbaa !9
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str.4, ptr noundef %31) #12
  tail call void @exit(i32 noundef 1) #11
  unreachable

33:                                               ; preds = %4
  %34 = load ptr, ptr @optarg, align 8, !tbaa !9
  %35 = tail call i32 @atoi(ptr nocapture noundef %34) #13
  br label %.outer174, !llvm.loop !11

36:                                               ; preds = %4
  %37 = load ptr, ptr @optarg, align 8, !tbaa !9
  %38 = tail call i32 @atoi(ptr nocapture noundef %37) #13
  br label %.outer169, !llvm.loop !11

39:                                               ; preds = %4
  %40 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.5)
  tail call void @exit(i32 noundef 0) #11
  unreachable

41:                                               ; preds = %4
  %42 = load ptr, ptr @optarg, align 8, !tbaa !9
  br label %.outer, !llvm.loop !11

43:                                               ; preds = %.lr.ph.preheader, %.preheader
  %.2.lcssa = phi ptr [ %10, %.lr.ph.preheader ], [ %.056.ph, %.preheader ]
  %44 = load ptr, ptr @stderr, align 8, !tbaa !9
  %45 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.6, ptr noundef %.2.lcssa) #12
  %46 = tail call i32 @strcasecmp(ptr noundef %.2.lcssa, ptr noundef nonnull @.str) #13
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %54, label %48

48:                                               ; preds = %43
  %49 = tail call i32 @strcasecmp(ptr noundef %.2.lcssa, ptr noundef nonnull @.str.7) #13
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %54, label %51

51:                                               ; preds = %48
  %52 = load ptr, ptr @stderr, align 8, !tbaa !9
  %53 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.8, ptr noundef %.2.lcssa) #12
  tail call void @exit(i32 noundef 1) #11
  unreachable

54:                                               ; preds = %48, %43
  %.055 = phi i32 [ 0, %43 ], [ 1, %48 ]
  %55 = tail call i32 (ptr, i32, ...) @mq_open(ptr noundef nonnull @.str.9, i32 noundef 2114, i32 noundef 384, ptr noundef nonnull @mq_lat_attr) #10
  %56 = icmp slt i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %54
  tail call void @perror(ptr noundef nonnull @.str.10) #14
  tail call void @abort() #11
  unreachable

58:                                               ; preds = %54
  %59 = tail call i32 @mq_unlink(ptr noundef nonnull @.str.9) #10
  %60 = tail call i32 @fork() #10
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %58
  tail call void @time_print(i32 noundef %55)
  br label %66

63:                                               ; preds = %58
  %64 = icmp slt i32 %60, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %63
  tail call void @perror(ptr noundef nonnull @.str.11) #14
  tail call void @abort() #11
  unreachable

66:                                               ; preds = %63, %62
  tail call void @make_realtime(i32 noundef 30)
  %67 = add nsw i32 %.051.ph175, %.053.ph170
  %68 = zext i32 %67 to i64
  %69 = tail call ptr @llvm.stacksave.p0()
  %70 = alloca i32, i64 %68, align 16
  %71 = sext i32 %67 to i64
  %.not6691.not = icmp eq i32 %67, 0
  br i1 %.not6691.not, label %.critedge, label %.lr.ph94

.lr.ph94:                                         ; preds = %66, %85
  %.04792 = phi i64 [ %86, %85 ], [ 0, %66 ]
  %72 = tail call i32 @fork() #10
  %73 = getelementptr inbounds i32, ptr %70, i64 %.04792
  store i32 %72, ptr %73, align 4, !tbaa !5
  %74 = icmp eq i32 %72, 0
  br i1 %74, label %75, label %82

75:                                               ; preds = %.lr.ph94
  %76 = sext i32 %.051.ph175 to i64
  %.not65 = icmp ult i64 %.04792, %76
  br i1 %.not65, label %78, label %77

77:                                               ; preds = %75
  tail call void @make_realtime(i32 noundef 0)
  br label %78

78:                                               ; preds = %77, %75
  %79 = trunc i64 %.04792 to i32
  %80 = zext i1 %.not65 to i32
  %81 = tail call i32 @subscribe(i32 noundef %0, ptr noundef %1, i32 noundef %79, i32 noundef %80, i32 noundef %.055, i64 noundef 120, i32 noundef %55) #10
  br label %104

82:                                               ; preds = %.lr.ph94
  %83 = icmp slt i32 %72, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %82
  tail call void @perror(ptr noundef nonnull @.str.12) #14
  tail call void @abort() #11
  unreachable

85:                                               ; preds = %82
  %86 = add nuw i64 %.04792, 1
  %exitcond.not = icmp eq i64 %86, %71
  br i1 %exitcond.not, label %.critedge, label %.lr.ph94, !llvm.loop !13

.critedge:                                        ; preds = %85, %66
  %87 = tail call i32 @fork() #10
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %89, label %91

89:                                               ; preds = %.critedge
  %90 = tail call i32 @publish(i32 noundef %0, ptr noundef %1, i32 noundef %.048) #10
  br label %94

91:                                               ; preds = %.critedge
  %92 = icmp slt i32 %87, 0
  br i1 %92, label %93, label %94

93:                                               ; preds = %91
  tail call void @perror(ptr noundef nonnull @.str.13) #14
  tail call void @abort() #11
  unreachable

94:                                               ; preds = %91, %89
  %95 = tail call i32 @sleep(i32 noundef %.049.ph179) #10
  %96 = sext i32 %.051.ph175 to i64
  %.not = icmp eq i32 %.051.ph175, 0
  br i1 %.not, label %._crit_edge98, label %.lr.ph97

.lr.ph97:                                         ; preds = %94, %.lr.ph97
  %.095 = phi i64 [ %100, %.lr.ph97 ], [ 0, %94 ]
  %97 = getelementptr inbounds i32, ptr %70, i64 %.095
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = tail call i32 @kill(i32 noundef %98, i32 noundef 15) #10
  %100 = add nuw i64 %.095, 1
  %exitcond122.not = icmp eq i64 %100, %96
  br i1 %exitcond122.not, label %._crit_edge98, label %.lr.ph97, !llvm.loop !14

._crit_edge98:                                    ; preds = %.lr.ph97, %94
  %101 = tail call i32 @kill(i32 noundef %87, i32 noundef 15) #10
  %102 = tail call i32 @usleep(i32 noundef 100000) #10
  %103 = tail call i32 @kill(i32 noundef %60, i32 noundef 15) #10
  br label %104

104:                                              ; preds = %78, %._crit_edge98
  tail call void @llvm.stackrestore.p0(ptr %69)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  ret i32 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: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

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

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

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

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

; Function Attrs: nounwind
declare i32 @mq_open(ptr noundef, i32 noundef, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #4

; Function Attrs: nounwind
declare i32 @mq_unlink(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare i32 @fork() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @time_print(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @make_realtime(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #8

declare i32 @subscribe(i32 noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef, i32 noundef) local_unnamed_addr #9

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

declare i32 @publish(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #9

declare i32 @sleep(i32 noundef) local_unnamed_addr #9

; Function Attrs: nounwind
declare i32 @kill(i32 noundef, i32 noundef) local_unnamed_addr #2

declare i32 @usleep(i32 noundef) local_unnamed_addr #9

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #8

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

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

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


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