; LLVM IR from marcinbor85/microshell :: src/src/commands (ush_cmd_ls)

; 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.ush_object = type { ptr, i32, i32, i32, ptr, i64, i64, i32, i64, i64, i64, i8, ptr, ptr, ptr, %struct.ush_node_object, ptr, ptr, ptr, i64, i64, ptr, i64, i32, i32, ptr, ptr, ptr, i64, i64, i64 }
%struct.ush_node_object = type { ptr, i64, ptr, ptr, ptr, ptr }
%struct.ush_file_descriptor = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.ush_descriptor = type { ptr, ptr, i64, ptr, i64, i64, ptr, ptr }

@.str = external hidden unnamed_addr constant [38 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @ush_buildin_cmd_ls_service(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #4
  store i8 1, ptr %5, align 1, !tbaa !9
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.ush_object, ptr %13, i32 0, i32 1
  %15 = load i32, ptr %14, align 8, !tbaa !11
  switch i32 %15, label %246 [
    i32 14, label %16
    i32 15, label %37
    i32 16, label %93
  ]

16:                                               ; preds = %2
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.ush_object, ptr %17, i32 0, i32 16
  %19 = load ptr, ptr %18, align 8, !tbaa !16
  %20 = getelementptr inbounds %struct.ush_node_object, ptr %19, i32 0, i32 3
  %21 = load ptr, ptr %20, align 8, !tbaa !17
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %25

23:                                               ; preds = %16
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  call void @ush_write_pointer(ptr noundef %24, ptr noundef @.str, i32 noundef 15)
  br label %27

25:                                               ; preds = %16
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  call void @ush_write_pointer(ptr noundef %26, ptr noundef @.str.1, i32 noundef 15)
  br label %27

27:                                               ; preds = %25, %23
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.ush_object, ptr %28, i32 0, i32 16
  %30 = load ptr, ptr %29, align 8, !tbaa !16
  %31 = getelementptr inbounds %struct.ush_node_object, ptr %30, i32 0, i32 4
  %32 = load ptr, ptr %31, align 8, !tbaa !18
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ush_object, ptr %33, i32 0, i32 17
  store ptr %32, ptr %34, align 8, !tbaa !19
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.ush_object, ptr %35, i32 0, i32 19
  store i64 0, ptr %36, align 8, !tbaa !20
  br label %247

37:                                               ; preds = %2
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.ush_object, ptr %38, i32 0, i32 17
  %40 = load ptr, ptr %39, align 8, !tbaa !19
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %49

42:                                               ; preds = %37
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.ush_object, ptr %43, i32 0, i32 19
  store i64 0, ptr %44, align 8, !tbaa !20
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ush_object, ptr %45, i32 0, i32 20
  store i64 0, ptr %46, align 8, !tbaa !21
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.ush_object, ptr %47, i32 0, i32 1
  store i32 16, ptr %48, align 8, !tbaa !11
  br label %247

49:                                               ; preds = %37
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.ush_object, ptr %50, i32 0, i32 19
  %52 = load i64, ptr %51, align 8, !tbaa !20
  switch i64 %52, label %91 [
    i64 0, label %53
    i64 1, label %60
    i64 2, label %74
    i64 3, label %81
  ]

53:                                               ; preds = %49
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.ush_object, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 8, !tbaa !11
  call void @ush_write_pointer(ptr noundef %54, ptr noundef @.str.2, i32 noundef %57)
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ush_object, ptr %58, i32 0, i32 19
  store i64 1, ptr %59, align 8, !tbaa !20
  br label %92

60:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ush_object, ptr %61, i32 0, i32 17
  %63 = load ptr, ptr %62, align 8, !tbaa !19
  %64 = getelementptr inbounds %struct.ush_node_object, ptr %63, i32 0, i32 2
  %65 = load ptr, ptr %64, align 8, !tbaa !22
  %66 = call ptr @ush_utils_path_last(ptr noundef %65)
  store ptr %66, ptr %6, align 8, !tbaa !5
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ush_object, ptr %69, i32 0, i32 1
  %71 = load i32, ptr %70, align 8, !tbaa !11
  call void @ush_write_pointer(ptr noundef %67, ptr noundef %68, i32 noundef %71)
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.ush_object, ptr %72, i32 0, i32 19
  store i64 2, ptr %73, align 8, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %92

74:                                               ; preds = %49
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.ush_object, ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 8, !tbaa !11
  call void @ush_write_pointer(ptr noundef %75, ptr noundef @.str.3, i32 noundef %78)
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.ush_object, ptr %79, i32 0, i32 19
  store i64 3, ptr %80, align 8, !tbaa !20
  br label %92

81:                                               ; preds = %49
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.ush_object, ptr %82, i32 0, i32 19
  store i64 0, ptr %83, align 8, !tbaa !20
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.ush_object, ptr %84, i32 0, i32 17
  %86 = load ptr, ptr %85, align 8, !tbaa !19
  %87 = getelementptr inbounds %struct.ush_node_object, ptr %86, i32 0, i32 5
  %88 = load ptr, ptr %87, align 8, !tbaa !23
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.ush_object, ptr %89, i32 0, i32 17
  store ptr %88, ptr %90, align 8, !tbaa !19
  br label %92

91:                                               ; preds = %49
  br label %92

92:                                               ; preds = %91, %81, %74, %60, %53
  br label %247

93:                                               ; preds = %2
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ush_object, ptr %94, i32 0, i32 20
  %96 = load i64, ptr %95, align 8, !tbaa !21
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.ush_object, ptr %97, i32 0, i32 16
  %99 = load ptr, ptr %98, align 8, !tbaa !16
  %100 = getelementptr inbounds %struct.ush_node_object, ptr %99, i32 0, i32 1
  %101 = load i64, ptr %100, align 8, !tbaa !24
  %102 = icmp uge i64 %96, %101
  br i1 %102, label %103, label %106

103:                                              ; preds = %93
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.ush_object, ptr %104, i32 0, i32 1
  store i32 1, ptr %105, align 8, !tbaa !11
  br label %247

106:                                              ; preds = %93
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.ush_object, ptr %107, i32 0, i32 16
  %109 = load ptr, ptr %108, align 8, !tbaa !16
  %110 = getelementptr inbounds %struct.ush_node_object, ptr %109, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8, !tbaa !25
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.ush_object, ptr %112, i32 0, i32 20
  %114 = load i64, ptr %113, align 8, !tbaa !21
  %115 = getelementptr inbounds %struct.ush_file_descriptor, ptr %111, i64 %114
  store ptr %115, ptr %7, align 8, !tbaa !5
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.ush_object, ptr %116, i32 0, i32 19
  %118 = load i64, ptr %117, align 8, !tbaa !20
  switch i64 %118, label %244 [
    i64 0, label %119
    i64 1, label %173
    i64 2, label %212
    i64 3, label %222
  ]

119:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #4
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.ush_file_descriptor, ptr %120, i32 0, i32 4
  %122 = load ptr, ptr %121, align 8, !tbaa !26
  %123 = icmp ne ptr %122, null
  %124 = zext i1 %123 to i64
  %125 = select i1 %123, i32 114, i32 45
  %126 = trunc i32 %125 to i8
  store i8 %126, ptr %8, align 1, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.ush_file_descriptor, ptr %127, i32 0, i32 5
  %129 = load ptr, ptr %128, align 8, !tbaa !29
  %130 = icmp ne ptr %129, null
  %131 = zext i1 %130 to i64
  %132 = select i1 %130, i32 119, i32 45
  %133 = trunc i32 %132 to i8
  store i8 %133, ptr %9, align 1, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #4
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.ush_file_descriptor, ptr %134, i32 0, i32 3
  %136 = load ptr, ptr %135, align 8, !tbaa !30
  %137 = icmp ne ptr %136, null
  %138 = zext i1 %137 to i64
  %139 = select i1 %137, i32 120, i32 45
  %140 = trunc i32 %139 to i8
  store i8 %140, ptr %10, align 1, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.ush_file_descriptor, ptr %141, i32 0, i32 2
  %143 = load ptr, ptr %142, align 8, !tbaa !31
  %144 = icmp ne ptr %143, null
  %145 = zext i1 %144 to i64
  %146 = select i1 %144, i32 104, i32 45
  %147 = trunc i32 %146 to i8
  store i8 %147, ptr %11, align 1, !tbaa !28
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.ush_object, ptr %148, i32 0, i32 0
  %150 = load ptr, ptr %149, align 8, !tbaa !32
  %151 = getelementptr inbounds %struct.ush_descriptor, ptr %150, i32 0, i32 3
  %152 = load ptr, ptr %151, align 8, !tbaa !33
  %153 = load i8, ptr %8, align 1, !tbaa !28
  %154 = sext i8 %153 to i32
  %155 = load i8, ptr %9, align 1, !tbaa !28
  %156 = sext i8 %155 to i32
  %157 = load i8, ptr %10, align 1, !tbaa !28
  %158 = sext i8 %157 to i32
  %159 = load i8, ptr %11, align 1, !tbaa !28
  %160 = sext i8 %159 to i32
  %161 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %152, ptr noundef @.str.4, i32 noundef %154, i32 noundef %156, i32 noundef %158, i32 noundef %160) #4
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.ush_object, ptr %163, i32 0, i32 0
  %165 = load ptr, ptr %164, align 8, !tbaa !32
  %166 = getelementptr inbounds %struct.ush_descriptor, ptr %165, i32 0, i32 3
  %167 = load ptr, ptr %166, align 8, !tbaa !33
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.ush_object, ptr %168, i32 0, i32 1
  %170 = load i32, ptr %169, align 8, !tbaa !11
  call void @ush_write_pointer(ptr noundef %162, ptr noundef %167, i32 noundef %170)
  %171 = load ptr, ptr %3, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.ush_object, ptr %171, i32 0, i32 19
  store i64 1, ptr %172, align 8, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  br label %245

173:                                              ; preds = %106
  %174 = load ptr, ptr %7, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.ush_file_descriptor, ptr %174, i32 0, i32 1
  %176 = load ptr, ptr %175, align 8, !tbaa !35
  %177 = icmp ne ptr %176, null
  br i1 %177, label %178, label %190

178:                                              ; preds = %173
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.ush_object, ptr %179, i32 0, i32 0
  %181 = load ptr, ptr %180, align 8, !tbaa !32
  %182 = getelementptr inbounds %struct.ush_descriptor, ptr %181, i32 0, i32 3
  %183 = load ptr, ptr %182, align 8, !tbaa !33
  %184 = load ptr, ptr %7, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.ush_file_descriptor, ptr %184, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8, !tbaa !36
  %187 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %183, ptr noundef @.str.5, ptr noundef %186) #4
  %188 = load ptr, ptr %3, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.ush_object, ptr %188, i32 0, i32 19
  store i64 2, ptr %189, align 8, !tbaa !20
  br label %202

190:                                              ; preds = %173
  %191 = load ptr, ptr %3, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.ush_object, ptr %191, i32 0, i32 0
  %193 = load ptr, ptr %192, align 8, !tbaa !32
  %194 = getelementptr inbounds %struct.ush_descriptor, ptr %193, i32 0, i32 3
  %195 = load ptr, ptr %194, align 8, !tbaa !33
  %196 = load ptr, ptr %7, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.ush_file_descriptor, ptr %196, i32 0, i32 0
  %198 = load ptr, ptr %197, align 8, !tbaa !36
  %199 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %195, ptr noundef @.str.6, ptr noundef %198) #4
  %200 = load ptr, ptr %3, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.ush_object, ptr %200, i32 0, i32 19
  store i64 3, ptr %201, align 8, !tbaa !20
  br label %202

202:                                              ; preds = %190, %178
  %203 = load ptr, ptr %3, align 8, !tbaa !5
  %204 = load ptr, ptr %3, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.ush_object, ptr %204, i32 0, i32 0
  %206 = load ptr, ptr %205, align 8, !tbaa !32
  %207 = getelementptr inbounds %struct.ush_descriptor, ptr %206, i32 0, i32 3
  %208 = load ptr, ptr %207, align 8, !tbaa !33
  %209 = load ptr, ptr %3, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.ush_object, ptr %209, i32 0, i32 1
  %211 = load i32, ptr %210, align 8, !tbaa !11
  call void @ush_write_pointer(ptr noundef %203, ptr noundef %208, i32 noundef %211)
  br label %245

212:                                              ; preds = %106
  %213 = load ptr, ptr %3, align 8, !tbaa !5
  %214 = load ptr, ptr %7, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.ush_file_descriptor, ptr %214, i32 0, i32 1
  %216 = load ptr, ptr %215, align 8, !tbaa !35
  %217 = load ptr, ptr %3, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.ush_object, ptr %217, i32 0, i32 1
  %219 = load i32, ptr %218, align 8, !tbaa !11
  call void @ush_write_pointer(ptr noundef %213, ptr noundef %216, i32 noundef %219)
  %220 = load ptr, ptr %3, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.ush_object, ptr %220, i32 0, i32 19
  store i64 3, ptr %221, align 8, !tbaa !20
  br label %245

222:                                              ; preds = %106
  %223 = load ptr, ptr %7, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.ush_file_descriptor, ptr %223, i32 0, i32 1
  %225 = load ptr, ptr %224, align 8, !tbaa !35
  %226 = icmp ne ptr %225, null
  br i1 %226, label %227, label %232

227:                                              ; preds = %222
  %228 = load ptr, ptr %3, align 8, !tbaa !5
  %229 = load ptr, ptr %3, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.ush_object, ptr %229, i32 0, i32 1
  %231 = load i32, ptr %230, align 8, !tbaa !11
  call void @ush_write_pointer(ptr noundef %228, ptr noundef @.str.7, i32 noundef %231)
  br label %237

232:                                              ; preds = %222
  %233 = load ptr, ptr %3, align 8, !tbaa !5
  %234 = load ptr, ptr %3, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.ush_object, ptr %234, i32 0, i32 1
  %236 = load i32, ptr %235, align 8, !tbaa !11
  call void @ush_write_pointer(ptr noundef %233, ptr noundef @.str.8, i32 noundef %236)
  br label %237

237:                                              ; preds = %232, %227
  %238 = load ptr, ptr %3, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.ush_object, ptr %238, i32 0, i32 19
  store i64 0, ptr %239, align 8, !tbaa !20
  %240 = load ptr, ptr %3, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.ush_object, ptr %240, i32 0, i32 20
  %242 = load i64, ptr %241, align 8, !tbaa !21
  %243 = add i64 %242, 1
  store i64 %243, ptr %241, align 8, !tbaa !21
  br label %245

244:                                              ; preds = %106
  br label %245

245:                                              ; preds = %244, %237, %212, %202, %119
  br label %247

246:                                              ; preds = %2
  store i8 0, ptr %5, align 1, !tbaa !9
  br label %247

247:                                              ; preds = %246, %245, %103, %92, %42, %27
  %248 = load i8, ptr %5, align 1, !tbaa !9, !range !37, !noundef !38
  %249 = trunc i8 %248 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  ret i1 %249
}

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

declare void @ush_write_pointer(ptr noundef, ptr noundef, i32 noundef) #2

declare ptr @ush_utils_path_last(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
declare i32 @sprintf(ptr noundef, ptr 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 = { "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 }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"ush_object", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !6, i64 24, !14, i64 32, !14, i64 40, !13, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !10, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !15, i64 112, !6, i64 160, !6, i64 168, !6, i64 176, !14, i64 184, !14, i64 192, !6, i64 200, !14, i64 208, !13, i64 216, !13, i64 220, !6, i64 224, !6, i64 232, !6, i64 240, !14, i64 248, !14, i64 256, !14, i64 264}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"ush_node_object", !6, i64 0, !14, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!16 = !{!12, !6, i64 160}
!17 = !{!15, !6, i64 24}
!18 = !{!15, !6, i64 32}
!19 = !{!12, !6, i64 168}
!20 = !{!12, !14, i64 184}
!21 = !{!12, !14, i64 192}
!22 = !{!15, !6, i64 16}
!23 = !{!15, !6, i64 40}
!24 = !{!15, !14, i64 8}
!25 = !{!15, !6, i64 0}
!26 = !{!27, !6, i64 32}
!27 = !{!"ush_file_descriptor", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!28 = !{!7, !7, i64 0}
!29 = !{!27, !6, i64 40}
!30 = !{!27, !6, i64 24}
!31 = !{!27, !6, i64 16}
!32 = !{!12, !6, i64 0}
!33 = !{!34, !6, i64 24}
!34 = !{!"ush_descriptor", !6, i64 0, !6, i64 8, !14, i64 16, !6, i64 24, !14, i64 32, !14, i64 40, !6, i64 48, !6, i64 56}
!35 = !{!27, !6, i64 8}
!36 = !{!27, !6, i64 0}
!37 = !{i8 0, i8 2}
!38 = !{}


; 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.ush_file_descriptor = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [38 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @ush_buildin_cmd_ls_service(ptr noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load i32, ptr %3, align 8, !tbaa !5
  switch i32 %4, label %87 [
    i32 14, label %5
    i32 15, label %15
    i32 16, label %33
  ]

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 160
  %7 = load ptr, ptr %6, align 8, !tbaa !14
  %8 = getelementptr inbounds i8, ptr %7, i64 24
  %9 = load ptr, ptr %8, align 8, !tbaa !15
  %.not76 = icmp eq ptr %9, null
  %.str.1..str = select i1 %.not76, ptr @.str.1, ptr @.str
  tail call void @ush_write_pointer(ptr noundef nonnull %0, ptr noundef nonnull %.str.1..str, i32 noundef 15) #4
  %10 = load ptr, ptr %6, align 8, !tbaa !14
  %11 = getelementptr inbounds i8, ptr %10, i64 32
  %12 = load ptr, ptr %11, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %0, i64 168
  store ptr %12, ptr %13, align 8, !tbaa !17
  %14 = getelementptr inbounds i8, ptr %0, i64 184
  store i64 0, ptr %14, align 8, !tbaa !18
  br label %87

15:                                               ; preds = %2
  %16 = getelementptr inbounds i8, ptr %0, i64 168
  %17 = load ptr, ptr %16, align 8, !tbaa !17
  %18 = icmp eq ptr %17, null
  %19 = getelementptr inbounds i8, ptr %0, i64 184
  br i1 %18, label %20, label %21

20:                                               ; preds = %15
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %19, i8 0, i64 16, i1 false)
  store i32 16, ptr %3, align 8, !tbaa !5
  br label %87

21:                                               ; preds = %15
  %22 = load i64, ptr %19, align 8, !tbaa !18
  switch i64 %22, label %87 [
    i64 0, label %23
    i64 1, label %24
    i64 2, label %29
    i64 3, label %30
  ]

23:                                               ; preds = %21
  tail call void @ush_write_pointer(ptr noundef nonnull %0, ptr noundef nonnull @.str.2, i32 noundef 15) #4
  store i64 1, ptr %19, align 8, !tbaa !18
  br label %87

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %17, i64 16
  %26 = load ptr, ptr %25, align 8, !tbaa !19
  %27 = tail call ptr @ush_utils_path_last(ptr noundef %26) #4
  %28 = load i32, ptr %3, align 8, !tbaa !5
  tail call void @ush_write_pointer(ptr noundef nonnull %0, ptr noundef %27, i32 noundef %28) #4
  store i64 2, ptr %19, align 8, !tbaa !18
  br label %87

29:                                               ; preds = %21
  tail call void @ush_write_pointer(ptr noundef nonnull %0, ptr noundef nonnull @.str.3, i32 noundef 15) #4
  store i64 3, ptr %19, align 8, !tbaa !18
  br label %87

30:                                               ; preds = %21
  store i64 0, ptr %19, align 8, !tbaa !18
  %31 = getelementptr inbounds i8, ptr %17, i64 40
  %32 = load ptr, ptr %31, align 8, !tbaa !20
  store ptr %32, ptr %16, align 8, !tbaa !17
  br label %87

33:                                               ; preds = %2
  %34 = getelementptr inbounds i8, ptr %0, i64 192
  %35 = load i64, ptr %34, align 8, !tbaa !21
  %36 = getelementptr inbounds i8, ptr %0, i64 160
  %37 = load ptr, ptr %36, align 8, !tbaa !14
  %38 = getelementptr inbounds i8, ptr %37, i64 8
  %39 = load i64, ptr %38, align 8, !tbaa !22
  %.not = icmp ult i64 %35, %39
  br i1 %.not, label %41, label %40

40:                                               ; preds = %33
  store i32 1, ptr %3, align 8, !tbaa !5
  br label %87

41:                                               ; preds = %33
  %42 = load ptr, ptr %37, align 8, !tbaa !23
  %43 = getelementptr inbounds %struct.ush_file_descriptor, ptr %42, i64 %35
  %44 = getelementptr inbounds i8, ptr %0, i64 184
  %45 = load i64, ptr %44, align 8, !tbaa !18
  switch i64 %45, label %87 [
    i64 0, label %46
    i64 1, label %67
    i64 2, label %79
    i64 3, label %82
  ]

46:                                               ; preds = %41
  %47 = getelementptr inbounds i8, ptr %43, i64 32
  %48 = load ptr, ptr %47, align 8, !tbaa !24
  %.not72 = icmp eq ptr %48, null
  %49 = getelementptr inbounds i8, ptr %43, i64 40
  %50 = load ptr, ptr %49, align 8, !tbaa !26
  %.not73 = icmp eq ptr %50, null
  %51 = getelementptr inbounds i8, ptr %43, i64 24
  %52 = load ptr, ptr %51, align 8, !tbaa !27
  %.not74 = icmp eq ptr %52, null
  %53 = getelementptr inbounds i8, ptr %43, i64 16
  %54 = load ptr, ptr %53, align 8, !tbaa !28
  %.not75 = icmp eq ptr %54, null
  %55 = load ptr, ptr %0, align 8, !tbaa !29
  %56 = getelementptr inbounds i8, ptr %55, i64 24
  %57 = load ptr, ptr %56, align 8, !tbaa !30
  %58 = select i1 %.not72, i32 45, i32 114
  %59 = select i1 %.not73, i32 45, i32 119
  %60 = select i1 %.not74, i32 45, i32 120
  %61 = select i1 %.not75, i32 45, i32 104
  %62 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %57, ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %58, i32 noundef %59, i32 noundef %60, i32 noundef %61) #4
  %63 = load ptr, ptr %0, align 8, !tbaa !29
  %64 = getelementptr inbounds i8, ptr %63, i64 24
  %65 = load ptr, ptr %64, align 8, !tbaa !30
  %66 = load i32, ptr %3, align 8, !tbaa !5
  tail call void @ush_write_pointer(ptr noundef nonnull %0, ptr noundef %65, i32 noundef %66) #4
  store i64 1, ptr %44, align 8, !tbaa !18
  br label %87

67:                                               ; preds = %41
  %68 = getelementptr inbounds i8, ptr %43, i64 8
  %69 = load ptr, ptr %68, align 8, !tbaa !32
  %.not71 = icmp eq ptr %69, null
  %70 = load ptr, ptr %0, align 8, !tbaa !29
  %71 = getelementptr inbounds i8, ptr %70, i64 24
  %72 = load ptr, ptr %71, align 8, !tbaa !30
  %73 = load ptr, ptr %43, align 8, !tbaa !33
  %.str.6..str.5 = select i1 %.not71, ptr @.str.6, ptr @.str.5
  %. = select i1 %.not71, i64 3, i64 2
  %74 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %72, ptr noundef nonnull dereferenceable(1) %.str.6..str.5, ptr noundef %73) #4
  store i64 %., ptr %44, align 8, !tbaa !18
  %75 = load ptr, ptr %0, align 8, !tbaa !29
  %76 = getelementptr inbounds i8, ptr %75, i64 24
  %77 = load ptr, ptr %76, align 8, !tbaa !30
  %78 = load i32, ptr %3, align 8, !tbaa !5
  tail call void @ush_write_pointer(ptr noundef nonnull %0, ptr noundef %77, i32 noundef %78) #4
  br label %87

79:                                               ; preds = %41
  %80 = getelementptr inbounds i8, ptr %43, i64 8
  %81 = load ptr, ptr %80, align 8, !tbaa !32
  tail call void @ush_write_pointer(ptr noundef nonnull %0, ptr noundef %81, i32 noundef 16) #4
  store i64 3, ptr %44, align 8, !tbaa !18
  br label %87

82:                                               ; preds = %41
  %83 = getelementptr inbounds i8, ptr %43, i64 8
  %84 = load ptr, ptr %83, align 8, !tbaa !32
  %.not70 = icmp eq ptr %84, null
  %.str.8..str.7 = select i1 %.not70, ptr @.str.8, ptr @.str.7
  tail call void @ush_write_pointer(ptr noundef nonnull %0, ptr noundef nonnull %.str.8..str.7, i32 noundef 16) #4
  store i64 0, ptr %44, align 8, !tbaa !18
  %85 = load i64, ptr %34, align 8, !tbaa !21
  %86 = add i64 %85, 1
  store i64 %86, ptr %34, align 8, !tbaa !21
  br label %87

87:                                               ; preds = %2, %46, %67, %79, %82, %41, %23, %24, %29, %30, %21, %40, %20, %5
  %.0 = phi i1 [ true, %40 ], [ true, %41 ], [ true, %82 ], [ true, %79 ], [ true, %67 ], [ true, %46 ], [ true, %20 ], [ true, %21 ], [ true, %30 ], [ true, %29 ], [ true, %24 ], [ true, %23 ], [ true, %5 ], [ false, %2 ]
  ret i1 %.0
}

declare void @ush_write_pointer(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @ush_utils_path_last(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { "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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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, !10, i64 8}
!6 = !{!"ush_object", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !7, i64 24, !11, i64 32, !11, i64 40, !10, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !12, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !13, i64 112, !7, i64 160, !7, i64 168, !7, i64 176, !11, i64 184, !11, i64 192, !7, i64 200, !11, i64 208, !10, i64 216, !10, i64 220, !7, i64 224, !7, i64 232, !7, i64 240, !11, i64 248, !11, i64 256, !11, i64 264}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"_Bool", !8, i64 0}
!13 = !{!"ush_node_object", !7, i64 0, !11, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!14 = !{!6, !7, i64 160}
!15 = !{!13, !7, i64 24}
!16 = !{!13, !7, i64 32}
!17 = !{!6, !7, i64 168}
!18 = !{!6, !11, i64 184}
!19 = !{!13, !7, i64 16}
!20 = !{!13, !7, i64 40}
!21 = !{!6, !11, i64 192}
!22 = !{!13, !11, i64 8}
!23 = !{!13, !7, i64 0}
!24 = !{!25, !7, i64 32}
!25 = !{!"ush_file_descriptor", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48}
!26 = !{!25, !7, i64 40}
!27 = !{!25, !7, i64 24}
!28 = !{!25, !7, i64 16}
!29 = !{!6, !7, i64 0}
!30 = !{!31, !7, i64 24}
!31 = !{!"ush_descriptor", !7, i64 0, !7, i64 8, !11, i64 16, !7, i64 24, !11, i64 32, !11, i64 40, !7, i64 48, !7, i64 56}
!32 = !{!25, !7, i64 8}
!33 = !{!25, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass