; LLVM IR from devicehive/esp8266-firmware :: firmware-src/sources (dhterminal_commands)

; 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.softap_config = type { [32 x i8], [64 x i8], i8, i8, i32, i8, i8, i16 }
%struct.station_config = type { [32 x i8], [64 x i8], i8, [6 x i8], %struct.wifi_fast_scan_threshold_t }
%struct.wifi_fast_scan_threshold_t = type { i8, i32 }
%struct.DHStat = type { i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@.str.7 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [23 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

declare void @dh_uart_send_line(ptr noundef) #1

declare void @dh_uart_send_str(ptr noundef) #1

declare i32 @snprintf(ptr noundef, i32 noundef, ptr noundef, ...) #1

; 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
define dso_local void @dhterminal_commands_status(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca [6 x i8], align 1
  %4 = alloca [32 x i8], align 16
  %5 = alloca ptr, align 8
  %6 = alloca %struct.softap_config, align 4
  %7 = alloca %struct.station_config, align 4
  %8 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 6, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %9 = call ptr @dhstat_get()
  store ptr %9, ptr %5, align 8, !tbaa !5
  call void @dh_uart_send_str(ptr noundef @.str.7)
  %10 = getelementptr inbounds [6 x i8], ptr %3, i64 0, i64 0
  %11 = call zeroext i8 @wifi_get_macaddr(i8 noundef zeroext 0, ptr noundef %10)
  %12 = icmp ne i8 %11, 0
  br i1 %12, label %14, label %13

13:                                               ; preds = %1
  call void @dh_uart_send_str(ptr noundef @.str.8)
  br label %18

14:                                               ; preds = %1
  %15 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %16 = getelementptr inbounds [6 x i8], ptr %3, i64 0, i64 0
  call void @sprintMac(ptr noundef %15, ptr noundef %16)
  %17 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @dh_uart_send_str(ptr noundef %17)
  br label %18

18:                                               ; preds = %14, %13
  %19 = call zeroext i8 @wifi_get_opmode()
  %20 = zext i8 %19 to i32
  %21 = icmp eq i32 %20, 2
  br i1 %21, label %22, label %26

22:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 108, ptr %6) #3
  call void @dh_uart_send_str(ptr noundef @.str.9)
  %23 = call zeroext i8 @wifi_softap_get_config(ptr noundef %6)
  %24 = getelementptr inbounds %struct.softap_config, ptr %6, i32 0, i32 0
  %25 = getelementptr inbounds [32 x i8], ptr %24, i64 0, i64 0
  call void @dh_uart_send_line(ptr noundef %25)
  call void @printIpInfo(i8 noundef zeroext 1)
  call void @llvm.lifetime.end.p0(i64 108, ptr %6) #3
  br label %58

26:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 112, ptr %7) #3
  %27 = call zeroext i8 @wifi_station_get_config(ptr noundef %7)
  %28 = icmp ne i8 %27, 0
  br i1 %28, label %34, label %29

29:                                               ; preds = %26
  %30 = call ptr @ets_memset(ptr noundef %7, i32 noundef 0, i32 noundef 112)
  %31 = getelementptr inbounds %struct.station_config, ptr %7, i32 0, i32 0
  %32 = getelementptr inbounds [32 x i8], ptr %31, i64 0, i64 0
  %33 = call ptr @ets_strcpy(ptr noundef %32, ptr noundef @.str.10)
  br label %34

34:                                               ; preds = %29, %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %35 = getelementptr inbounds %struct.station_config, ptr %7, i32 0, i32 0
  %36 = getelementptr inbounds [32 x i8], ptr %35, i64 0, i64 0
  store ptr %36, ptr %8, align 8, !tbaa !5
  %37 = call zeroext i8 @wifi_station_get_connect_status()
  %38 = zext i8 %37 to i32
  switch i32 %38, label %50 [
    i32 0, label %39
    i32 1, label %40
    i32 2, label %42
    i32 3, label %44
    i32 4, label %46
    i32 5, label %48
  ]

39:                                               ; preds = %34
  call void @dh_uart_send_line(ptr noundef @.str.11)
  br label %51

40:                                               ; preds = %34
  call void @dh_uart_send_str(ptr noundef @.str.12)
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  call void @dh_uart_send_line(ptr noundef %41)
  br label %51

42:                                               ; preds = %34
  call void @dh_uart_send_str(ptr noundef @.str.13)
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  call void @dh_uart_send_line(ptr noundef %43)
  br label %51

44:                                               ; preds = %34
  call void @dh_uart_send_str(ptr noundef @.str.14)
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  call void @dh_uart_send_line(ptr noundef %45)
  br label %51

46:                                               ; preds = %34
  call void @dh_uart_send_str(ptr noundef @.str.15)
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  call void @dh_uart_send_line(ptr noundef %47)
  br label %51

48:                                               ; preds = %34
  call void @dh_uart_send_str(ptr noundef @.str.16)
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  call void @dh_uart_send_line(ptr noundef %49)
  call void @printIpInfo(i8 noundef zeroext 0)
  br label %51

50:                                               ; preds = %34
  call void @dh_uart_send_line(ptr noundef @.str.17)
  br label %51

51:                                               ; preds = %50, %48, %46, %44, %42, %40, %39
  call void @dh_uart_send_str(ptr noundef @.str.18)
  %52 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.DHStat, ptr %53, i32 0, i32 5
  %55 = load i32, ptr %54, align 4, !tbaa !9
  %56 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef %52, i32 noundef 32, ptr noundef @.str.19, i32 noundef %55)
  %57 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @dh_uart_send_line(ptr noundef %57)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 112, ptr %7) #3
  br label %58

58:                                               ; preds = %51, %22
  call void @dh_uart_send_str(ptr noundef @.str.20)
  %59 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.DHStat, ptr %60, i32 0, i32 1
  %62 = load i64, ptr %61, align 8, !tbaa !13
  call void @printBytes(ptr noundef %59, i64 noundef %62)
  %63 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @dh_uart_send_str(ptr noundef %63)
  call void @dh_uart_send_str(ptr noundef @.str.21)
  %64 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.DHStat, ptr %65, i32 0, i32 0
  %67 = load i64, ptr %66, align 8, !tbaa !14
  call void @printBytes(ptr noundef %64, i64 noundef %67)
  %68 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @dh_uart_send_str(ptr noundef %68)
  call void @dh_uart_send_str(ptr noundef @.str.22)
  %69 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.DHStat, ptr %70, i32 0, i32 2
  %72 = load i32, ptr %71, align 8, !tbaa !15
  %73 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef %69, i32 noundef 32, ptr noundef @.str.19, i32 noundef %72)
  %74 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @dh_uart_send_line(ptr noundef %74)
  call void @dh_uart_send_str(ptr noundef @.str.23)
  %75 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.DHStat, ptr %76, i32 0, i32 3
  %78 = load i32, ptr %77, align 4, !tbaa !16
  %79 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef %75, i32 noundef 32, ptr noundef @.str.19, i32 noundef %78)
  %80 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @dh_uart_send_str(ptr noundef %80)
  call void @dh_uart_send_str(ptr noundef @.str.22)
  %81 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.DHStat, ptr %82, i32 0, i32 4
  %84 = load i32, ptr %83, align 8, !tbaa !17
  %85 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef %81, i32 noundef 32, ptr noundef @.str.19, i32 noundef %84)
  %86 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @dh_uart_send_line(ptr noundef %86)
  call void @dh_uart_send_str(ptr noundef @.str.24)
  %87 = call i32 @dhconnector_get_state()
  switch i32 %87, label %93 [
    i32 0, label %88
    i32 2, label %89
    i32 1, label %90
    i32 3, label %90
    i32 4, label %91
    i32 5, label %92
  ]

88:                                               ; preds = %58
  call void @dh_uart_send_str(ptr noundef @.str.25)
  br label %94

89:                                               ; preds = %58
  call void @dh_uart_send_str(ptr noundef @.str.26)
  br label %94

90:                                               ; preds = %58, %58
  call void @dh_uart_send_str(ptr noundef @.str.27)
  br label %94

91:                                               ; preds = %58
  call void @dh_uart_send_str(ptr noundef @.str.28)
  br label %94

92:                                               ; preds = %58
  call void @dh_uart_send_str(ptr noundef @.str.29)
  br label %94

93:                                               ; preds = %58
  call void @dh_uart_send_str(ptr noundef @.str.30)
  br label %94

94:                                               ; preds = %93, %92, %91, %90, %89, %88
  call void @dh_uart_send_str(ptr noundef @.str.31)
  %95 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.DHStat, ptr %96, i32 0, i32 6
  %98 = load i32, ptr %97, align 8, !tbaa !18
  %99 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef %95, i32 noundef 32, ptr noundef @.str.19, i32 noundef %98)
  %100 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @dh_uart_send_line(ptr noundef %100)
  call void @dh_uart_send_str(ptr noundef @.str.32)
  %101 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.DHStat, ptr %102, i32 0, i32 8
  %104 = load i32, ptr %103, align 8, !tbaa !19
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.DHStat, ptr %105, i32 0, i32 10
  %107 = load i32, ptr %106, align 8, !tbaa !20
  %108 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef %101, i32 noundef 32, ptr noundef @.str.33, i32 noundef %104, i32 noundef %107)
  %109 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @dh_uart_send_str(ptr noundef %109)
  call void @dh_uart_send_str(ptr noundef @.str.34)
  %110 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.DHStat, ptr %111, i32 0, i32 7
  %113 = load i32, ptr %112, align 4, !tbaa !21
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.DHStat, ptr %114, i32 0, i32 9
  %116 = load i32, ptr %115, align 4, !tbaa !22
  %117 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef %110, i32 noundef 32, ptr noundef @.str.33, i32 noundef %113, i32 noundef %116)
  %118 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @dh_uart_send_line(ptr noundef %118)
  call void @dh_uart_send_str(ptr noundef @.str.35)
  %119 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.DHStat, ptr %120, i32 0, i32 11
  %122 = load i32, ptr %121, align 4, !tbaa !23
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.DHStat, ptr %123, i32 0, i32 12
  %125 = load i32, ptr %124, align 8, !tbaa !24
  %126 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef %119, i32 noundef 32, ptr noundef @.str.33, i32 noundef %122, i32 noundef %125)
  %127 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @dh_uart_send_line(ptr noundef %127)
  call void @dh_uart_send_str(ptr noundef @.str.36)
  %128 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %129 = call i32 @system_get_free_heap_size()
  %130 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef %128, i32 noundef 32, ptr noundef @.str.37, i32 noundef %129)
  %131 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @dh_uart_send_str(ptr noundef %131)
  call void @dh_uart_send_str(ptr noundef @.str.38)
  call void @dh_uart_send_str(ptr noundef @.str.39)
  %132 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %133 = call i32 @dhsender_queue_length()
  %134 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef %132, i32 noundef 32, ptr noundef @.str.37, i32 noundef %133)
  %135 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @dh_uart_send_line(ptr noundef %135)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 6, ptr %3) #3
  ret void
}

declare ptr @dhstat_get() #1

declare zeroext i8 @wifi_get_macaddr(i8 noundef zeroext, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @sprintMac(ptr noundef, ptr noundef) #2

declare zeroext i8 @wifi_get_opmode() #1

declare zeroext i8 @wifi_softap_get_config(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @printIpInfo(i8 noundef zeroext) #2

declare zeroext i8 @wifi_station_get_config(ptr noundef) #1

declare ptr @ets_memset(ptr noundef, i32 noundef, i32 noundef) #1

declare ptr @ets_strcpy(ptr noundef, ptr noundef) #1

declare zeroext i8 @wifi_station_get_connect_status() #1

; Function Attrs: nounwind uwtable
declare hidden void @printBytes(ptr noundef, i64 noundef) #2

declare i32 @dhconnector_get_state() #1

declare i32 @system_get_free_heap_size() #1

declare i32 @dhsender_queue_length() #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { 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, !12, i64 28}
!10 = !{!"DHStat", !11, i64 0, !11, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56}
!11 = !{!"long long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !11, i64 8}
!14 = !{!10, !11, i64 0}
!15 = !{!10, !12, i64 16}
!16 = !{!10, !12, i64 20}
!17 = !{!10, !12, i64 24}
!18 = !{!10, !12, i64 32}
!19 = !{!10, !12, i64 40}
!20 = !{!10, !12, i64 48}
!21 = !{!10, !12, i64 36}
!22 = !{!10, !12, i64 44}
!23 = !{!10, !12, i64 52}
!24 = !{!10, !12, i64 56}


; 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.softap_config = type { [32 x i8], [64 x i8], i8, i8, i32, i8, i8, i16 }
%struct.station_config = type { [32 x i8], [64 x i8], i8, [6 x i8], %struct.wifi_fast_scan_threshold_t }
%struct.wifi_fast_scan_threshold_t = type { i8, i32 }

@.str.7 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [23 x i8], align 1
@switch.table.dhterminal_commands_status = private unnamed_addr constant [6 x ptr] [ptr @.str.25, ptr @.str.27, ptr @.str.26, ptr @.str.27, ptr @.str.28, ptr @.str.29], align 8

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

declare void @dh_uart_send_line(ptr noundef) local_unnamed_addr #1

declare void @dh_uart_send_str(ptr noundef) local_unnamed_addr #1

declare i32 @snprintf(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

; 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
define dso_local void @dhterminal_commands_status(ptr nocapture noundef readnone %0) local_unnamed_addr #2 {
  %2 = alloca [6 x i8], align 1
  %3 = alloca [32 x i8], align 16
  %4 = alloca %struct.softap_config, align 4
  %5 = alloca %struct.station_config, align 4
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #3
  %6 = tail call ptr @dhstat_get() #3
  tail call void @dh_uart_send_str(ptr noundef nonnull @.str.7) #3
  %7 = call zeroext i8 @wifi_get_macaddr(i8 noundef zeroext 0, ptr noundef nonnull %2) #3
  %.not = icmp eq i8 %7, 0
  br i1 %.not, label %9, label %8

8:                                                ; preds = %1
  call void @sprintMac(ptr noundef nonnull %3, ptr noundef nonnull %2)
  br label %9

9:                                                ; preds = %1, %8
  %.sink = phi ptr [ %3, %8 ], [ @.str.8, %1 ]
  call void @dh_uart_send_str(ptr noundef nonnull %.sink) #3
  %10 = call zeroext i8 @wifi_get_opmode() #3
  %11 = icmp eq i8 %10, 2
  br i1 %11, label %12, label %14

12:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 108, ptr nonnull %4) #3
  call void @dh_uart_send_str(ptr noundef nonnull @.str.9) #3
  %13 = call zeroext i8 @wifi_softap_get_config(ptr noundef nonnull %4) #3
  call void @dh_uart_send_line(ptr noundef nonnull %4) #3
  call void @printIpInfo(i8 noundef zeroext 1)
  call void @llvm.lifetime.end.p0(i64 108, ptr nonnull %4) #3
  br label %32

14:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %5) #3
  %15 = call zeroext i8 @wifi_station_get_config(ptr noundef nonnull %5) #3
  %.not18 = icmp eq i8 %15, 0
  br i1 %.not18, label %16, label %19

16:                                               ; preds = %14
  %17 = call ptr @ets_memset(ptr noundef nonnull %5, i32 noundef 0, i32 noundef 112) #3
  %18 = call ptr @ets_strcpy(ptr noundef nonnull %5, ptr noundef nonnull @.str.10) #3
  br label %19

19:                                               ; preds = %16, %14
  %20 = call zeroext i8 @wifi_station_get_connect_status() #3
  switch i8 %20, label %27 [
    i8 0, label %21
    i8 1, label %22
    i8 2, label %23
    i8 3, label %24
    i8 4, label %25
    i8 5, label %26
  ]

21:                                               ; preds = %19
  call void @dh_uart_send_line(ptr noundef nonnull @.str.11) #3
  br label %28

22:                                               ; preds = %19
  call void @dh_uart_send_str(ptr noundef nonnull @.str.12) #3
  call void @dh_uart_send_line(ptr noundef nonnull %5) #3
  br label %28

23:                                               ; preds = %19
  call void @dh_uart_send_str(ptr noundef nonnull @.str.13) #3
  call void @dh_uart_send_line(ptr noundef nonnull %5) #3
  br label %28

24:                                               ; preds = %19
  call void @dh_uart_send_str(ptr noundef nonnull @.str.14) #3
  call void @dh_uart_send_line(ptr noundef nonnull %5) #3
  br label %28

25:                                               ; preds = %19
  call void @dh_uart_send_str(ptr noundef nonnull @.str.15) #3
  call void @dh_uart_send_line(ptr noundef nonnull %5) #3
  br label %28

26:                                               ; preds = %19
  call void @dh_uart_send_str(ptr noundef nonnull @.str.16) #3
  call void @dh_uart_send_line(ptr noundef nonnull %5) #3
  call void @printIpInfo(i8 noundef zeroext 0)
  br label %28

27:                                               ; preds = %19
  call void @dh_uart_send_line(ptr noundef nonnull @.str.17) #3
  br label %28

28:                                               ; preds = %27, %26, %25, %24, %23, %22, %21
  call void @dh_uart_send_str(ptr noundef nonnull @.str.18) #3
  %29 = getelementptr inbounds i8, ptr %6, i64 28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef nonnull %3, i32 noundef 32, ptr noundef nonnull @.str.19, i32 noundef %30) #3
  call void @dh_uart_send_line(ptr noundef nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %5) #3
  br label %32

32:                                               ; preds = %28, %12
  call void @dh_uart_send_str(ptr noundef nonnull @.str.20) #3
  %33 = getelementptr inbounds i8, ptr %6, i64 8
  %34 = load i64, ptr %33, align 8, !tbaa !11
  call void @printBytes(ptr noundef nonnull %3, i64 noundef %34)
  call void @dh_uart_send_str(ptr noundef nonnull %3) #3
  call void @dh_uart_send_str(ptr noundef nonnull @.str.21) #3
  %35 = load i64, ptr %6, align 8, !tbaa !12
  call void @printBytes(ptr noundef nonnull %3, i64 noundef %35)
  call void @dh_uart_send_str(ptr noundef nonnull %3) #3
  call void @dh_uart_send_str(ptr noundef nonnull @.str.22) #3
  %36 = getelementptr inbounds i8, ptr %6, i64 16
  %37 = load i32, ptr %36, align 8, !tbaa !13
  %38 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef nonnull %3, i32 noundef 32, ptr noundef nonnull @.str.19, i32 noundef %37) #3
  call void @dh_uart_send_line(ptr noundef nonnull %3) #3
  call void @dh_uart_send_str(ptr noundef nonnull @.str.23) #3
  %39 = getelementptr inbounds i8, ptr %6, i64 20
  %40 = load i32, ptr %39, align 4, !tbaa !14
  %41 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef nonnull %3, i32 noundef 32, ptr noundef nonnull @.str.19, i32 noundef %40) #3
  call void @dh_uart_send_str(ptr noundef nonnull %3) #3
  call void @dh_uart_send_str(ptr noundef nonnull @.str.22) #3
  %42 = getelementptr inbounds i8, ptr %6, i64 24
  %43 = load i32, ptr %42, align 8, !tbaa !15
  %44 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef nonnull %3, i32 noundef 32, ptr noundef nonnull @.str.19, i32 noundef %43) #3
  call void @dh_uart_send_line(ptr noundef nonnull %3) #3
  call void @dh_uart_send_str(ptr noundef nonnull @.str.24) #3
  %45 = call i32 @dhconnector_get_state() #3
  %46 = icmp ult i32 %45, 6
  br i1 %46, label %switch.lookup, label %48

switch.lookup:                                    ; preds = %32
  %47 = zext nneg i32 %45 to i64
  %switch.gep = getelementptr inbounds [6 x ptr], ptr @switch.table.dhterminal_commands_status, i64 0, i64 %47
  %switch.load = load ptr, ptr %switch.gep, align 8
  br label %48

48:                                               ; preds = %32, %switch.lookup
  %.str.30.sink = phi ptr [ %switch.load, %switch.lookup ], [ @.str.30, %32 ]
  call void @dh_uart_send_str(ptr noundef nonnull %.str.30.sink) #3
  call void @dh_uart_send_str(ptr noundef nonnull @.str.31) #3
  %49 = getelementptr inbounds i8, ptr %6, i64 32
  %50 = load i32, ptr %49, align 8, !tbaa !16
  %51 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef nonnull %3, i32 noundef 32, ptr noundef nonnull @.str.19, i32 noundef %50) #3
  call void @dh_uart_send_line(ptr noundef nonnull %3) #3
  call void @dh_uart_send_str(ptr noundef nonnull @.str.32) #3
  %52 = getelementptr inbounds i8, ptr %6, i64 40
  %53 = load i32, ptr %52, align 8, !tbaa !17
  %54 = getelementptr inbounds i8, ptr %6, i64 48
  %55 = load i32, ptr %54, align 8, !tbaa !18
  %56 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef nonnull %3, i32 noundef 32, ptr noundef nonnull @.str.33, i32 noundef %53, i32 noundef %55) #3
  call void @dh_uart_send_str(ptr noundef nonnull %3) #3
  call void @dh_uart_send_str(ptr noundef nonnull @.str.34) #3
  %57 = getelementptr inbounds i8, ptr %6, i64 36
  %58 = load i32, ptr %57, align 4, !tbaa !19
  %59 = getelementptr inbounds i8, ptr %6, i64 44
  %60 = load i32, ptr %59, align 4, !tbaa !20
  %61 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef nonnull %3, i32 noundef 32, ptr noundef nonnull @.str.33, i32 noundef %58, i32 noundef %60) #3
  call void @dh_uart_send_line(ptr noundef nonnull %3) #3
  call void @dh_uart_send_str(ptr noundef nonnull @.str.35) #3
  %62 = getelementptr inbounds i8, ptr %6, i64 52
  %63 = load i32, ptr %62, align 4, !tbaa !21
  %64 = getelementptr inbounds i8, ptr %6, i64 56
  %65 = load i32, ptr %64, align 8, !tbaa !22
  %66 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef nonnull %3, i32 noundef 32, ptr noundef nonnull @.str.33, i32 noundef %63, i32 noundef %65) #3
  call void @dh_uart_send_line(ptr noundef nonnull %3) #3
  call void @dh_uart_send_str(ptr noundef nonnull @.str.36) #3
  %67 = call i32 @system_get_free_heap_size() #3
  %68 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef nonnull %3, i32 noundef 32, ptr noundef nonnull @.str.37, i32 noundef %67) #3
  call void @dh_uart_send_str(ptr noundef nonnull %3) #3
  call void @dh_uart_send_str(ptr noundef nonnull @.str.38) #3
  call void @dh_uart_send_str(ptr noundef nonnull @.str.39) #3
  %69 = call i32 @dhsender_queue_length() #3
  %70 = call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef nonnull %3, i32 noundef 32, ptr noundef nonnull @.str.37, i32 noundef %69) #3
  call void @dh_uart_send_line(ptr noundef nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %2) #3
  ret void
}

declare ptr @dhstat_get() local_unnamed_addr #1

declare zeroext i8 @wifi_get_macaddr(i8 noundef zeroext, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @sprintMac(ptr noundef, ptr noundef) local_unnamed_addr #2

declare zeroext i8 @wifi_get_opmode() local_unnamed_addr #1

declare zeroext i8 @wifi_softap_get_config(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @printIpInfo(i8 noundef zeroext) local_unnamed_addr #2

declare zeroext i8 @wifi_station_get_config(ptr noundef) local_unnamed_addr #1

declare ptr @ets_memset(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare ptr @ets_strcpy(ptr noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i8 @wifi_station_get_connect_status() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @printBytes(ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @dhconnector_get_state() local_unnamed_addr #1

declare i32 @system_get_free_heap_size() local_unnamed_addr #1

declare i32 @dhsender_queue_length() local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { 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 28}
!6 = !{!"DHStat", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !10, i64 16}
!14 = !{!6, !10, i64 20}
!15 = !{!6, !10, i64 24}
!16 = !{!6, !10, i64 32}
!17 = !{!6, !10, i64 40}
!18 = !{!6, !10, i64 48}
!19 = !{!6, !10, i64 36}
!20 = !{!6, !10, i64 44}
!21 = !{!6, !10, i64 52}
!22 = !{!6, !10, i64 56}


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