; LLVM IR from SvrAdityaReddy/RTOS :: Assignment_4/message_queues (message_queue_server)

; 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] }

@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [32 x i8], align 1

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

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

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

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

; 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
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 %struct.mq_attr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  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) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  %16 = getelementptr inbounds %struct.mq_attr, ptr %8, i32 0, i32 0
  store i64 0, ptr %16, align 8, !tbaa !11
  %17 = getelementptr inbounds %struct.mq_attr, ptr %8, i32 0, i32 1
  store i64 10, ptr %17, align 8, !tbaa !14
  %18 = getelementptr inbounds %struct.mq_attr, ptr %8, i32 0, i32 2
  store i64 256, ptr %18, align 8, !tbaa !15
  %19 = getelementptr inbounds %struct.mq_attr, ptr %8, i32 0, i32 3
  store i64 0, ptr %19, align 8, !tbaa !16
  %20 = call i32 @mq_unlink(ptr noundef @.str.5) #6
  %21 = call i32 (ptr, i32, ...) @mq_open(ptr noundef @.str.5, i32 noundef 66, i32 noundef 436, ptr noundef %8) #6
  store i32 %21, ptr %6, align 4, !tbaa !5
  %22 = load i32, ptr %6, align 4, !tbaa !5
  %23 = icmp eq i32 %22, -1
  br i1 %23, label %24, label %26

24:                                               ; preds = %2
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %102

26:                                               ; preds = %2
  %27 = getelementptr inbounds %struct.mq_attr, ptr %8, i32 0, i32 2
  %28 = load i64, ptr %27, align 8, !tbaa !15
  %29 = mul i64 1, %28
  %30 = call noalias ptr @malloc(i64 noundef %29) #7
  store ptr %30, ptr %9, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %101, %26
  br label %32

32:                                               ; preds = %31
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = load ptr, ptr %9, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.mq_attr, ptr %8, i32 0, i32 2
  %36 = load i64, ptr %35, align 8, !tbaa !15
  %37 = call i64 @mq_receive(i32 noundef %33, ptr noundef %34, i64 noundef %36, ptr noundef null)
  %38 = icmp eq i64 %37, -1
  br i1 %38, label %39, label %43

39:                                               ; preds = %32
  %40 = call i32 @mq_unlink(ptr noundef @.str.5) #6
  %41 = load ptr, ptr %9, align 8, !tbaa !9
  call void @free(ptr noundef %41) #6
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %102

43:                                               ; preds = %32
  %44 = load ptr, ptr %9, align 8, !tbaa !9
  %45 = call ptr @strtok(ptr noundef %44, ptr noundef @.str.8) #6
  store ptr %45, ptr %10, align 8, !tbaa !9
  %46 = call ptr @strtok(ptr noundef null, ptr noundef @.str.8) #6
  store ptr %46, ptr %11, align 8, !tbaa !9
  %47 = load ptr, ptr %10, align 8, !tbaa !9
  %48 = load ptr, ptr %11, align 8, !tbaa !9
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef %47, ptr noundef %48)
  %50 = call noalias ptr @malloc(i64 noundef 8) #7
  store ptr %50, ptr %12, align 8, !tbaa !9
  %51 = load ptr, ptr %12, align 8, !tbaa !9
  %52 = call ptr @strncat(ptr noundef %51, ptr noundef @.str.10, i64 noundef 2) #6
  %53 = load ptr, ptr %12, align 8, !tbaa !9
  %54 = load ptr, ptr %10, align 8, !tbaa !9
  %55 = load ptr, ptr %10, align 8, !tbaa !9
  %56 = call i64 @strlen(ptr noundef %55) #8
  %57 = call ptr @strncat(ptr noundef %53, ptr noundef %54, i64 noundef %56) #6
  %58 = load ptr, ptr %12, align 8, !tbaa !9
  %59 = call ptr @strncat(ptr noundef %58, ptr noundef @.str.11, i64 noundef 7) #6
  %60 = load ptr, ptr %12, align 8, !tbaa !9
  %61 = call i32 (ptr, i32, ...) @mq_open(ptr noundef %60, i32 noundef 1) #6
  store i32 %61, ptr %7, align 4, !tbaa !5
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = icmp eq i32 %62, -1
  br i1 %63, label %64, label %68

64:                                               ; preds = %43
  %65 = load ptr, ptr %10, align 8, !tbaa !9
  %66 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, ptr noundef %65)
  %67 = call i32 @mq_unlink(ptr noundef @.str.5) #6
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %102

68:                                               ; preds = %43
  %69 = load ptr, ptr %11, align 8, !tbaa !9
  %70 = call i32 @evaluate(ptr noundef %69)
  store i32 %70, ptr %14, align 4, !tbaa !5
  %71 = load i32, ptr %14, align 4, !tbaa !5
  %72 = icmp eq i32 %71, -2147483648
  br i1 %72, label %73, label %75

73:                                               ; preds = %68
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  br label %80

75:                                               ; preds = %68
  %76 = load ptr, ptr %10, align 8, !tbaa !9
  %77 = load ptr, ptr %11, align 8, !tbaa !9
  %78 = load i32, ptr %14, align 4, !tbaa !5
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, ptr noundef %76, ptr noundef %77, i32 noundef %78)
  br label %80

80:                                               ; preds = %75, %73
  %81 = call noalias ptr @malloc(i64 noundef 100) #7
  store ptr %81, ptr %13, align 8, !tbaa !9
  %82 = load i32, ptr %14, align 4, !tbaa !5
  %83 = icmp eq i32 %82, -2147483648
  br i1 %83, label %84, label %87

84:                                               ; preds = %80
  %85 = load ptr, ptr %13, align 8, !tbaa !9
  %86 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %85, i64 noundef 100, ptr noundef @.str.15, ptr noundef @.str.16) #6
  br label %91

87:                                               ; preds = %80
  %88 = load ptr, ptr %13, align 8, !tbaa !9
  %89 = load i32, ptr %14, align 4, !tbaa !5
  %90 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %88, i64 noundef 100, ptr noundef @.str.17, i32 noundef %89) #6
  br label %91

91:                                               ; preds = %87, %84
  %92 = load i32, ptr %7, align 4, !tbaa !5
  %93 = load ptr, ptr %13, align 8, !tbaa !9
  %94 = call i32 @mq_send(i32 noundef %92, ptr noundef %93, i64 noundef 100, i32 noundef 0)
  %95 = icmp eq i32 %94, -1
  br i1 %95, label %96, label %101

96:                                               ; preds = %91
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = call i32 @mq_close(i32 noundef %97) #6
  %99 = load ptr, ptr %10, align 8, !tbaa !9
  %100 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, ptr noundef %99)
  br label %101

101:                                              ; preds = %96, %91
  br label %31

102:                                              ; preds = %64, %39, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %103 = load i32, ptr %3, align 4
  ret i32 %103
}

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

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

declare i64 @mq_receive(i32 noundef, ptr noundef, i64 noundef, ptr noundef) #4

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

; Function Attrs: nounwind
declare ptr @strncat(ptr noundef, ptr noundef, i64 noundef) #3

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

declare i32 @mq_send(i32 noundef, ptr noundef, i64 noundef, i32 noundef) #4

; Function Attrs: nounwind
declare i32 @mq_close(i32 noundef) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { "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 allocsize(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 }
attributes #7 = { nounwind allocsize(0) }
attributes #8 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!12, !13, i64 0}
!12 = !{!"mq_attr", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !7, i64 32}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!12, !13, i64 16}
!16 = !{!12, !13, i64 24}


; 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] }

@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @evaluate(ptr 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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn
declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) 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
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca %struct.mq_attr, align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #10
  store i64 0, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 8
  store i64 10, ptr %4, align 8, !tbaa !10
  %5 = getelementptr inbounds i8, ptr %3, i64 16
  store i64 256, ptr %5, align 8, !tbaa !11
  %6 = getelementptr inbounds i8, ptr %3, i64 24
  store i64 0, ptr %6, align 8, !tbaa !12
  %7 = tail call i32 @mq_unlink(ptr noundef nonnull @.str.5) #10
  %8 = call i32 (ptr, i32, ...) @mq_open(ptr noundef nonnull @.str.5, i32 noundef 66, i32 noundef 436, ptr noundef nonnull %3) #10
  %9 = icmp eq i32 %8, -1
  br i1 %9, label %10, label %12

10:                                               ; preds = %2
  %11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  br label %54

12:                                               ; preds = %2
  %13 = load i64, ptr %5, align 8, !tbaa !11
  %14 = call noalias ptr @malloc(i64 noundef %13) #11
  %15 = call i64 @mq_receive(i32 noundef %8, ptr noundef %14, i64 noundef %13, ptr noundef null) #10
  %16 = icmp eq i64 %15, -1
  br i1 %16, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %50, %12
  %17 = call i32 @mq_unlink(ptr noundef nonnull @.str.5) #10
  call void @free(ptr noundef %14) #10
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  br label %54

.lr.ph:                                           ; preds = %12, %50
  %19 = call ptr @strtok(ptr noundef %14, ptr noundef nonnull @.str.8) #10
  %20 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.8) #10
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef %19, ptr noundef %20)
  %22 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #11
  %23 = call ptr @strncat(ptr noundef nonnull dereferenceable(1) %22, ptr noundef nonnull dereferenceable(1) @.str.10, i64 noundef 2) #10
  %24 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %19) #12
  %25 = call ptr @strncat(ptr noundef nonnull dereferenceable(1) %22, ptr noundef %19, i64 noundef %24) #10
  %26 = call ptr @strncat(ptr noundef nonnull dereferenceable(1) %22, ptr noundef nonnull dereferenceable(1) @.str.11, i64 noundef 7) #10
  %27 = call i32 (ptr, i32, ...) @mq_open(ptr noundef %22, i32 noundef 1) #10
  %28 = icmp eq i32 %27, -1
  br i1 %28, label %29, label %32

29:                                               ; preds = %.lr.ph
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %19)
  %31 = call i32 @mq_unlink(ptr noundef nonnull @.str.5) #10
  br label %54

32:                                               ; preds = %.lr.ph
  %33 = call i32 @evaluate(ptr noundef %20)
  %34 = icmp eq i32 %33, -2147483648
  br i1 %34, label %35, label %39

35:                                               ; preds = %32
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %37 = call noalias dereferenceable_or_null(100) ptr @malloc(i64 noundef 100) #11
  %38 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %37, i64 noundef 100, ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.16) #10
  br label %43

39:                                               ; preds = %32
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, ptr noundef %19, ptr noundef %20, i32 noundef %33)
  %41 = call noalias dereferenceable_or_null(100) ptr @malloc(i64 noundef 100) #11
  %42 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %41, i64 noundef 100, ptr noundef nonnull @.str.17, i32 noundef %33) #10
  br label %43

43:                                               ; preds = %39, %35
  %44 = phi ptr [ %41, %39 ], [ %37, %35 ]
  %45 = call i32 @mq_send(i32 noundef %27, ptr noundef %44, i64 noundef 100, i32 noundef 0) #10
  %46 = icmp eq i32 %45, -1
  br i1 %46, label %47, label %50

47:                                               ; preds = %43
  %48 = call i32 @mq_close(i32 noundef %27) #10
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, ptr noundef %19)
  br label %50

50:                                               ; preds = %47, %43
  %51 = load i64, ptr %5, align 8, !tbaa !11
  %52 = call i64 @mq_receive(i32 noundef %8, ptr noundef %14, i64 noundef %51, ptr noundef null) #10
  %53 = icmp eq i64 %52, -1
  br i1 %53, label %._crit_edge, label %.lr.ph

54:                                               ; preds = %29, %._crit_edge, %10
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #10
  ret i32 0
}

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #6

declare i64 @mq_receive(i32 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #8

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #9

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

declare i32 @mq_send(i32 noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #7

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

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 = { 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 #3 = { 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 #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 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 #6 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 #7 = { "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 nounwind willreturn allockind("free") 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 #9 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 = { nounwind allocsize(0) }
attributes #12 = { 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 0}
!6 = !{!"mq_attr", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !8, i64 32}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!6, !7, i64 16}
!12 = !{!6, !7, i64 24}


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