; LLVM IR from seppo0010/rlite :: src (scripting)

; 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.rliteClient = type { i32, ptr, ptr, ptr, ptr, i32 }
%struct.rliteReply = type { i32, i64, i32, ptr, i64, ptr }

@lua_write_dirty = external hidden global i32, align 4
@lua_kill = external hidden global i32, align 4
@lua_caller = external hidden global ptr, align 8
@.str.67 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [194 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [50 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @sha1hex(ptr noundef, ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @scriptingReset() #1

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

declare ptr @createLongLongObject(i64 noundef) #2

declare ptr @createArrayObject(i64 noundef) #2

declare ptr @createErrorObject(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @setScript(ptr noundef, ptr noundef, i64 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @scriptCommand(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca [41 x i8], align 16
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.rliteClient, ptr %5, i32 0, i32 0
  %7 = load i32, ptr %6, align 8, !tbaa !9
  %8 = icmp eq i32 %7, 2
  br i1 %8, label %9, label %21

9:                                                ; preds = %1
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.rliteClient, ptr %10, i32 0, i32 1
  %12 = load ptr, ptr %11, align 8, !tbaa !12
  %13 = getelementptr inbounds ptr, ptr %12, i64 1
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  %15 = call i32 @strcasecmp(ptr noundef %14, ptr noundef @.str.67) #4
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %21, label %17

17:                                               ; preds = %9
  call void @scriptingReset()
  %18 = call ptr @createStatusObject(ptr noundef @.str.68)
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.rliteClient, ptr %19, i32 0, i32 3
  store ptr %18, ptr %20, align 8, !tbaa !13
  br label %158

21:                                               ; preds = %9, %1
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.rliteClient, ptr %22, i32 0, i32 0
  %24 = load i32, ptr %23, align 8, !tbaa !9
  %25 = icmp sge i32 %24, 2
  br i1 %25, label %26, label %77

26:                                               ; preds = %21
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.rliteClient, ptr %27, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !12
  %30 = getelementptr inbounds ptr, ptr %29, i64 1
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  %32 = call i32 @strcasecmp(ptr noundef %31, ptr noundef @.str.69) #4
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %77, label %34

34:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.rliteClient, ptr %35, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !9
  %38 = sub nsw i32 %37, 2
  %39 = sext i32 %38 to i64
  %40 = call ptr @createArrayObject(i64 noundef %39)
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.rliteClient, ptr %41, i32 0, i32 3
  store ptr %40, ptr %42, align 8, !tbaa !13
  store i32 2, ptr %3, align 4, !tbaa !14
  br label %43

43:                                               ; preds = %73, %34
  %44 = load i32, ptr %3, align 4, !tbaa !14
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.rliteClient, ptr %45, i32 0, i32 0
  %47 = load i32, ptr %46, align 8, !tbaa !9
  %48 = icmp slt i32 %44, %47
  br i1 %48, label %49, label %76

49:                                               ; preds = %43
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.rliteClient, ptr %51, i32 0, i32 1
  %53 = load ptr, ptr %52, align 8, !tbaa !12
  %54 = load i32, ptr %3, align 4, !tbaa !14
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds ptr, ptr %53, i64 %55
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  %58 = call i32 @getScript(ptr noundef %50, ptr noundef %57, ptr noundef null, ptr noundef null)
  %59 = icmp eq i32 %58, 0
  %60 = zext i1 %59 to i64
  %61 = select i1 %59, i32 1, i32 0
  %62 = sext i32 %61 to i64
  %63 = call ptr @createLongLongObject(i64 noundef %62)
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.rliteClient, ptr %64, i32 0, i32 3
  %66 = load ptr, ptr %65, align 8, !tbaa !13
  %67 = getelementptr inbounds %struct.rliteReply, ptr %66, i32 0, i32 5
  %68 = load ptr, ptr %67, align 8, !tbaa !15
  %69 = load i32, ptr %3, align 4, !tbaa !14
  %70 = sub nsw i32 %69, 2
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds ptr, ptr %68, i64 %71
  store ptr %63, ptr %72, align 8, !tbaa !5
  br label %73

73:                                               ; preds = %49
  %74 = load i32, ptr %3, align 4, !tbaa !14
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %3, align 4, !tbaa !14
  br label %43, !llvm.loop !19

76:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %157

77:                                               ; preds = %26, %21
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.rliteClient, ptr %78, i32 0, i32 0
  %80 = load i32, ptr %79, align 8, !tbaa !9
  %81 = icmp eq i32 %80, 3
  br i1 %81, label %82, label %118

82:                                               ; preds = %77
  %83 = load ptr, ptr %2, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.rliteClient, ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !12
  %86 = getelementptr inbounds ptr, ptr %85, i64 1
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  %88 = call i32 @strcasecmp(ptr noundef %87, ptr noundef @.str.70) #4
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %118, label %90

90:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 41, ptr %4) #5
  %91 = getelementptr inbounds [41 x i8], ptr %4, i64 0, i64 0
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.rliteClient, ptr %92, i32 0, i32 1
  %94 = load ptr, ptr %93, align 8, !tbaa !12
  %95 = getelementptr inbounds ptr, ptr %94, i64 2
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.rliteClient, ptr %97, i32 0, i32 2
  %99 = load ptr, ptr %98, align 8, !tbaa !21
  %100 = getelementptr inbounds i64, ptr %99, i64 2
  %101 = load i64, ptr %100, align 8, !tbaa !22
  call void @sha1hex(ptr noundef %91, ptr noundef %96, i64 noundef %101)
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = load ptr, ptr %2, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.rliteClient, ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !12
  %106 = getelementptr inbounds ptr, ptr %105, i64 2
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  %108 = load ptr, ptr %2, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.rliteClient, ptr %108, i32 0, i32 2
  %110 = load ptr, ptr %109, align 8, !tbaa !21
  %111 = getelementptr inbounds i64, ptr %110, i64 2
  %112 = load i64, ptr %111, align 8, !tbaa !22
  %113 = call i32 @setScript(ptr noundef %102, ptr noundef %107, i64 noundef %112)
  %114 = getelementptr inbounds [41 x i8], ptr %4, i64 0, i64 0
  %115 = call ptr @createStringObject(ptr noundef %114, i32 noundef 40)
  %116 = load ptr, ptr %2, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.rliteClient, ptr %116, i32 0, i32 3
  store ptr %115, ptr %117, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 41, ptr %4) #5
  br label %156

118:                                              ; preds = %82, %77
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.rliteClient, ptr %119, i32 0, i32 0
  %121 = load i32, ptr %120, align 8, !tbaa !9
  %122 = icmp eq i32 %121, 2
  br i1 %122, label %123, label %151

123:                                              ; preds = %118
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.rliteClient, ptr %124, i32 0, i32 1
  %126 = load ptr, ptr %125, align 8, !tbaa !12
  %127 = getelementptr inbounds ptr, ptr %126, i64 1
  %128 = load ptr, ptr %127, align 8, !tbaa !5
  %129 = call i32 @strcasecmp(ptr noundef %128, ptr noundef @.str.71) #4
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %151, label %131

131:                                              ; preds = %123
  %132 = load ptr, ptr @lua_caller, align 8, !tbaa !5
  %133 = icmp eq ptr %132, null
  br i1 %133, label %134, label %138

134:                                              ; preds = %131
  %135 = call ptr @createCStringObject(ptr noundef @.str.72)
  %136 = load ptr, ptr %2, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.rliteClient, ptr %136, i32 0, i32 3
  store ptr %135, ptr %137, align 8, !tbaa !13
  br label %150

138:                                              ; preds = %131
  %139 = load i32, ptr @lua_write_dirty, align 4, !tbaa !14
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %141, label %145

141:                                              ; preds = %138
  %142 = call ptr @createCStringObject(ptr noundef @.str.73)
  %143 = load ptr, ptr %2, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.rliteClient, ptr %143, i32 0, i32 3
  store ptr %142, ptr %144, align 8, !tbaa !13
  br label %149

145:                                              ; preds = %138
  store i32 1, ptr @lua_kill, align 4, !tbaa !14
  %146 = call ptr @createStatusObject(ptr noundef @.str.68)
  %147 = load ptr, ptr %2, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.rliteClient, ptr %147, i32 0, i32 3
  store ptr %146, ptr %148, align 8, !tbaa !13
  br label %149

149:                                              ; preds = %145, %141
  br label %150

150:                                              ; preds = %149, %134
  br label %155

151:                                              ; preds = %123, %118
  %152 = call ptr @createErrorObject(ptr noundef @.str.74)
  %153 = load ptr, ptr %2, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.rliteClient, ptr %153, i32 0, i32 3
  store ptr %152, ptr %154, align 8, !tbaa !13
  br label %155

155:                                              ; preds = %151, %150
  br label %156

156:                                              ; preds = %155, %90
  br label %157

157:                                              ; preds = %156, %76
  br label %158

158:                                              ; preds = %157, %17
  ret void
}

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

declare ptr @createStatusObject(ptr noundef) #2

declare ptr @createCStringObject(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind 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 #4 = { nounwind willreturn memory(read) }
attributes #5 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"rliteClient", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!10, !6, i64 24}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !6, i64 40}
!16 = !{!"rliteReply", !11, i64 0, !17, i64 8, !11, i64 16, !6, i64 24, !18, i64 32, !6, i64 40}
!17 = !{!"long long", !7, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!10, !6, i64 16}
!22 = !{!18, !18, i64 0}


; 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"

@lua_write_dirty = external hidden local_unnamed_addr global i32, align 4
@lua_kill = external hidden local_unnamed_addr global i32, align 4
@lua_caller = external hidden local_unnamed_addr global ptr, align 8
@.str.67 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [194 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [50 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @sha1hex(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @scriptingReset() local_unnamed_addr #1

declare ptr @createStringObject(ptr noundef, i32 noundef) local_unnamed_addr #2

declare ptr @createLongLongObject(i64 noundef) local_unnamed_addr #2

declare ptr @createArrayObject(i64 noundef) local_unnamed_addr #2

declare ptr @createErrorObject(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @setScript(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @scriptCommand(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca [41 x i8], align 16
  %3 = load i32, ptr %0, align 8, !tbaa !5
  %4 = icmp eq i32 %3, 2
  br i1 %4, label %5, label %14

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !11
  %8 = getelementptr inbounds i8, ptr %7, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !12
  %10 = tail call i32 @strcasecmp(ptr noundef %9, ptr noundef nonnull @.str.67) #4
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %11, label %.thread.thread

11:                                               ; preds = %5
  tail call void @scriptingReset()
  %12 = tail call ptr @createStatusObject(ptr noundef nonnull @.str.68) #5
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %12, ptr %13, align 8, !tbaa !13
  br label %.loopexit

14:                                               ; preds = %1
  %15 = icmp sgt i32 %3, 1
  br i1 %15, label %.thread, label %.thread34

.thread:                                          ; preds = %14
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 8
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !11
  %.phi.trans.insert37 = getelementptr inbounds i8, ptr %.pre, i64 8
  %.pre38 = load ptr, ptr %.phi.trans.insert37, align 8, !tbaa !12
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = tail call i32 @strcasecmp(ptr noundef %.pre38, ptr noundef nonnull @.str.69) #4
  %.not29 = icmp eq i32 %17, 0
  br i1 %.not29, label %20, label %43

.thread.thread:                                   ; preds = %5
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = tail call i32 @strcasecmp(ptr noundef %9, ptr noundef nonnull @.str.69) #4
  %.not2939 = icmp eq i32 %19, 0
  br i1 %.not2939, label %20, label %63

20:                                               ; preds = %.thread.thread, %.thread
  %21 = phi ptr [ %18, %.thread.thread ], [ %16, %.thread ]
  %22 = add nsw i32 %3, -2
  %23 = zext nneg i32 %22 to i64
  %24 = tail call ptr @createArrayObject(i64 noundef %23) #5
  %25 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %24, ptr %25, align 8, !tbaa !13
  %26 = load i32, ptr %0, align 8, !tbaa !5
  %27 = icmp sgt i32 %26, 2
  br i1 %27, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %20, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 2, %20 ]
  %28 = load ptr, ptr %21, align 8, !tbaa !11
  %29 = getelementptr inbounds ptr, ptr %28, i64 %indvars.iv
  %30 = load ptr, ptr %29, align 8, !tbaa !12
  %31 = tail call i32 @getScript(ptr noundef nonnull %0, ptr noundef %30, ptr noundef null, ptr noundef null)
  %32 = icmp eq i32 %31, 0
  %33 = zext i1 %32 to i64
  %34 = tail call ptr @createLongLongObject(i64 noundef %33) #5
  %35 = load ptr, ptr %25, align 8, !tbaa !13
  %36 = getelementptr inbounds i8, ptr %35, i64 40
  %37 = load ptr, ptr %36, align 8, !tbaa !14
  %38 = getelementptr ptr, ptr %37, i64 %indvars.iv
  %39 = getelementptr i8, ptr %38, i64 -16
  store ptr %34, ptr %39, align 8, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = load i32, ptr %0, align 8, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = icmp slt i64 %indvars.iv.next, %41
  br i1 %42, label %.lr.ph, label %.loopexit, !llvm.loop !18

43:                                               ; preds = %.thread
  %44 = icmp eq i32 %3, 3
  br i1 %44, label %45, label %.thread34

45:                                               ; preds = %43
  %46 = tail call i32 @strcasecmp(ptr noundef %.pre38, ptr noundef nonnull @.str.70) #4
  %.not30 = icmp eq i32 %46, 0
  br i1 %.not30, label %47, label %.thread34

47:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 41, ptr nonnull %2) #5
  %48 = getelementptr inbounds i8, ptr %.pre, i64 16
  %49 = load ptr, ptr %48, align 8, !tbaa !12
  %50 = getelementptr inbounds i8, ptr %0, i64 16
  %51 = load ptr, ptr %50, align 8, !tbaa !20
  %52 = getelementptr inbounds i8, ptr %51, i64 16
  %53 = load i64, ptr %52, align 8, !tbaa !21
  call void @sha1hex(ptr noundef nonnull %2, ptr noundef %49, i64 noundef %53)
  %54 = load ptr, ptr %16, align 8, !tbaa !11
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  %56 = load ptr, ptr %55, align 8, !tbaa !12
  %57 = load ptr, ptr %50, align 8, !tbaa !20
  %58 = getelementptr inbounds i8, ptr %57, i64 16
  %59 = load i64, ptr %58, align 8, !tbaa !21
  %60 = call i32 @setScript(ptr noundef nonnull %0, ptr noundef %56, i64 noundef %59)
  %61 = call ptr @createStringObject(ptr noundef nonnull %2, i32 noundef 40) #5
  %62 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %61, ptr %62, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 41, ptr nonnull %2) #5
  br label %.loopexit

63:                                               ; preds = %.thread.thread
  %64 = tail call i32 @strcasecmp(ptr noundef %9, ptr noundef nonnull @.str.71) #4
  %.not31 = icmp eq i32 %64, 0
  br i1 %.not31, label %65, label %.thread34

65:                                               ; preds = %63
  %66 = load ptr, ptr @lua_caller, align 8, !tbaa !12
  %67 = icmp eq ptr %66, null
  br i1 %67, label %68, label %71

68:                                               ; preds = %65
  %69 = tail call ptr @createCStringObject(ptr noundef nonnull @.str.72) #5
  %70 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %69, ptr %70, align 8, !tbaa !13
  br label %.loopexit

71:                                               ; preds = %65
  %72 = load i32, ptr @lua_write_dirty, align 4, !tbaa !22
  %.not32 = icmp eq i32 %72, 0
  br i1 %.not32, label %76, label %73

73:                                               ; preds = %71
  %74 = tail call ptr @createCStringObject(ptr noundef nonnull @.str.73) #5
  %75 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %74, ptr %75, align 8, !tbaa !13
  br label %.loopexit

76:                                               ; preds = %71
  store i32 1, ptr @lua_kill, align 4, !tbaa !22
  %77 = tail call ptr @createStatusObject(ptr noundef nonnull @.str.68) #5
  %78 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %77, ptr %78, align 8, !tbaa !13
  br label %.loopexit

.thread34:                                        ; preds = %43, %14, %45, %63
  %79 = tail call ptr @createErrorObject(ptr noundef nonnull @.str.74) #5
  %80 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %79, ptr %80, align 8, !tbaa !13
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %20, %.thread34, %73, %76, %68, %47, %11
  ret void
}

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

declare ptr @createStatusObject(ptr noundef) local_unnamed_addr #2

declare ptr @createCStringObject(ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(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 #4 = { nounwind willreturn memory(read) }
attributes #5 = { 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, !7, i64 0}
!6 = !{!"rliteClient", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!10, !10, i64 0}
!13 = !{!6, !10, i64 24}
!14 = !{!15, !10, i64 40}
!15 = !{!"rliteReply", !7, i64 0, !16, i64 8, !7, i64 16, !10, i64 24, !17, i64 32, !10, i64 40}
!16 = !{!"long long", !8, i64 0}
!17 = !{!"long", !8, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!6, !10, i64 16}
!21 = !{!17, !17, i64 0}
!22 = !{!7, !7, i64 0}


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