1# Copyright (c) 2021-2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14.language PandaAssembly 15 16.function i32 main() { 17 movi v0, 0x2 18 movi v1, 0x2710 19 movi v2, 0x3 20 movi v3, 0x1 21 movi v4, 0x0 22 movi v6, 0x13881 23 newarr v5, v6, u1[] 24 mov v6, v4 25 mov v7, v3 26 jump_label_8: lda v7 27 jgt v2, jump_label_0 28 shl v3, v7 29 mul2 v1 30 sta v8 31 mov v9, v0 32 jump_label_2: lda v9 33 jgt v8, jump_label_1 34 lda v3 35 starr.8 v5, v9 36 inci v9, 0x1 37 jmp jump_label_2 38 jump_label_1: mov v9, v4 39 mov v10, v0 40 jump_label_7: lda v10 41 jgt v8, jump_label_3 42 lda v10 43 ldarr.8 v5 44 jeqz jump_label_4 45 add v10, v10 46 sta v11 47 jump_label_6: lda v11 48 jgt v8, jump_label_5 49 lda v4 50 starr.8 v5, v11 51 add v11, v10 52 sta v11 53 jmp jump_label_6 54 jump_label_5: lda v9 55 addi 0x1 56 sta v11 57 mov v9, v11 58 jump_label_4: inci v10, 0x1 59 jmp jump_label_7 60 jump_label_3: add v9, v6 61 sta v8 62 lda v7 63 addi 0x1 64 sta v6 65 mov v7, v6 66 mov v6, v8 67 jmp jump_label_8 68 jump_label_0: movi v0, 0x37de 69 lda v6 70 jeq v0, jump_label_9 71 ldai 0xffffffffffffffff 72 return 73 jump_label_9: lda v4 74 ldai 0 75 return 76}