aboutsummaryrefslogtreecommitdiff
path: root/lib.s
diff options
context:
space:
mode:
Diffstat (limited to 'lib.s')
-rw-r--r--lib.s34
1 files changed, 13 insertions, 21 deletions
diff --git a/lib.s b/lib.s
index 32e5a77..e57735c 100644
--- a/lib.s
+++ b/lib.s
@@ -17,19 +17,17 @@ _func_printf:
j __L2
__L1:
# t2 = ch_2 == 37
- li $3, 37
- seq $13, $8, $3
+# seq $13, $8, 37
# if not (t2) goto __L20
- beqz $13, __L20
+ bne $8, 37, __L20
# fmt_4 = fmt_1 + 1
addiu $9, $9, 1
# ch_4 = fmt_4[0]
lb $8, 0($9)
# t4 = ch_4 == 100
- li $3, 100
- seq $13, $8, $3
+# seq $13, $8, 100
# if not (t4) goto __L6
- beqz $13, __L6
+ bne $8, 100, __L6
# t6 = arg_2[0]
lw $a0, 0($12)
li $2, 1
@@ -38,10 +36,9 @@ __L1:
j __L19
__L6:
# t7 = ch_4 == 99
- li $3, 99
- seq $13, $8, $3
+# seq $13, $8, 99
# if not (t7) goto __L8
- beqz $13, __L8
+ bne $8, 99, __L8
# t9 = arg_2[0]
lw $a0, 0($12)
li $2, 11
@@ -50,10 +47,9 @@ __L6:
j __L19
__L8:
# t10 = ch_4 == 115
- li $3, 115
- seq $13, $8, $3
+# seq $13, $8, 115
# if not (t10) goto __L10
- beqz $13, __L10
+ bne $8, 115 __L10
# t12 = arg_2[0]
lw $a0, 0($12)
li $2, 4
@@ -64,10 +60,9 @@ __L10:
# x_4 = arg_2[0]
lw $10, 0($12)
# t14 = x_4 == 0
- li $3, 0
- seq $11, $10, $3
+# seq $11, $10, 0
# if not (t14) goto __L12
- beqz $11, __L12
+ bne $10, 0, __L12
# len_11 = 1
li $2, 1
move $11 $2
@@ -81,8 +76,7 @@ __L12:
j __L14
__L13:
# x_7 = x_6 / 10
- li $3, 10
- divu $10, $10, $3
+ divu $10, $10, 10
# len_10 = len_9 + 1
addiu $11, $11, 1
__L14:
@@ -90,8 +84,7 @@ __L14:
bnez $10, __L13
__L15:
# len_5 = 4 - len_4
- li $2, 4
- subu $11, $2, $11
+ subu $11, $2, 4
# goto __L17
j __L17
__L16:
@@ -100,8 +93,7 @@ __L16:
li $2, 11
syscall
# len_7 = len_6 - 1
- li $3, 1
- subu $11, $11, $3
+ subu $11, $11, 1
__L17:
# if (len_6) goto __L16
bnez $11, __L16