; LLVM IR from artagnon/phoenixfs :: main (main)

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

@.str = external hidden unnamed_addr constant [61 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %6 = call i32 @getuid() #4
  %7 = icmp eq i32 %6, 0
  br i1 %7, label %11, label %8

8:                                                ; preds = %2
  %9 = call i32 @geteuid() #4
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %11, label %12

11:                                               ; preds = %8, %2
  call void (ptr, ...) @die(ptr noundef @.str)
  br label %12

12:                                               ; preds = %11, %8
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 2
  br i1 %14, label %15, label %19

15:                                               ; preds = %12
  %16 = load ptr, ptr %5, align 8, !tbaa !9
  %17 = getelementptr inbounds ptr, ptr %16, i64 0
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  call void @usage(ptr noundef %18, i32 noundef 0)
  br label %19

19:                                               ; preds = %15, %12
  %20 = load ptr, ptr %5, align 8, !tbaa !9
  %21 = getelementptr inbounds ptr, ptr %20, i64 1
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = call i32 @strncmp(ptr noundef %22, ptr noundef @.str.1, i64 noundef 5) #5
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %36, label %25

25:                                               ; preds = %19
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = icmp slt i32 %26, 3
  br i1 %27, label %28, label %32

28:                                               ; preds = %25
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = getelementptr inbounds ptr, ptr %29, i64 0
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  call void @usage(ptr noundef %31, i32 noundef 1)
  br label %32

32:                                               ; preds = %28, %25
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = call i32 @phoenixfs_fuse(i32 noundef %33, ptr noundef %34)
  store i32 %35, ptr %3, align 4
  br label %80

36:                                               ; preds = %19
  %37 = load ptr, ptr %5, align 8, !tbaa !9
  %38 = getelementptr inbounds ptr, ptr %37, i64 1
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = call i32 @strncmp(ptr noundef %39, ptr noundef @.str.2, i64 noundef 3) #5
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %53, label %42

42:                                               ; preds = %36
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = icmp slt i32 %43, 2
  br i1 %44, label %45, label %49

45:                                               ; preds = %42
  %46 = load ptr, ptr %5, align 8, !tbaa !9
  %47 = getelementptr inbounds ptr, ptr %46, i64 0
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  call void @usage(ptr noundef %48, i32 noundef 2)
  br label %49

49:                                               ; preds = %45, %42
  %50 = load ptr, ptr %5, align 8, !tbaa !9
  %51 = getelementptr inbounds ptr, ptr %50, i64 2
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  call void @subcmd_log(ptr noundef %52)
  br label %78

53:                                               ; preds = %36
  %54 = load ptr, ptr %5, align 8, !tbaa !9
  %55 = getelementptr inbounds ptr, ptr %54, i64 1
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  %57 = call i32 @strncmp(ptr noundef %56, ptr noundef @.str.3, i64 noundef 4) #5
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %73, label %59

59:                                               ; preds = %53
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = icmp slt i32 %60, 4
  br i1 %61, label %62, label %66

62:                                               ; preds = %59
  %63 = load ptr, ptr %5, align 8, !tbaa !9
  %64 = getelementptr inbounds ptr, ptr %63, i64 0
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  call void @usage(ptr noundef %65, i32 noundef 3)
  br label %66

66:                                               ; preds = %62, %59
  %67 = load ptr, ptr %5, align 8, !tbaa !9
  %68 = getelementptr inbounds ptr, ptr %67, i64 2
  %69 = load ptr, ptr %68, align 8, !tbaa !9
  %70 = load ptr, ptr %5, align 8, !tbaa !9
  %71 = getelementptr inbounds ptr, ptr %70, i64 3
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  call void @subcmd_diff(ptr noundef %69, ptr noundef %72)
  br label %77

73:                                               ; preds = %53
  %74 = load ptr, ptr %5, align 8, !tbaa !9
  %75 = getelementptr inbounds ptr, ptr %74, i64 0
  %76 = load ptr, ptr %75, align 8, !tbaa !9
  call void @usage(ptr noundef %76, i32 noundef 0)
  br label %77

77:                                               ; preds = %73, %66
  br label %78

78:                                               ; preds = %77, %49
  br label %79

79:                                               ; preds = %78
  store i32 0, ptr %3, align 4
  br label %80

80:                                               ; preds = %79, %32
  %81 = load i32, ptr %3, align 4
  ret i32 %81
}

; Function Attrs: nounwind
declare i32 @getuid() #1

; Function Attrs: nounwind
declare i32 @geteuid() #1

declare void @die(ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare hidden void @usage(ptr noundef, i32 noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare hidden void @subcmd_log(ptr noundef) #0

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

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 = { 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 #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 }
attributes #5 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


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

@.str = external hidden unnamed_addr constant [61 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call i32 @getuid() #4
  %4 = icmp eq i32 %3, 0
  br i1 %4, label %8, label %5

5:                                                ; preds = %2
  %6 = tail call i32 @geteuid() #4
  %7 = icmp eq i32 %6, 0
  br i1 %7, label %8, label %9

8:                                                ; preds = %5, %2
  tail call void (ptr, ...) @die(ptr noundef nonnull @.str) #4
  br label %9

9:                                                ; preds = %8, %5
  %10 = icmp slt i32 %0, 2
  br i1 %10, label %11, label %13

11:                                               ; preds = %9
  %12 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @usage(ptr noundef %12, i32 noundef 0)
  br label %13

13:                                               ; preds = %11, %9
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %15, ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef 5) #5
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %17, label %23

17:                                               ; preds = %13
  %18 = icmp slt i32 %0, 3
  br i1 %18, label %19, label %21

19:                                               ; preds = %17
  %20 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @usage(ptr noundef %20, i32 noundef 1)
  br label %21

21:                                               ; preds = %19, %17
  %22 = tail call i32 @phoenixfs_fuse(i32 noundef %0, ptr noundef nonnull %1) #4
  br label %44

23:                                               ; preds = %13
  %24 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %15, ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 3) #5
  %.not17 = icmp eq i32 %24, 0
  br i1 %.not17, label %25, label %31

25:                                               ; preds = %23
  br i1 %10, label %26, label %28

26:                                               ; preds = %25
  %27 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @usage(ptr noundef %27, i32 noundef 2)
  br label %28

28:                                               ; preds = %26, %25
  %29 = getelementptr inbounds i8, ptr %1, i64 16
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  tail call void @subcmd_log(ptr noundef %30)
  br label %44

31:                                               ; preds = %23
  %32 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %15, ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef 4) #5
  %.not18 = icmp eq i32 %32, 0
  br i1 %.not18, label %33, label %42

33:                                               ; preds = %31
  %34 = icmp slt i32 %0, 4
  br i1 %34, label %35, label %37

35:                                               ; preds = %33
  %36 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @usage(ptr noundef %36, i32 noundef 3)
  br label %37

37:                                               ; preds = %35, %33
  %38 = getelementptr inbounds i8, ptr %1, i64 16
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %1, i64 24
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  tail call void @subcmd_diff(ptr noundef %39, ptr noundef %41)
  br label %44

42:                                               ; preds = %31
  %43 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @usage(ptr noundef %43, i32 noundef 0)
  br label %44

44:                                               ; preds = %37, %42, %28, %21
  %.0 = phi i32 [ %22, %21 ], [ 0, %28 ], [ 0, %42 ], [ 0, %37 ]
  ret i32 %.0
}

; Function Attrs: nounwind
declare i32 @getuid() local_unnamed_addr #1

; Function Attrs: nounwind
declare i32 @geteuid() local_unnamed_addr #1

declare void @die(ptr noundef, ...) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @usage(ptr noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare hidden void @subcmd_log(ptr noundef) local_unnamed_addr #0

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

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 = { 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 #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(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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