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

; 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.gpio_command_params = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i32, i32, %union.anon, i16, i32, i8, i8, i8, [264 x i8], i32, i32, i32, i32, i32, i32, i32, i32, float }
%union.anon = type { [16 x i32] }
%struct.MFRC522_Uid = type { i8, [10 x i8], i8 }
%struct.COMMAND_RESULT = type { ptr, %union.CommandResultArgument }
%union.CommandResultArgument = type { ptr }

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @dh_handle_devices_mfrc522_read(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.gpio_command_params, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca [2 x i8], align 1
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %47

22:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 408, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = call ptr @parse_params_pins_set(ptr noundef %23, i32 noundef %24, ptr noundef %9, i32 noundef 1, i32 noundef 0, i32 noundef 8388608, ptr noundef %10)
  store ptr %25, ptr %11, align 8, !tbaa !5
  %26 = load ptr, ptr %11, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %31

28:                                               ; preds = %22
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  call void @dh_command_fail(ptr noundef %29, ptr noundef %30)
  store i32 1, ptr %12, align 4
  br label %44

31:                                               ; preds = %22
  %32 = load i32, ptr %10, align 4, !tbaa !9
  %33 = and i32 %32, 8388608
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %43

35:                                               ; preds = %31
  %36 = getelementptr inbounds %struct.gpio_command_params, ptr %9, i32 0, i32 26
  %37 = load i32, ptr %36, align 4, !tbaa !11
  %38 = call i32 @MFRC522_Set_CS(i32 noundef %37)
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %42

40:                                               ; preds = %35
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  call void @dh_command_fail(ptr noundef %41, ptr noundef @.str)
  store i32 1, ptr %12, align 4
  br label %44

42:                                               ; preds = %35
  br label %43

43:                                               ; preds = %42, %31
  store i32 0, ptr %12, align 4
  br label %44

44:                                               ; preds = %43, %40, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 408, ptr %9) #4
  %45 = load i32, ptr %12, align 4
  switch i32 %45, label %121 [
    i32 0, label %46
    i32 1, label %120
  ]

46:                                               ; preds = %44
  br label %47

47:                                               ; preds = %46, %4
  call void (...) @MFRC522_PCD_Init()
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #4
  store i8 2, ptr %14, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %48 = getelementptr inbounds [2 x i8], ptr %13, i64 0, i64 0
  %49 = call i32 @MFRC522_PICC_RequestA(ptr noundef %48, ptr noundef %14)
  store i32 %49, ptr %15, align 4, !tbaa !9
  %50 = load i32, ptr %15, align 4, !tbaa !9
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %55, label %52

52:                                               ; preds = %47
  %53 = load i32, ptr %15, align 4, !tbaa !9
  %54 = icmp eq i32 %53, 2
  br i1 %54, label %55, label %113

55:                                               ; preds = %52, %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %56 = call ptr (...) @MFRC522_Get_Uid()
  store ptr %56, ptr %16, align 8, !tbaa !5
  %57 = load ptr, ptr %16, align 8, !tbaa !5
  %58 = call i32 @MFRC522_PICC_Select(ptr noundef %57, i8 noundef zeroext 0)
  store i32 %58, ptr %15, align 4, !tbaa !9
  %59 = load i32, ptr %15, align 4, !tbaa !9
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %109

61:                                               ; preds = %55
  %62 = load ptr, ptr %16, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.MFRC522_Uid, ptr %62, i32 0, i32 0
  %64 = load i8, ptr %63, align 1, !tbaa !16
  %65 = zext i8 %64 to i32
  %66 = mul nsw i32 %65, 2
  %67 = add nsw i32 %66, 1
  %68 = zext i32 %67 to i64
  %69 = call ptr @llvm.stacksave.p0()
  store ptr %69, ptr %17, align 8
  %70 = alloca i8, i64 %68, align 16
  store i64 %68, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %90, %61
  %72 = load i32, ptr %19, align 4, !tbaa !9
  %73 = load ptr, ptr %16, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.MFRC522_Uid, ptr %73, i32 0, i32 0
  %75 = load i8, ptr %74, align 1, !tbaa !16
  %76 = zext i8 %75 to i32
  %77 = icmp ult i32 %72, %76
  br i1 %77, label %78, label %93

78:                                               ; preds = %71
  %79 = load ptr, ptr %16, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.MFRC522_Uid, ptr %79, i32 0, i32 1
  %81 = load i32, ptr %19, align 4, !tbaa !9
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds [10 x i8], ptr %80, i64 0, i64 %82
  %84 = load i8, ptr %83, align 1, !tbaa !15
  %85 = load i32, ptr %19, align 4, !tbaa !9
  %86 = mul i32 %85, 2
  %87 = zext i32 %86 to i64
  %88 = getelementptr inbounds i8, ptr %70, i64 %87
  %89 = call i32 @byteToHex(i8 noundef zeroext %84, ptr noundef %88)
  br label %90

90:                                               ; preds = %78
  %91 = load i32, ptr %19, align 4, !tbaa !9
  %92 = add i32 %91, 1
  store i32 %92, ptr %19, align 4, !tbaa !9
  br label %71, !llvm.loop !18

93:                                               ; preds = %71
  %94 = sub i64 %68, 1
  %95 = getelementptr inbounds i8, ptr %70, i64 %94
  store i8 0, ptr %95, align 1, !tbaa !15
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.COMMAND_RESULT, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !20
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.COMMAND_RESULT, ptr %99, i32 0, i32 1
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.MFRC522_Uid, ptr %101, i32 0, i32 2
  %103 = load i8, ptr %102, align 1, !tbaa !22
  %104 = call i32 @MFRC522_PICC_GetType(i8 noundef zeroext %103)
  %105 = call ptr @MFRC522_PICC_GetTypeName(i32 noundef %104)
  %106 = getelementptr inbounds %union.CommandResultArgument, ptr %100, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8
  call void (ptr, i32, i32, ...) %98(ptr %107, i32 noundef 1, i32 noundef 5, ptr noundef @.str.1, ptr noundef %70, ptr noundef %105)
  call void (...) @MFRC522_PCD_AntennaOff()
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  %108 = load ptr, ptr %17, align 8
  call void @llvm.stackrestore.p0(ptr %108)
  br label %110

109:                                              ; preds = %55
  store i32 0, ptr %12, align 4
  br label %110

110:                                              ; preds = %109, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %111 = load i32, ptr %12, align 4
  switch i32 %111, label %118 [
    i32 0, label %112
  ]

112:                                              ; preds = %110
  br label %113

113:                                              ; preds = %112, %52
  %114 = call i32 (...) @MFRC522_PICC_HaltA()
  call void (...) @MFRC522_PCD_AntennaOff()
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = load i32, ptr %15, align 4, !tbaa !9
  %117 = call ptr @MFRC522_GetStatusCodeName(i32 noundef %116)
  call void @dh_command_fail(ptr noundef %115, ptr noundef %117)
  store i32 0, ptr %12, align 4
  br label %118

118:                                              ; preds = %113, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #4
  %119 = load i32, ptr %12, align 4
  switch i32 %119, label %121 [
    i32 0, label %120
    i32 1, label %120
  ]

120:                                              ; preds = %118, %118, %44
  ret void

121:                                              ; preds = %118, %44
  unreachable
}

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

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

declare void @dh_command_fail(ptr noundef, ptr noundef) #2

declare i32 @MFRC522_Set_CS(i32 noundef) #2

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

declare void @MFRC522_PCD_Init(...) #2

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

declare ptr @MFRC522_Get_Uid(...) #2

declare i32 @MFRC522_PICC_Select(ptr noundef, i8 noundef zeroext) #2

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

declare i32 @byteToHex(i8 noundef zeroext, ptr noundef) #2

declare ptr @MFRC522_PICC_GetTypeName(i32 noundef) #2

declare i32 @MFRC522_PICC_GetType(i8 noundef zeroext) #2

declare void @MFRC522_PCD_AntennaOff(...) #2

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

declare i32 @MFRC522_PICC_HaltA(...) #2

declare ptr @MFRC522_GetStatusCodeName(i32 noundef) #2

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 = { nocallback nofree nosync nounwind willreturn }
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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 396}
!12 = !{!"", !13, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !13, i64 8, !13, i64 10, !13, i64 12, !13, i64 14, !13, i64 16, !13, i64 18, !13, i64 20, !10, i64 24, !10, i64 28, !7, i64 32, !13, i64 96, !10, i64 100, !7, i64 104, !7, i64 105, !7, i64 106, !7, i64 107, !10, i64 372, !10, i64 376, !10, i64 380, !10, i64 384, !10, i64 388, !10, i64 392, !10, i64 396, !10, i64 400, !14, i64 404}
!13 = !{!"short", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !7, i64 0}
!17 = !{!"", !7, i64 0, !7, i64 1, !7, i64 11}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!21, !6, i64 0}
!21 = !{!"", !6, i64 0, !7, i64 8}
!22 = !{!17, !7, i64 11}


; 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.gpio_command_params = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i32, i32, %union.anon, i16, i32, i8, i8, i8, [264 x i8], i32, i32, i32, i32, i32, i32, i32, i32, float }
%union.anon = type { [16 x i32] }

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @dh_handle_devices_mfrc522_read(ptr noundef %0, ptr nocapture noundef readnone %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = alloca %struct.gpio_command_params, align 4
  %6 = alloca i32, align 4
  %7 = alloca [2 x i8], align 1
  %8 = alloca i8, align 1
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %19, label %9

9:                                                ; preds = %4
  call void @llvm.lifetime.start.p0(i64 408, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  %10 = call ptr @parse_params_pins_set(ptr noundef %2, i32 noundef %3, ptr noundef nonnull %5, i32 noundef 1, i32 noundef 0, i32 noundef 8388608, ptr noundef nonnull %6) #4
  %.not31 = icmp eq ptr %10, null
  br i1 %.not31, label %11, label %18

11:                                               ; preds = %9
  %12 = load i32, ptr %6, align 4, !tbaa !5
  %13 = and i32 %12, 8388608
  %.not32 = icmp eq i32 %13, 0
  br i1 %.not32, label %.thread, label %14

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %5, i64 396
  %16 = load i32, ptr %15, align 4, !tbaa !9
  %17 = call i32 @MFRC522_Set_CS(i32 noundef %16) #4
  %.not33 = icmp eq i32 %17, 0
  br i1 %.not33, label %.thread, label %18

.thread:                                          ; preds = %14, %11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %5) #4
  br label %19

18:                                               ; preds = %14, %9
  %.str.sink = phi ptr [ %10, %9 ], [ @.str, %14 ]
  call void @dh_command_fail(ptr noundef %0, ptr noundef nonnull %.str.sink) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %5) #4
  br label %54

19:                                               ; preds = %.thread, %4
  call void (...) @MFRC522_PCD_Init() #4
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #4
  store i8 2, ptr %8, align 1, !tbaa !13
  %20 = call i32 @MFRC522_PICC_RequestA(ptr noundef nonnull %7, ptr noundef nonnull %8) #4
  %21 = and i32 %20, -3
  %or.cond = icmp eq i32 %21, 0
  br i1 %or.cond, label %22, label %.critedge

22:                                               ; preds = %19
  %23 = call ptr (...) @MFRC522_Get_Uid() #4
  %24 = call i32 @MFRC522_PICC_Select(ptr noundef %23, i8 noundef zeroext 0) #4
  %.not34 = icmp eq i32 %24, 0
  br i1 %.not34, label %25, label %.critedge

25:                                               ; preds = %22
  %26 = load i8, ptr %23, align 1, !tbaa !14
  %27 = zext i8 %26 to i64
  %28 = shl nuw nsw i64 %27, 1
  %29 = or disjoint i64 %28, 1
  %30 = call ptr @llvm.stacksave.p0()
  %31 = alloca i8, i64 %29, align 16
  %32 = load i8, ptr %23, align 1, !tbaa !14
  %.not38 = icmp eq i8 %32, 0
  br i1 %.not38, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %25
  %33 = getelementptr inbounds i8, ptr %23, i64 1
  br label %34

34:                                               ; preds = %.lr.ph, %34
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %34 ]
  %35 = getelementptr inbounds [10 x i8], ptr %33, i64 0, i64 %indvars.iv
  %36 = load i8, ptr %35, align 1, !tbaa !13
  %37 = shl nuw nsw i64 %indvars.iv, 1
  %38 = getelementptr inbounds i8, ptr %31, i64 %37
  %39 = call i32 @byteToHex(i8 noundef zeroext %36, ptr noundef nonnull %38) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = load i8, ptr %23, align 1, !tbaa !14
  %41 = zext i8 %40 to i64
  %42 = icmp ult i64 %indvars.iv.next, %41
  br i1 %42, label %34, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %34, %25
  %43 = getelementptr inbounds i8, ptr %31, i64 %28
  store i8 0, ptr %43, align 2, !tbaa !13
  %44 = load ptr, ptr %0, align 8, !tbaa !18
  %45 = getelementptr inbounds i8, ptr %0, i64 8
  %46 = getelementptr inbounds i8, ptr %23, i64 11
  %47 = load i8, ptr %46, align 1, !tbaa !21
  %48 = call i32 @MFRC522_PICC_GetType(i8 noundef zeroext %47) #4
  %49 = call ptr @MFRC522_PICC_GetTypeName(i32 noundef %48) #4
  %50 = load ptr, ptr %45, align 8
  call void (ptr, i32, i32, ...) %44(ptr %50, i32 noundef 1, i32 noundef 5, ptr noundef nonnull @.str.1, ptr noundef nonnull %31, ptr noundef %49) #4
  call void (...) @MFRC522_PCD_AntennaOff() #4
  call void @llvm.stackrestore.p0(ptr %30)
  br label %53

.critedge:                                        ; preds = %22, %19
  %.027 = phi i32 [ %20, %19 ], [ %24, %22 ]
  %51 = call i32 (...) @MFRC522_PICC_HaltA() #4
  call void (...) @MFRC522_PCD_AntennaOff() #4
  %52 = call ptr @MFRC522_GetStatusCodeName(i32 noundef %.027) #4
  call void @dh_command_fail(ptr noundef %0, ptr noundef %52) #4
  br label %53

53:                                               ; preds = %._crit_edge, %.critedge
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %7) #4
  br label %54

54:                                               ; preds = %18, %53
  ret void
}

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

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

declare void @dh_command_fail(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @MFRC522_Set_CS(i32 noundef) local_unnamed_addr #2

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

declare void @MFRC522_PCD_Init(...) local_unnamed_addr #2

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

declare ptr @MFRC522_Get_Uid(...) local_unnamed_addr #2

declare i32 @MFRC522_PICC_Select(ptr noundef, i8 noundef zeroext) local_unnamed_addr #2

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

declare i32 @byteToHex(i8 noundef zeroext, ptr noundef) local_unnamed_addr #2

declare ptr @MFRC522_PICC_GetTypeName(i32 noundef) local_unnamed_addr #2

declare i32 @MFRC522_PICC_GetType(i8 noundef zeroext) local_unnamed_addr #2

declare void @MFRC522_PCD_AntennaOff(...) local_unnamed_addr #2

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

declare i32 @MFRC522_PICC_HaltA(...) local_unnamed_addr #2

declare ptr @MFRC522_GetStatusCodeName(i32 noundef) local_unnamed_addr #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 nocallback nofree nosync nounwind willreturn }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 396}
!10 = !{!"", !11, i64 0, !11, i64 2, !11, i64 4, !11, i64 6, !11, i64 8, !11, i64 10, !11, i64 12, !11, i64 14, !11, i64 16, !11, i64 18, !11, i64 20, !6, i64 24, !6, i64 28, !7, i64 32, !11, i64 96, !6, i64 100, !7, i64 104, !7, i64 105, !7, i64 106, !7, i64 107, !6, i64 372, !6, i64 376, !6, i64 380, !6, i64 384, !6, i64 388, !6, i64 392, !6, i64 396, !6, i64 400, !12, i64 404}
!11 = !{!"short", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !7, i64 0}
!15 = !{!"", !7, i64 0, !7, i64 1, !7, i64 11}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !20, i64 0}
!19 = !{!"", !20, i64 0, !7, i64 8}
!20 = !{!"any pointer", !7, i64 0}
!21 = !{!15, !7, i64 11}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass