program sample
    implicit none  !二分探索
    integer(8) ::c,i,j,m(12),n,k,a1,b1,c1
    character::a(2)
    character(len=1),allocatable::s(:)
    character(len=1)::t(1:26)
    t=(/'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'/)
    read(*,*) n

    do i=1,12
        m(i)=0
    end do
    j=0
    do while (n>0)
        j=j+1
        m(j)=mod(n,26)
        if (m(j)==0)then
            m(j)=26
            n=n/26-1
        else
            n=n/26
        end if
        
    end do
    allocate(s(j))
    do i=1,j
        s(j+1-i)=t(m(i))
    end do
    write(*,'(a,a,a,a,a,a,a,a,a,a,a,a,a)')s
    

    deallocate(s)
    stop

end program sample
  


; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QFEm = internal unnamed_addr global [12 x i64] undef
@_QFEs.0 = internal unnamed_addr global ptr null
@_QFEs.8 = internal unnamed_addr global i64 0
@_QQro.26x1xc1.c3fcd3d76192e4007dfb496cca67e13b = internal unnamed_addr constant [26 x [1 x i8]] [[1 x i8] c"a", [1 x i8] c"b", [1 x i8] c"c", [1 x i8] c"d", [1 x i8] c"e", [1 x i8] c"f", [1 x i8] c"g", [1 x i8] c"h", [1 x i8] c"i", [1 x i8] c"j", [1 x i8] c"k", [1 x i8] c"l", [1 x i8] c"m", [1 x i8] c"n", [1 x i8] c"o", [1 x i8] c"p", [1 x i8] c"q", [1 x i8] c"r", [1 x i8] c"s", [1 x i8] c"t", [1 x i8] c"u", [1 x i8] c"v", [1 x i8] c"w", [1 x i8] c"x", [1 x i8] c"y", [1 x i8] c"z"]
@_QQcl.2bebe2b51a33eaff3813c8cb4c3ac39a = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1130/source.f\00"
@_QQcl.28612C612C612C612C612C612C612C612C612C612C612C612C6129 = linkonce constant [27 x i8] c"(a,a,a,a,a,a,a,a,a,a,a,a,a)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #2 {
thread-pre-split:
  %0 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %1 = alloca i64, align 8
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.2bebe2b51a33eaff3813c8cb4c3ac39a, i32 8)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 8)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(96) @_QFEm, i8 0, i64 96, i1 false), !tbaa !3
  %.pr = load i64, ptr %1, align 8, !tbaa !3
  %5 = icmp sgt i64 %.pr, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %thread-pre-split, %.backedge
  %.0204 = phi i64 [ %7, %.backedge ], [ 0, %thread-pre-split ]
  %6 = phi i64 [ %storemerge, %.backedge ], [ %.pr, %thread-pre-split ]
  %7 = add i64 %.0204, 1
  %8 = urem i64 %6, 26
  %9 = udiv i64 %6, 26
  %10 = getelementptr [12 x i64], ptr @_QFEm, i64 0, i64 %.0204
  store i64 %8, ptr %10, align 8, !tbaa !3
  %11 = icmp eq i64 %8, 0
  br i1 %11, label %12, label %.backedge

12:                                               ; preds = %.lr.ph
  store i64 26, ptr %10, align 8, !tbaa !3
  %13 = udiv i64 %6, 26
  %14 = add nsw i64 %13, -1
  br label %.backedge

.backedge:                                        ; preds = %.lr.ph, %12
  %storemerge = phi i64 [ %14, %12 ], [ %9, %.lr.ph ]
  %15 = icmp sgt i64 %storemerge, 0
  br i1 %15, label %.lr.ph, label %._crit_edge.loopexit

._crit_edge.loopexit:                             ; preds = %.backedge
  store i64 %storemerge, ptr %1, align 8, !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %thread-pre-split
  %.0.lcssa = phi i64 [ 0, %thread-pre-split ], [ %7, %._crit_edge.loopexit ]
  %16 = call i64 @llvm.smax.i64(i64 %.0.lcssa, i64 0)
  %17 = call ptr @malloc(i64 %16)
  store ptr %17, ptr @_QFEs.0, align 8, !tbaa !7
  store i64 %16, ptr @_QFEs.8, align 8, !tbaa !7
  %18 = icmp sgt i64 %.0.lcssa, 0
  br i1 %18, label %.lr.ph206.preheader, label %._crit_edge207

.lr.ph206.preheader:                              ; preds = %._crit_edge
  %xtraiter = and i64 %.0.lcssa, 1
  %19 = icmp eq i64 %.0.lcssa, 1
  br i1 %19, label %._crit_edge207.loopexit.unr-lcssa, label %.lr.ph206.preheader.new

.lr.ph206.preheader.new:                          ; preds = %.lr.ph206.preheader
  %unroll_iter = and i64 %.0.lcssa, -2
  br label %.lr.ph206

.lr.ph206:                                        ; preds = %.lr.ph206, %.lr.ph206.preheader.new
  %20 = phi i64 [ 1, %.lr.ph206.preheader.new ], [ %32, %.lr.ph206 ]
  %niter = phi i64 [ 0, %.lr.ph206.preheader.new ], [ %niter.next.1, %.lr.ph206 ]
  %21 = add nsw i64 %20, -1
  %22 = getelementptr [12 x i64], ptr @_QFEm, i64 0, i64 %21
  %23 = load i64, ptr %22, align 8, !tbaa !3
  %24 = add i64 %23, -1
  %25 = getelementptr [26 x [1 x i8]], ptr @_QQro.26x1xc1.c3fcd3d76192e4007dfb496cca67e13b, i64 0, i64 %24
  %.neg = xor i64 %20, -1
  %26 = sub nsw i64 %.0.lcssa, %20
  %27 = getelementptr [1 x i8], ptr %17, i64 %26
  %.fca.0.load = load i8, ptr %25, align 1, !tbaa !3
  store i8 %.fca.0.load, ptr %27, align 1, !tbaa !3
  %28 = getelementptr [12 x i64], ptr @_QFEm, i64 0, i64 %20
  %29 = load i64, ptr %28, align 8, !tbaa !3
  %30 = add i64 %29, -1
  %31 = getelementptr [26 x [1 x i8]], ptr @_QQro.26x1xc1.c3fcd3d76192e4007dfb496cca67e13b, i64 0, i64 %30
  %32 = add nuw i64 %20, 2
  %33 = add i64 %.0.lcssa, %.neg
  %34 = getelementptr [1 x i8], ptr %17, i64 %33
  %.fca.0.load.1 = load i8, ptr %31, align 1, !tbaa !3
  store i8 %.fca.0.load.1, ptr %34, align 1, !tbaa !3
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge207.loopexit.unr-lcssa, label %.lr.ph206

._crit_edge207.loopexit.unr-lcssa:                ; preds = %.lr.ph206, %.lr.ph206.preheader
  %.unr = phi i64 [ 1, %.lr.ph206.preheader ], [ %32, %.lr.ph206 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge207, label %.lr.ph206.epil

.lr.ph206.epil:                                   ; preds = %._crit_edge207.loopexit.unr-lcssa
  %35 = add nsw i64 %.unr, -1
  %36 = getelementptr [12 x i64], ptr @_QFEm, i64 0, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !3
  %38 = add i64 %37, -1
  %39 = getelementptr [26 x [1 x i8]], ptr @_QQro.26x1xc1.c3fcd3d76192e4007dfb496cca67e13b, i64 0, i64 %38
  %40 = sub nsw i64 %.0.lcssa, %.unr
  %41 = getelementptr [1 x i8], ptr %17, i64 %40
  %.fca.0.load.epil = load i8, ptr %39, align 1, !tbaa !3
  store i8 %.fca.0.load.epil, ptr %41, align 1, !tbaa !3
  br label %._crit_edge207

._crit_edge207:                                   ; preds = %.lr.ph206.epil, %._crit_edge207.loopexit.unr-lcssa, %._crit_edge
  %42 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28612C612C612C612C612C612C612C612C612C612C612C612C6129, i64 27, ptr null, i32 -1, ptr nonnull @_QQcl.2bebe2b51a33eaff3813c8cb4c3ac39a, i32 29)
  %.unpack = load ptr, ptr @_QFEs.0, align 8, !tbaa !7
  %.unpack174.unpack.unpack176 = load i64, ptr @_QFEs.8, align 8, !tbaa !7
  store ptr %.unpack, ptr %0, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 1
  store i64 1, ptr %.fca.1.gep, align 8, !tbaa !7
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 1
  store i64 %.unpack174.unpack.unpack176, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  store i64 1, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %43 = call i1 @_FortranAioOutputDescriptor(ptr %42, ptr nonnull %0)
  %44 = call i32 @_FortranAioEndIoStatement(ptr %42)
  %.unpack179 = load ptr, ptr @_QFEs.0, align 8, !tbaa !7
  call void @free(ptr %.unpack179)
  store ptr null, ptr @_QFEs.0, align 8, !tbaa !7
  store i64 0, ptr @_QFEs.8, align 8, !tbaa !7
  %45 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputDescriptor(ptr, ptr) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #2 = { noreturn }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }

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

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
