max_stars_repo_path stringlengths 4 261 | max_stars_repo_name stringlengths 6 106 | max_stars_count int64 0 38.8k | id stringlengths 1 6 | text stringlengths 7 1.05M |
|---|---|---|---|---|
programs/oeis/121/A121801.asm | karttu/loda | 0 | 175976 | <reponame>karttu/loda<filename>programs/oeis/121/A121801.asm
; A121801: Expansion of 2*x^2*(3-x)/((1+x)*(1-3*x+x^2)).
; 0,6,10,32,78,210,544,1430,3738,9792,25630,67106,175680,459942,1204138,3152480,8253294,21607410,56568928,148099382,387729210,1015088256,2657535550,6957518402,18215019648,47687540550,124847601994,326855265440,855718194318,2240299317522,5865179758240,15355239957206,40200540113370,105246380382912,275538601035358,721369422723170,1888569667134144,4944339578679270
mov $35,$0
mov $37,$0
lpb $37,1
mov $0,$35
sub $37,1
sub $0,$37
mov $31,$0
mov $33,2
lpb $33,1
mov $0,$31
sub $33,1
add $0,$33
sub $0,1
mov $27,$0
mov $29,2
lpb $29,1
clr $0,27
mov $0,$27
sub $29,1
add $0,$29
sub $0,1
mov $1,$0
add $4,$0
sub $1,$4
fac $1
cal $4,200408 ; -4 + 5*Fibonacci(n+1)^2.
mul $1,$4
sub $1,1
mov $30,$29
lpb $30,1
mov $28,$1
sub $30,1
lpe
lpe
lpb $27,1
mov $27,0
sub $28,$1
lpe
mov $1,$28
mov $34,$33
lpb $34,1
mov $32,$1
sub $34,1
lpe
lpe
lpb $31,1
mov $31,0
sub $32,$1
lpe
mov $1,$32
div $1,5
mul $1,2
add $36,$1
lpe
mov $1,$36
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_118.asm | ljhsiun2/medusa | 9 | 2526 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0xaf8b, %rsi
lea addresses_A_ht+0x2ca3, %rdi
nop
nop
nop
add $17117, %r9
mov $11, %rcx
rep movsq
nop
nop
nop
nop
nop
add %r13, %r13
lea addresses_D_ht+0x1689f, %rsi
lea addresses_D_ht+0x140f, %rdi
nop
nop
nop
nop
nop
and %rbp, %rbp
mov $113, %rcx
rep movsq
cmp %rdi, %rdi
lea addresses_normal_ht+0x16c9f, %rdi
nop
nop
nop
add $53901, %r12
mov (%rdi), %r9w
nop
sub %r13, %r13
lea addresses_D_ht+0xf17f, %rsi
lea addresses_WT_ht+0x1217e, %rdi
nop
cmp $5426, %rbp
mov $23, %rcx
rep movsl
nop
nop
nop
cmp $22000, %rsi
lea addresses_normal_ht+0x6c9f, %rsi
lea addresses_WT_ht+0x9731, %rdi
clflush (%rdi)
nop
sub %r13, %r13
mov $122, %rcx
rep movsq
cmp $59623, %rcx
lea addresses_WT_ht+0x1eff, %rsi
nop
nop
nop
cmp %rcx, %rcx
movl $0x61626364, (%rsi)
nop
nop
nop
xor %rcx, %rcx
lea addresses_D_ht+0x5488, %r13
xor $47898, %rsi
mov $0x6162636465666768, %rbp
movq %rbp, %xmm1
movups %xmm1, (%r13)
nop
nop
nop
xor $56654, %r12
lea addresses_A_ht+0x934f, %r9
sub $32579, %rsi
mov $0x6162636465666768, %r12
movq %r12, (%r9)
nop
nop
nop
nop
xor $5294, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %r8
push %rbp
push %rdi
// Faulty Load
lea addresses_RW+0x6c9f, %rdi
nop
nop
nop
sub %rbp, %rbp
vmovups (%rdi), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %r15
lea oracles, %r8
and $0xff, %r15
shlq $12, %r15
mov (%r8,%r15,1), %r15
pop %rdi
pop %rbp
pop %r8
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
applescript/display-prefs.applescript | phchang/my-setup | 0 | 3387 | <gh_stars>0
delay 2.0
tell application "System Events"
key code 53 using {control down} -- start menu
delay 0.2
keystroke "run"
delay 0.5
keystroke return
delay 0.4
keystroke "systempropertiesperformance.exe"
keystroke return
delay 0.4
keystroke "p" -- clear out selections
delay 0.2
key code 48 -- tab
repeat 9 times -- "Show shadows under windows"
delay 0.1
key code 125
end repeat
delay 0.1
key code 49 -- spacebar
repeat 3 times -- "Show window contents while dragging"
delay 0.1
key code 125
end repeat
delay 0.1
key code 49 -- spacebar
delay 0.1
repeat 2 times -- "Smooth edges of screen fonts"
delay 0.1
key code 125
end repeat
key code 49 -- spacebar
key code 48 -- tab to "OK"
key code 49 -- spacebar
end tell
|
alloy4fun_models/trashltl/models/7/yNXxzRaXkgsRhCtHm.als | Kaixi26/org.alloytools.alloy | 0 | 4286 | <gh_stars>0
open main
pred idyNXxzRaXkgsRhCtHm_prop8 {
eventually (all f : File | some f.link implies f in Trash)
}
pred __repair { idyNXxzRaXkgsRhCtHm_prop8 }
check __repair { idyNXxzRaXkgsRhCtHm_prop8 <=> prop8o } |
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1225.asm | ljhsiun2/medusa | 9 | 170755 | <filename>Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1225.asm
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r8
push %rbp
push %rbx
push %rcx
push %rsi
// Store
lea addresses_normal+0x1550c, %rbx
nop
xor %r12, %r12
movb $0x51, (%rbx)
nop
nop
nop
inc %r10
// Store
mov $0xe8, %rsi
nop
nop
nop
nop
dec %r8
mov $0x5152535455565758, %rbp
movq %rbp, %xmm6
movups %xmm6, (%rsi)
nop
add %rbp, %rbp
// Faulty Load
lea addresses_WT+0x154e8, %r12
nop
add %rsi, %rsi
movb (%r12), %r8b
lea oracles, %rcx
and $0xff, %r8
shlq $12, %r8
mov (%rcx,%r8,1), %r8
pop %rsi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_normal'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_P'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
Xkye.g4 | RahmanAnsari/xkye-lang | 0 | 2527 | <filename>Xkye.g4
/*
MIT License
Copyright (c) 2021, <NAME>
All rights reserved.
*/
grammar Xkye;
globe
: ((clutchheader)? (globalgroup (outstring)* ))? ( (pairgroupset (outstring)*) | ((pairgroupset (subclutchset)+ ) (outstring)*) )* EOF
;
clutchheader
: LBRACKET LBRACKET 'global' RBRACKET RBRACKET
;
clutchdefheader
: LBRACKET LBRACKET entity RBRACKET RBRACKET
;
clutchsetheader
: LBRACKET LBRACKET entity RBRACKET LBRACKET number RBRACKET RBRACKET
;
subclutchset
: (clutchdefheader | clutchsetheader) subclutchgroup
;
pairgroupset
: (clutchdefheader | clutchsetheader) pairgroup
;
globalgroup
: ((clutchspan)* pairgroup )+
;
subclutch
: ((LBRACKET entity RBRACKET) | (LBRACKET entity RBRACKET LBRACKET number RBRACKET))
;
subclutchgroup
: subclutch+
;
pairgroup
: pair+
;
clutchspan
: LBRACKET LBRACKET entity RBRACKET RBRACKET LPAREN number RPAREN
;
entity
: ENTITY
;
key
: AT entity
;
value
: (INTEGER_DIGITS | INTEGER_FLOAT | STRING | IP | OCTET | SUBNET | BOOLEAN)
;
pair
: key value
;
number
: (INTEGER_DIGITS | OCTET)
;
outstring
: QUESTIONMARK entity (outstringsubset)?
;
outstringsubset
: BACKSLASH entity (LPAREN number RPAREN)?
;
fragment A
: ('a' | 'A')
;
fragment B
: ('b' | 'B')
;
fragment C
: ('c' | 'C')
;
fragment D
: ('d' | 'D')
;
fragment E
: ('e' | 'E')
;
fragment F
: ('f' | 'F')
;
fragment G
: ('g' | 'G')
;
fragment H
: ('h' | 'H')
;
fragment I
: ('i' | 'I')
;
fragment J
: ('j' | 'J')
;
fragment K
: ('k' | 'K')
;
fragment L
: ('l' | 'L')
;
fragment M
: ('m' | 'M')
;
fragment N
: ('n' | 'N')
;
fragment O
: ('o' | 'O')
;
fragment P
: ('p' | 'P')
;
fragment Q
: ('q' | 'Q')
;
fragment R
: ('r' | 'R')
;
fragment S
: ('s' | 'S')
;
fragment T
: ('t' | 'T')
;
fragment U
: ('u' | 'U')
;
fragment V
: ('v' | 'V')
;
fragment W
: ('w' | 'W')
;
fragment X
: ('x' | 'X')
;
fragment Y
: ('y' | 'Y')
;
fragment Z
: ('z' | 'Z')
;
fragment DIGIT
: '0'..'9'
;
IP
: OCTET DOT OCTET DOT OCTET DOT OCTET
;
SUBNET
: IP+'/'+OCTET
;
UNDERSCORE
: '_'
;
QUESTIONMARK
: '?'
;
BACKSLASH
: '\\'
;
AT
: '@'
;
DOT
: '.'
;
LBRACKET
: '['
;
RBRACKET
: ']'
;
LPAREN
: '('
;
RPAREN
: ')'
;
BOOLEAN
: TRUE
| FALSE
;
TRUE
: [Tt] [Rr] [Uu] [Ee]
;
FALSE
: [Ff] [Aa] [Ll] [Ss] [Ee]
;
OCTET
: DIGIT DIGIT DIGIT
| DIGIT DIGIT
| DIGIT
;
INTEGER_FLOAT
: [0-9]+ '.' [0-9]+
;
INTEGER_DIGITS
: [0-9]+
;
STRING
: '\'' .*? '\''
;
ENTITY
: [a-z][a-z0-9_]*
;
LINE_COMMENT
: '#' ~ [\r\n]* -> skip
;
BLOCK_COMMENT
: '"""' .*? '"""' -> skip
;
WS
: [ \r\n\t\u000C]+ -> skip
;
|
testAsmFiles/binary.asm | 0xGREG/Assembler | 0 | 18729 | # examples taken from nasm
# reference https://www.nasm.us/doc/nasmdoc3.html#section-3.2.1
DB 55 # just the byte 55
DB 0x55,56, 0x57 # three bytes in succession
DB 'a',0x55, 'A' # character constants are OK
.start
DB 'hello',13,10,'$' # so are string constants
DW 0x1234 # 0x34 0x12
DW 'a' # 0x61 0x00 (it's just a number)
DW "ab" # 0x61 0x62 (character constant)
DW 'abc' # 0x61 0x62 0x63 0x00 (string)
DD 0x12345678 # 0x78 0x56 0x34 0x12
DQ 0x123456789abcde # eight byte constant
# MOV eax, ebx
# BD
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_722.asm | ljhsiun2/medusa | 9 | 102758 | <filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_722.asm
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %r8
push %r9
push %rcx
push %rdi
// Faulty Load
lea addresses_PSE+0x3db2, %r10
nop
nop
xor %rdi, %rdi
mov (%r10), %rcx
lea oracles, %r8
and $0xff, %rcx
shlq $12, %rcx
mov (%r8,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
data/jpred4/jp_batch_1613899824__bz2n2lu/jp_batch_1613899824__bz2n2lu.als | jonriege/predict-protein-structure | 0 | 4472 | SILENT_MODE
BLOCK_FILE jp_batch_1613899824__bz2n2lu.concise.blc
MAX_NSEQ 124
MAX_INPUT_LEN 126
OUTPUT_FILE jp_batch_1613899824__bz2n2lu.concise.ps
PORTRAIT
POINTSIZE 8
IDENT_WIDTH 12
X_OFFSET 2
Y_OFFSET 2
DEFINE_FONT 0 Helvetica DEFAULT
DEFINE_FONT 1 Helvetica REL 0.75
DEFINE_FONT 7 Helvetica REL 0.6
DEFINE_FONT 3 Helvetica-Bold DEFAULT
DEFINE_FONT 4 Times-Bold DEFAULT
DEFINE_FONT 5 Helvetica-BoldOblique DEFAULT
#
DEFINE_COLOUR 3 1 0.62 0.67 # Turquiose
DEFINE_COLOUR 4 1 1 0 # Yellow
DEFINE_COLOUR 5 1 0 0 # Red
DEFINE_COLOUR 7 1 0 1 # Purple
DEFINE_COLOUR 8 0 0 1 # Blue
DEFINE_COLOUR 9 0 1 0 # Green
DEFINE_COLOUR 10 0.41 0.64 1.00 # Pale blue
DEFINE_COLOUR 11 0.41 0.82 0.67 # Pale green
DEFINE_COLOUR 50 0.69 0.18 0.37 # Pink (helix)
DEFINE_COLOUR 51 1.00 0.89 0.00 # Gold (strand)
NUMBER_INT 10
SETUP
#
# Highlight specific residues.
# Avoid highlighting Lupas 'C' predictions by
# limiting the highlighting to the alignments
Scol_CHARS C 1 1 172 113 4
Ccol_CHARS H ALL 5
Ccol_CHARS P ALL 8
SURROUND_CHARS LIV ALL
#
# Replace known structure types with whitespace
SUB_CHARS 1 114 172 123 H SPACE
SUB_CHARS 1 114 172 123 E SPACE
SUB_CHARS 1 114 172 123 - SPACE
STRAND 2 117 15
COLOUR_TEXT_REGION 2 117 15 117 51
STRAND 20 117 22
COLOUR_TEXT_REGION 20 117 22 117 51
STRAND 30 117 34
COLOUR_TEXT_REGION 30 117 34 117 51
STRAND 55 117 65
COLOUR_TEXT_REGION 55 117 65 117 51
STRAND 74 117 79
COLOUR_TEXT_REGION 74 117 79 117 51
STRAND 110 117 113
COLOUR_TEXT_REGION 110 117 113 117 51
STRAND 119 117 122
COLOUR_TEXT_REGION 119 117 122 117 51
STRAND 137 117 142
COLOUR_TEXT_REGION 137 117 142 117 51
STRAND 150 117 163
COLOUR_TEXT_REGION 150 117 163 117 51
HELIX 42 117 49
COLOUR_TEXT_REGION 42 117 49 117 50
HELIX 91 117 95
COLOUR_TEXT_REGION 91 117 95 117 50
STRAND 3 122 15
COLOUR_TEXT_REGION 3 122 15 122 51
STRAND 20 122 21
COLOUR_TEXT_REGION 20 122 21 122 51
STRAND 30 122 34
COLOUR_TEXT_REGION 30 122 34 122 51
STRAND 55 122 65
COLOUR_TEXT_REGION 55 122 65 122 51
STRAND 74 122 79
COLOUR_TEXT_REGION 74 122 79 122 51
STRAND 110 122 113
COLOUR_TEXT_REGION 110 122 113 122 51
STRAND 119 122 122
COLOUR_TEXT_REGION 119 122 122 122 51
STRAND 137 122 142
COLOUR_TEXT_REGION 137 122 142 122 51
STRAND 151 122 162
COLOUR_TEXT_REGION 151 122 162 122 51
HELIX 42 122 48
COLOUR_TEXT_REGION 42 122 48 122 50
HELIX 91 122 95
COLOUR_TEXT_REGION 91 122 95 122 50
STRAND 2 123 15
COLOUR_TEXT_REGION 2 123 15 123 51
STRAND 20 123 22
COLOUR_TEXT_REGION 20 123 22 123 51
STRAND 30 123 33
COLOUR_TEXT_REGION 30 123 33 123 51
STRAND 55 123 66
COLOUR_TEXT_REGION 55 123 66 123 51
STRAND 74 123 79
COLOUR_TEXT_REGION 74 123 79 123 51
STRAND 110 123 113
COLOUR_TEXT_REGION 110 123 113 123 51
STRAND 119 123 122
COLOUR_TEXT_REGION 119 123 122 123 51
STRAND 137 123 143
COLOUR_TEXT_REGION 137 123 143 123 51
STRAND 150 123 163
COLOUR_TEXT_REGION 150 123 163 123 51
HELIX 42 123 50
COLOUR_TEXT_REGION 42 123 50 123 50
HELIX 53 123 54
COLOUR_TEXT_REGION 53 123 54 123 50
HELIX 91 123 95
COLOUR_TEXT_REGION 91 123 95 123 50
|
Relation/Binary/Construct/Symmetrize.agda | Taneb/agda-categories | 0 | 5190 | {-# OPTIONS --without-K --safe #-}
-- Take a relation that is already reflexive and transitive
-- and make it symmetric.
-- (Borrowed from Categories/Support/ZigZag from copumpkin's Categories library
module Relation.Binary.Construct.Symmetrize where
open import Level
open import Relation.Binary
open import Relation.Binary.Construct.On using () renaming (isEquivalence to on-preserves-equivalence)
data Direction : Set where
↘ ↗ : Direction
rotate : Direction → Direction
rotate ↘ = ↗
rotate ↗ = ↘
private
variable
c ℓ₁ ℓ₂ : Level
Carrier : Set c
data ZigZag′ (_∼_ : Rel Carrier ℓ₂) : (x y : Carrier) (begin end : Direction) → Set (levelOfTerm x ⊔ ℓ₂) where
zig : ∀ {x y z e} (first : x ∼ y) (rest : ZigZag′ _∼_ y z ↗ e) → ZigZag′ _∼_ x z ↘ e
zag : ∀ {x y z e} (first : y ∼ x) (rest : ZigZag′ _∼_ y z ↘ e) → ZigZag′ _∼_ x z ↗ e
slish : ∀ {x y} (last : x ∼ y) → ZigZag′ _∼_ x y ↘ ↘
slash : ∀ {x y} (last : y ∼ x) → ZigZag′ _∼_ x y ↗ ↗
data Alternating′ (_∼_ : Carrier -> Carrier -> Set ℓ₂) (x y : Carrier) : Set (levelOfTerm x ⊔ ℓ₂) where
disorient : ∀ {begin end} (zz : ZigZag′ _∼_ x y begin end) → Alternating′ _∼_ x y
module _ (Base : Preorder c ℓ₁ ℓ₂) where
ZigZag : (x y : Preorder.Carrier Base) (begin end : Direction) → Set (c ⊔ ℓ₂)
ZigZag = ZigZag′ (Preorder._∼_ Base)
private
sym′ : {x y z : Preorder.Carrier Base} {begin middle end : Direction} → ZigZag y z middle end →
ZigZag y x middle begin → ZigZag z x (rotate end) begin
sym′ (zig first rest) accum = sym′ rest (zag first accum)
sym′ (zag first rest) accum = sym′ rest (zig first accum)
sym′ (slish last) accum = zag last accum
sym′ (slash last) accum = zig last accum
sym : ∀ {x y begin end} → ZigZag x y begin end → ZigZag y x (rotate end) (rotate begin)
sym (zig first rest) = sym′ rest (slash first)
sym (zag first rest) = sym′ rest (slish first)
sym (slish last) = slash last
sym (slash last) = slish last
trans : ∀ {x y z begin end begin′ end′} → ZigZag x y begin end → ZigZag y z begin′ end′ → ZigZag x z begin end′
trans (zig first rest) yz = zig first (trans rest yz)
trans (zag first rest) yz = zag first (trans rest yz)
trans (slish last) (zig first rest) = zig (Preorder.trans Base last first) rest
trans (slish last) (zag first rest) = zig last (zag first rest)
trans (slish last) (slish only) = slish (Preorder.trans Base last only)
trans (slish last) (slash only) = zig last (slash only)
trans (slash last) (zig first rest) = zag last (zig first rest)
trans (slash last) (zag first rest) = zag (Preorder.trans Base first last) rest
trans (slash last) (slish only) = zag last (slish only)
trans (slash last) (slash only) = slash (Preorder.trans Base only last)
Alternating : (x y : Preorder.Carrier Base) → Set (c ⊔ ℓ₂)
Alternating = Alternating′ (Preorder._∼_ Base)
private
is-equivalence : IsEquivalence Alternating
is-equivalence = record
{ refl = disorient (slash (Preorder.refl Base))
; sym = λ where (disorient zz) → disorient (sym zz)
; trans = λ where (disorient ij) (disorient jk) → disorient (trans ij jk)
}
setoid : Setoid c (c ⊔ ℓ₂)
setoid = record
{ Carrier = Preorder.Carrier Base
; _≈_ = Alternating
; isEquivalence = is-equivalence
}
-- the main eliminators for Alternating -- they prove that any equivalence that
-- respects the base preorder also respects its Alternating completion.
locally-minimal : ∀ {ℓ′} {_≈_ : Rel (Preorder.Carrier Base) ℓ′} (≈-isEquivalence : IsEquivalence _≈_) →
(Preorder._∼_ Base ⇒ _≈_) → (Alternating ⇒ _≈_)
locally-minimal {_} {_≋_} isEq inj (disorient zz) = impl zz
where
open IsEquivalence isEq renaming (sym to >sym; trans to _>trans>_)
impl : {i j : Preorder.Carrier Base} {b e : Direction} → ZigZag i j b e → i ≋ j
impl (zig first rest) = inj first >trans> impl rest
impl (zag first rest) = >sym (inj first) >trans> impl rest
impl (slish last) = inj last
impl (slash last) = >sym (inj last)
minimal : ∀ {c′ ℓ′} (Dest : Setoid c′ ℓ′) (f : Preorder.Carrier Base → Setoid.Carrier Dest) →
(Preorder._∼_ Base =[ f ]⇒ Setoid._≈_ Dest) → (Alternating =[ f ]⇒ Setoid._≈_ Dest)
minimal Dest f inj = locally-minimal (on-preserves-equivalence f (Setoid.isEquivalence Dest)) inj
|
time.asm | Tookerton21/Xv6_OS | 0 | 167158 |
_time: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "types.h"
#include "user.h"
int main(int argc, char* argv[]){
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 56 push %esi
e: 53 push %ebx
f: 51 push %ecx
10: 83 ec 1c sub $0x1c,%esp
13: 89 cb mov %ecx,%ebx
//Ensure that we have the correct amount of arguments being passed in
if(argc <=1){
15: 83 3b 01 cmpl $0x1,(%ebx)
18: 7f 17 jg 31 <main+0x31>
printf(1, "Error, not enough arguments\n");
1a: 83 ec 08 sub $0x8,%esp
1d: 68 d8 08 00 00 push $0x8d8
22: 6a 01 push $0x1
24: e8 f9 04 00 00 call 522 <printf>
29: 83 c4 10 add $0x10,%esp
exit();
2c: e8 3a 03 00 00 call 36b <exit>
//Var variables
uint start, end, pid;
//Set the start time calling uptime
start = (uint)uptime();
31: e8 cd 03 00 00 call 403 <uptime>
36: 89 45 e4 mov %eax,-0x1c(%ebp)
end = 0;
39: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp)
pid = fork();
40: e8 1e 03 00 00 call 363 <fork>
45: 89 45 dc mov %eax,-0x24(%ebp)
//check to see if there are other process' running
if(pid == 0){
48: 83 7d dc 00 cmpl $0x0,-0x24(%ebp)
4c: 75 20 jne 6e <main+0x6e>
if(exec(argv[1], argv+1) == 0);
4e: 8b 43 04 mov 0x4(%ebx),%eax
51: 8d 50 04 lea 0x4(%eax),%edx
54: 8b 43 04 mov 0x4(%ebx),%eax
57: 83 c0 04 add $0x4,%eax
5a: 8b 00 mov (%eax),%eax
5c: 83 ec 08 sub $0x8,%esp
5f: 52 push %edx
60: 50 push %eax
61: e8 3d 03 00 00 call 3a3 <exec>
66: 83 c4 10 add $0x10,%esp
exit();
69: e8 fd 02 00 00 call 36b <exit>
}
else
wait();
6e: e8 00 03 00 00 call 373 <wait>
//call uptime again to grab the running time.
end = (uint)uptime();
73: e8 8b 03 00 00 call 403 <uptime>
78: 89 45 e0 mov %eax,-0x20(%ebp)
printf(1,"%s %s %d.%d\n", argv[1], " ran in ", (end-start)/100, (end-start)%100);
7b: 8b 45 e0 mov -0x20(%ebp),%eax
7e: 2b 45 e4 sub -0x1c(%ebp),%eax
81: 89 c6 mov %eax,%esi
83: ba 1f 85 eb 51 mov $0x51eb851f,%edx
88: 89 f0 mov %esi,%eax
8a: f7 e2 mul %edx
8c: 89 d1 mov %edx,%ecx
8e: c1 e9 05 shr $0x5,%ecx
91: 6b c1 64 imul $0x64,%ecx,%eax
94: 29 c6 sub %eax,%esi
96: 89 f1 mov %esi,%ecx
98: 8b 45 e0 mov -0x20(%ebp),%eax
9b: 2b 45 e4 sub -0x1c(%ebp),%eax
9e: ba 1f 85 eb 51 mov $0x51eb851f,%edx
a3: f7 e2 mul %edx
a5: c1 ea 05 shr $0x5,%edx
a8: 8b 43 04 mov 0x4(%ebx),%eax
ab: 83 c0 04 add $0x4,%eax
ae: 8b 00 mov (%eax),%eax
b0: 83 ec 08 sub $0x8,%esp
b3: 51 push %ecx
b4: 52 push %edx
b5: 68 f5 08 00 00 push $0x8f5
ba: 50 push %eax
bb: 68 ff 08 00 00 push $0x8ff
c0: 6a 01 push $0x1
c2: e8 5b 04 00 00 call 522 <printf>
c7: 83 c4 20 add $0x20,%esp
exit();
ca: e8 9c 02 00 00 call 36b <exit>
000000cf <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
cf: 55 push %ebp
d0: 89 e5 mov %esp,%ebp
d2: 57 push %edi
d3: 53 push %ebx
asm volatile("cld; rep stosb" :
d4: 8b 4d 08 mov 0x8(%ebp),%ecx
d7: 8b 55 10 mov 0x10(%ebp),%edx
da: 8b 45 0c mov 0xc(%ebp),%eax
dd: 89 cb mov %ecx,%ebx
df: 89 df mov %ebx,%edi
e1: 89 d1 mov %edx,%ecx
e3: fc cld
e4: f3 aa rep stos %al,%es:(%edi)
e6: 89 ca mov %ecx,%edx
e8: 89 fb mov %edi,%ebx
ea: 89 5d 08 mov %ebx,0x8(%ebp)
ed: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
f0: 90 nop
f1: 5b pop %ebx
f2: 5f pop %edi
f3: 5d pop %ebp
f4: c3 ret
000000f5 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
f5: 55 push %ebp
f6: 89 e5 mov %esp,%ebp
f8: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
fb: 8b 45 08 mov 0x8(%ebp),%eax
fe: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
101: 90 nop
102: 8b 45 08 mov 0x8(%ebp),%eax
105: 8d 50 01 lea 0x1(%eax),%edx
108: 89 55 08 mov %edx,0x8(%ebp)
10b: 8b 55 0c mov 0xc(%ebp),%edx
10e: 8d 4a 01 lea 0x1(%edx),%ecx
111: 89 4d 0c mov %ecx,0xc(%ebp)
114: 0f b6 12 movzbl (%edx),%edx
117: 88 10 mov %dl,(%eax)
119: 0f b6 00 movzbl (%eax),%eax
11c: 84 c0 test %al,%al
11e: 75 e2 jne 102 <strcpy+0xd>
;
return os;
120: 8b 45 fc mov -0x4(%ebp),%eax
}
123: c9 leave
124: c3 ret
00000125 <strcmp>:
int
strcmp(const char *p, const char *q)
{
125: 55 push %ebp
126: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
128: eb 08 jmp 132 <strcmp+0xd>
p++, q++;
12a: 83 45 08 01 addl $0x1,0x8(%ebp)
12e: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
132: 8b 45 08 mov 0x8(%ebp),%eax
135: 0f b6 00 movzbl (%eax),%eax
138: 84 c0 test %al,%al
13a: 74 10 je 14c <strcmp+0x27>
13c: 8b 45 08 mov 0x8(%ebp),%eax
13f: 0f b6 10 movzbl (%eax),%edx
142: 8b 45 0c mov 0xc(%ebp),%eax
145: 0f b6 00 movzbl (%eax),%eax
148: 38 c2 cmp %al,%dl
14a: 74 de je 12a <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
14c: 8b 45 08 mov 0x8(%ebp),%eax
14f: 0f b6 00 movzbl (%eax),%eax
152: 0f b6 d0 movzbl %al,%edx
155: 8b 45 0c mov 0xc(%ebp),%eax
158: 0f b6 00 movzbl (%eax),%eax
15b: 0f b6 c0 movzbl %al,%eax
15e: 29 c2 sub %eax,%edx
160: 89 d0 mov %edx,%eax
}
162: 5d pop %ebp
163: c3 ret
00000164 <strlen>:
uint
strlen(char *s)
{
164: 55 push %ebp
165: 89 e5 mov %esp,%ebp
167: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
16a: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
171: eb 04 jmp 177 <strlen+0x13>
173: 83 45 fc 01 addl $0x1,-0x4(%ebp)
177: 8b 55 fc mov -0x4(%ebp),%edx
17a: 8b 45 08 mov 0x8(%ebp),%eax
17d: 01 d0 add %edx,%eax
17f: 0f b6 00 movzbl (%eax),%eax
182: 84 c0 test %al,%al
184: 75 ed jne 173 <strlen+0xf>
;
return n;
186: 8b 45 fc mov -0x4(%ebp),%eax
}
189: c9 leave
18a: c3 ret
0000018b <memset>:
void*
memset(void *dst, int c, uint n)
{
18b: 55 push %ebp
18c: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
18e: 8b 45 10 mov 0x10(%ebp),%eax
191: 50 push %eax
192: ff 75 0c pushl 0xc(%ebp)
195: ff 75 08 pushl 0x8(%ebp)
198: e8 32 ff ff ff call cf <stosb>
19d: 83 c4 0c add $0xc,%esp
return dst;
1a0: 8b 45 08 mov 0x8(%ebp),%eax
}
1a3: c9 leave
1a4: c3 ret
000001a5 <strchr>:
char*
strchr(const char *s, char c)
{
1a5: 55 push %ebp
1a6: 89 e5 mov %esp,%ebp
1a8: 83 ec 04 sub $0x4,%esp
1ab: 8b 45 0c mov 0xc(%ebp),%eax
1ae: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
1b1: eb 14 jmp 1c7 <strchr+0x22>
if(*s == c)
1b3: 8b 45 08 mov 0x8(%ebp),%eax
1b6: 0f b6 00 movzbl (%eax),%eax
1b9: 3a 45 fc cmp -0x4(%ebp),%al
1bc: 75 05 jne 1c3 <strchr+0x1e>
return (char*)s;
1be: 8b 45 08 mov 0x8(%ebp),%eax
1c1: eb 13 jmp 1d6 <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
1c3: 83 45 08 01 addl $0x1,0x8(%ebp)
1c7: 8b 45 08 mov 0x8(%ebp),%eax
1ca: 0f b6 00 movzbl (%eax),%eax
1cd: 84 c0 test %al,%al
1cf: 75 e2 jne 1b3 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
1d1: b8 00 00 00 00 mov $0x0,%eax
}
1d6: c9 leave
1d7: c3 ret
000001d8 <gets>:
char*
gets(char *buf, int max)
{
1d8: 55 push %ebp
1d9: 89 e5 mov %esp,%ebp
1db: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
1de: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1e5: eb 42 jmp 229 <gets+0x51>
cc = read(0, &c, 1);
1e7: 83 ec 04 sub $0x4,%esp
1ea: 6a 01 push $0x1
1ec: 8d 45 ef lea -0x11(%ebp),%eax
1ef: 50 push %eax
1f0: 6a 00 push $0x0
1f2: e8 8c 01 00 00 call 383 <read>
1f7: 83 c4 10 add $0x10,%esp
1fa: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
1fd: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
201: 7e 33 jle 236 <gets+0x5e>
break;
buf[i++] = c;
203: 8b 45 f4 mov -0xc(%ebp),%eax
206: 8d 50 01 lea 0x1(%eax),%edx
209: 89 55 f4 mov %edx,-0xc(%ebp)
20c: 89 c2 mov %eax,%edx
20e: 8b 45 08 mov 0x8(%ebp),%eax
211: 01 c2 add %eax,%edx
213: 0f b6 45 ef movzbl -0x11(%ebp),%eax
217: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
219: 0f b6 45 ef movzbl -0x11(%ebp),%eax
21d: 3c 0a cmp $0xa,%al
21f: 74 16 je 237 <gets+0x5f>
221: 0f b6 45 ef movzbl -0x11(%ebp),%eax
225: 3c 0d cmp $0xd,%al
227: 74 0e je 237 <gets+0x5f>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
229: 8b 45 f4 mov -0xc(%ebp),%eax
22c: 83 c0 01 add $0x1,%eax
22f: 3b 45 0c cmp 0xc(%ebp),%eax
232: 7c b3 jl 1e7 <gets+0xf>
234: eb 01 jmp 237 <gets+0x5f>
cc = read(0, &c, 1);
if(cc < 1)
break;
236: 90 nop
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
237: 8b 55 f4 mov -0xc(%ebp),%edx
23a: 8b 45 08 mov 0x8(%ebp),%eax
23d: 01 d0 add %edx,%eax
23f: c6 00 00 movb $0x0,(%eax)
return buf;
242: 8b 45 08 mov 0x8(%ebp),%eax
}
245: c9 leave
246: c3 ret
00000247 <stat>:
int
stat(char *n, struct stat *st)
{
247: 55 push %ebp
248: 89 e5 mov %esp,%ebp
24a: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
24d: 83 ec 08 sub $0x8,%esp
250: 6a 00 push $0x0
252: ff 75 08 pushl 0x8(%ebp)
255: e8 51 01 00 00 call 3ab <open>
25a: 83 c4 10 add $0x10,%esp
25d: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
260: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
264: 79 07 jns 26d <stat+0x26>
return -1;
266: b8 ff ff ff ff mov $0xffffffff,%eax
26b: eb 25 jmp 292 <stat+0x4b>
r = fstat(fd, st);
26d: 83 ec 08 sub $0x8,%esp
270: ff 75 0c pushl 0xc(%ebp)
273: ff 75 f4 pushl -0xc(%ebp)
276: e8 48 01 00 00 call 3c3 <fstat>
27b: 83 c4 10 add $0x10,%esp
27e: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
281: 83 ec 0c sub $0xc,%esp
284: ff 75 f4 pushl -0xc(%ebp)
287: e8 07 01 00 00 call 393 <close>
28c: 83 c4 10 add $0x10,%esp
return r;
28f: 8b 45 f0 mov -0x10(%ebp),%eax
}
292: c9 leave
293: c3 ret
00000294 <atoi>:
// new atoi added 4/22/17 to be able to handle negative numbers
int
atoi(const char *s)
{
294: 55 push %ebp
295: 89 e5 mov %esp,%ebp
297: 83 ec 10 sub $0x10,%esp
int n, sign;
n=0;
29a: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while(*s==' ')s++;//Remove leading spaces
2a1: eb 04 jmp 2a7 <atoi+0x13>
2a3: 83 45 08 01 addl $0x1,0x8(%ebp)
2a7: 8b 45 08 mov 0x8(%ebp),%eax
2aa: 0f b6 00 movzbl (%eax),%eax
2ad: 3c 20 cmp $0x20,%al
2af: 74 f2 je 2a3 <atoi+0xf>
sign =(*s=='-')?-1 : 1;
2b1: 8b 45 08 mov 0x8(%ebp),%eax
2b4: 0f b6 00 movzbl (%eax),%eax
2b7: 3c 2d cmp $0x2d,%al
2b9: 75 07 jne 2c2 <atoi+0x2e>
2bb: b8 ff ff ff ff mov $0xffffffff,%eax
2c0: eb 05 jmp 2c7 <atoi+0x33>
2c2: b8 01 00 00 00 mov $0x1,%eax
2c7: 89 45 f8 mov %eax,-0x8(%ebp)
if(*s=='+' || *s=='-')
2ca: 8b 45 08 mov 0x8(%ebp),%eax
2cd: 0f b6 00 movzbl (%eax),%eax
2d0: 3c 2b cmp $0x2b,%al
2d2: 74 0a je 2de <atoi+0x4a>
2d4: 8b 45 08 mov 0x8(%ebp),%eax
2d7: 0f b6 00 movzbl (%eax),%eax
2da: 3c 2d cmp $0x2d,%al
2dc: 75 2b jne 309 <atoi+0x75>
s++;
2de: 83 45 08 01 addl $0x1,0x8(%ebp)
while('0' <= *s&&*s<='9')
2e2: eb 25 jmp 309 <atoi+0x75>
n = n*10 + *s++ - '0';
2e4: 8b 55 fc mov -0x4(%ebp),%edx
2e7: 89 d0 mov %edx,%eax
2e9: c1 e0 02 shl $0x2,%eax
2ec: 01 d0 add %edx,%eax
2ee: 01 c0 add %eax,%eax
2f0: 89 c1 mov %eax,%ecx
2f2: 8b 45 08 mov 0x8(%ebp),%eax
2f5: 8d 50 01 lea 0x1(%eax),%edx
2f8: 89 55 08 mov %edx,0x8(%ebp)
2fb: 0f b6 00 movzbl (%eax),%eax
2fe: 0f be c0 movsbl %al,%eax
301: 01 c8 add %ecx,%eax
303: 83 e8 30 sub $0x30,%eax
306: 89 45 fc mov %eax,-0x4(%ebp)
n=0;
while(*s==' ')s++;//Remove leading spaces
sign =(*s=='-')?-1 : 1;
if(*s=='+' || *s=='-')
s++;
while('0' <= *s&&*s<='9')
309: 8b 45 08 mov 0x8(%ebp),%eax
30c: 0f b6 00 movzbl (%eax),%eax
30f: 3c 2f cmp $0x2f,%al
311: 7e 0a jle 31d <atoi+0x89>
313: 8b 45 08 mov 0x8(%ebp),%eax
316: 0f b6 00 movzbl (%eax),%eax
319: 3c 39 cmp $0x39,%al
31b: 7e c7 jle 2e4 <atoi+0x50>
n = n*10 + *s++ - '0';
return sign*n;
31d: 8b 45 f8 mov -0x8(%ebp),%eax
320: 0f af 45 fc imul -0x4(%ebp),%eax
}
324: c9 leave
325: c3 ret
00000326 <memmove>:
return n;
}
*/
void*
memmove(void *vdst, void *vsrc, int n)
{
326: 55 push %ebp
327: 89 e5 mov %esp,%ebp
329: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
32c: 8b 45 08 mov 0x8(%ebp),%eax
32f: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
332: 8b 45 0c mov 0xc(%ebp),%eax
335: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
338: eb 17 jmp 351 <memmove+0x2b>
*dst++ = *src++;
33a: 8b 45 fc mov -0x4(%ebp),%eax
33d: 8d 50 01 lea 0x1(%eax),%edx
340: 89 55 fc mov %edx,-0x4(%ebp)
343: 8b 55 f8 mov -0x8(%ebp),%edx
346: 8d 4a 01 lea 0x1(%edx),%ecx
349: 89 4d f8 mov %ecx,-0x8(%ebp)
34c: 0f b6 12 movzbl (%edx),%edx
34f: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
351: 8b 45 10 mov 0x10(%ebp),%eax
354: 8d 50 ff lea -0x1(%eax),%edx
357: 89 55 10 mov %edx,0x10(%ebp)
35a: 85 c0 test %eax,%eax
35c: 7f dc jg 33a <memmove+0x14>
*dst++ = *src++;
return vdst;
35e: 8b 45 08 mov 0x8(%ebp),%eax
}
361: c9 leave
362: c3 ret
00000363 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
363: b8 01 00 00 00 mov $0x1,%eax
368: cd 40 int $0x40
36a: c3 ret
0000036b <exit>:
SYSCALL(exit)
36b: b8 02 00 00 00 mov $0x2,%eax
370: cd 40 int $0x40
372: c3 ret
00000373 <wait>:
SYSCALL(wait)
373: b8 03 00 00 00 mov $0x3,%eax
378: cd 40 int $0x40
37a: c3 ret
0000037b <pipe>:
SYSCALL(pipe)
37b: b8 04 00 00 00 mov $0x4,%eax
380: cd 40 int $0x40
382: c3 ret
00000383 <read>:
SYSCALL(read)
383: b8 05 00 00 00 mov $0x5,%eax
388: cd 40 int $0x40
38a: c3 ret
0000038b <write>:
SYSCALL(write)
38b: b8 10 00 00 00 mov $0x10,%eax
390: cd 40 int $0x40
392: c3 ret
00000393 <close>:
SYSCALL(close)
393: b8 15 00 00 00 mov $0x15,%eax
398: cd 40 int $0x40
39a: c3 ret
0000039b <kill>:
SYSCALL(kill)
39b: b8 06 00 00 00 mov $0x6,%eax
3a0: cd 40 int $0x40
3a2: c3 ret
000003a3 <exec>:
SYSCALL(exec)
3a3: b8 07 00 00 00 mov $0x7,%eax
3a8: cd 40 int $0x40
3aa: c3 ret
000003ab <open>:
SYSCALL(open)
3ab: b8 0f 00 00 00 mov $0xf,%eax
3b0: cd 40 int $0x40
3b2: c3 ret
000003b3 <mknod>:
SYSCALL(mknod)
3b3: b8 11 00 00 00 mov $0x11,%eax
3b8: cd 40 int $0x40
3ba: c3 ret
000003bb <unlink>:
SYSCALL(unlink)
3bb: b8 12 00 00 00 mov $0x12,%eax
3c0: cd 40 int $0x40
3c2: c3 ret
000003c3 <fstat>:
SYSCALL(fstat)
3c3: b8 08 00 00 00 mov $0x8,%eax
3c8: cd 40 int $0x40
3ca: c3 ret
000003cb <link>:
SYSCALL(link)
3cb: b8 13 00 00 00 mov $0x13,%eax
3d0: cd 40 int $0x40
3d2: c3 ret
000003d3 <mkdir>:
SYSCALL(mkdir)
3d3: b8 14 00 00 00 mov $0x14,%eax
3d8: cd 40 int $0x40
3da: c3 ret
000003db <chdir>:
SYSCALL(chdir)
3db: b8 09 00 00 00 mov $0x9,%eax
3e0: cd 40 int $0x40
3e2: c3 ret
000003e3 <dup>:
SYSCALL(dup)
3e3: b8 0a 00 00 00 mov $0xa,%eax
3e8: cd 40 int $0x40
3ea: c3 ret
000003eb <getpid>:
SYSCALL(getpid)
3eb: b8 0b 00 00 00 mov $0xb,%eax
3f0: cd 40 int $0x40
3f2: c3 ret
000003f3 <sbrk>:
SYSCALL(sbrk)
3f3: b8 0c 00 00 00 mov $0xc,%eax
3f8: cd 40 int $0x40
3fa: c3 ret
000003fb <sleep>:
SYSCALL(sleep)
3fb: b8 0d 00 00 00 mov $0xd,%eax
400: cd 40 int $0x40
402: c3 ret
00000403 <uptime>:
SYSCALL(uptime)
403: b8 0e 00 00 00 mov $0xe,%eax
408: cd 40 int $0x40
40a: c3 ret
0000040b <halt>:
SYSCALL(halt)
40b: b8 16 00 00 00 mov $0x16,%eax
410: cd 40 int $0x40
412: c3 ret
00000413 <date>:
//Project additions
SYSCALL(date)
413: b8 17 00 00 00 mov $0x17,%eax
418: cd 40 int $0x40
41a: c3 ret
0000041b <getuid>:
SYSCALL(getuid)
41b: b8 18 00 00 00 mov $0x18,%eax
420: cd 40 int $0x40
422: c3 ret
00000423 <getgid>:
SYSCALL(getgid)
423: b8 19 00 00 00 mov $0x19,%eax
428: cd 40 int $0x40
42a: c3 ret
0000042b <getppid>:
SYSCALL(getppid)
42b: b8 1a 00 00 00 mov $0x1a,%eax
430: cd 40 int $0x40
432: c3 ret
00000433 <setuid>:
SYSCALL(setuid)
433: b8 1b 00 00 00 mov $0x1b,%eax
438: cd 40 int $0x40
43a: c3 ret
0000043b <setgid>:
SYSCALL(setgid)
43b: b8 1c 00 00 00 mov $0x1c,%eax
440: cd 40 int $0x40
442: c3 ret
00000443 <getprocs>:
SYSCALL(getprocs)
443: b8 1d 00 00 00 mov $0x1d,%eax
448: cd 40 int $0x40
44a: c3 ret
0000044b <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
44b: 55 push %ebp
44c: 89 e5 mov %esp,%ebp
44e: 83 ec 18 sub $0x18,%esp
451: 8b 45 0c mov 0xc(%ebp),%eax
454: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
457: 83 ec 04 sub $0x4,%esp
45a: 6a 01 push $0x1
45c: 8d 45 f4 lea -0xc(%ebp),%eax
45f: 50 push %eax
460: ff 75 08 pushl 0x8(%ebp)
463: e8 23 ff ff ff call 38b <write>
468: 83 c4 10 add $0x10,%esp
}
46b: 90 nop
46c: c9 leave
46d: c3 ret
0000046e <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
46e: 55 push %ebp
46f: 89 e5 mov %esp,%ebp
471: 53 push %ebx
472: 83 ec 24 sub $0x24,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
475: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
47c: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
480: 74 17 je 499 <printint+0x2b>
482: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
486: 79 11 jns 499 <printint+0x2b>
neg = 1;
488: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
48f: 8b 45 0c mov 0xc(%ebp),%eax
492: f7 d8 neg %eax
494: 89 45 ec mov %eax,-0x14(%ebp)
497: eb 06 jmp 49f <printint+0x31>
} else {
x = xx;
499: 8b 45 0c mov 0xc(%ebp),%eax
49c: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
49f: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
4a6: 8b 4d f4 mov -0xc(%ebp),%ecx
4a9: 8d 41 01 lea 0x1(%ecx),%eax
4ac: 89 45 f4 mov %eax,-0xc(%ebp)
4af: 8b 5d 10 mov 0x10(%ebp),%ebx
4b2: 8b 45 ec mov -0x14(%ebp),%eax
4b5: ba 00 00 00 00 mov $0x0,%edx
4ba: f7 f3 div %ebx
4bc: 89 d0 mov %edx,%eax
4be: 0f b6 80 64 0b 00 00 movzbl 0xb64(%eax),%eax
4c5: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
4c9: 8b 5d 10 mov 0x10(%ebp),%ebx
4cc: 8b 45 ec mov -0x14(%ebp),%eax
4cf: ba 00 00 00 00 mov $0x0,%edx
4d4: f7 f3 div %ebx
4d6: 89 45 ec mov %eax,-0x14(%ebp)
4d9: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
4dd: 75 c7 jne 4a6 <printint+0x38>
if(neg)
4df: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
4e3: 74 2d je 512 <printint+0xa4>
buf[i++] = '-';
4e5: 8b 45 f4 mov -0xc(%ebp),%eax
4e8: 8d 50 01 lea 0x1(%eax),%edx
4eb: 89 55 f4 mov %edx,-0xc(%ebp)
4ee: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
4f3: eb 1d jmp 512 <printint+0xa4>
putc(fd, buf[i]);
4f5: 8d 55 dc lea -0x24(%ebp),%edx
4f8: 8b 45 f4 mov -0xc(%ebp),%eax
4fb: 01 d0 add %edx,%eax
4fd: 0f b6 00 movzbl (%eax),%eax
500: 0f be c0 movsbl %al,%eax
503: 83 ec 08 sub $0x8,%esp
506: 50 push %eax
507: ff 75 08 pushl 0x8(%ebp)
50a: e8 3c ff ff ff call 44b <putc>
50f: 83 c4 10 add $0x10,%esp
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
512: 83 6d f4 01 subl $0x1,-0xc(%ebp)
516: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
51a: 79 d9 jns 4f5 <printint+0x87>
putc(fd, buf[i]);
}
51c: 90 nop
51d: 8b 5d fc mov -0x4(%ebp),%ebx
520: c9 leave
521: c3 ret
00000522 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
522: 55 push %ebp
523: 89 e5 mov %esp,%ebp
525: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
528: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
52f: 8d 45 0c lea 0xc(%ebp),%eax
532: 83 c0 04 add $0x4,%eax
535: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
538: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
53f: e9 59 01 00 00 jmp 69d <printf+0x17b>
c = fmt[i] & 0xff;
544: 8b 55 0c mov 0xc(%ebp),%edx
547: 8b 45 f0 mov -0x10(%ebp),%eax
54a: 01 d0 add %edx,%eax
54c: 0f b6 00 movzbl (%eax),%eax
54f: 0f be c0 movsbl %al,%eax
552: 25 ff 00 00 00 and $0xff,%eax
557: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
55a: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
55e: 75 2c jne 58c <printf+0x6a>
if(c == '%'){
560: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
564: 75 0c jne 572 <printf+0x50>
state = '%';
566: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
56d: e9 27 01 00 00 jmp 699 <printf+0x177>
} else {
putc(fd, c);
572: 8b 45 e4 mov -0x1c(%ebp),%eax
575: 0f be c0 movsbl %al,%eax
578: 83 ec 08 sub $0x8,%esp
57b: 50 push %eax
57c: ff 75 08 pushl 0x8(%ebp)
57f: e8 c7 fe ff ff call 44b <putc>
584: 83 c4 10 add $0x10,%esp
587: e9 0d 01 00 00 jmp 699 <printf+0x177>
}
} else if(state == '%'){
58c: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
590: 0f 85 03 01 00 00 jne 699 <printf+0x177>
if(c == 'd'){
596: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
59a: 75 1e jne 5ba <printf+0x98>
printint(fd, *ap, 10, 1);
59c: 8b 45 e8 mov -0x18(%ebp),%eax
59f: 8b 00 mov (%eax),%eax
5a1: 6a 01 push $0x1
5a3: 6a 0a push $0xa
5a5: 50 push %eax
5a6: ff 75 08 pushl 0x8(%ebp)
5a9: e8 c0 fe ff ff call 46e <printint>
5ae: 83 c4 10 add $0x10,%esp
ap++;
5b1: 83 45 e8 04 addl $0x4,-0x18(%ebp)
5b5: e9 d8 00 00 00 jmp 692 <printf+0x170>
} else if(c == 'x' || c == 'p'){
5ba: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
5be: 74 06 je 5c6 <printf+0xa4>
5c0: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
5c4: 75 1e jne 5e4 <printf+0xc2>
printint(fd, *ap, 16, 0);
5c6: 8b 45 e8 mov -0x18(%ebp),%eax
5c9: 8b 00 mov (%eax),%eax
5cb: 6a 00 push $0x0
5cd: 6a 10 push $0x10
5cf: 50 push %eax
5d0: ff 75 08 pushl 0x8(%ebp)
5d3: e8 96 fe ff ff call 46e <printint>
5d8: 83 c4 10 add $0x10,%esp
ap++;
5db: 83 45 e8 04 addl $0x4,-0x18(%ebp)
5df: e9 ae 00 00 00 jmp 692 <printf+0x170>
} else if(c == 's'){
5e4: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
5e8: 75 43 jne 62d <printf+0x10b>
s = (char*)*ap;
5ea: 8b 45 e8 mov -0x18(%ebp),%eax
5ed: 8b 00 mov (%eax),%eax
5ef: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
5f2: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
5f6: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
5fa: 75 25 jne 621 <printf+0xff>
s = "(null)";
5fc: c7 45 f4 0c 09 00 00 movl $0x90c,-0xc(%ebp)
while(*s != 0){
603: eb 1c jmp 621 <printf+0xff>
putc(fd, *s);
605: 8b 45 f4 mov -0xc(%ebp),%eax
608: 0f b6 00 movzbl (%eax),%eax
60b: 0f be c0 movsbl %al,%eax
60e: 83 ec 08 sub $0x8,%esp
611: 50 push %eax
612: ff 75 08 pushl 0x8(%ebp)
615: e8 31 fe ff ff call 44b <putc>
61a: 83 c4 10 add $0x10,%esp
s++;
61d: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
621: 8b 45 f4 mov -0xc(%ebp),%eax
624: 0f b6 00 movzbl (%eax),%eax
627: 84 c0 test %al,%al
629: 75 da jne 605 <printf+0xe3>
62b: eb 65 jmp 692 <printf+0x170>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
62d: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
631: 75 1d jne 650 <printf+0x12e>
putc(fd, *ap);
633: 8b 45 e8 mov -0x18(%ebp),%eax
636: 8b 00 mov (%eax),%eax
638: 0f be c0 movsbl %al,%eax
63b: 83 ec 08 sub $0x8,%esp
63e: 50 push %eax
63f: ff 75 08 pushl 0x8(%ebp)
642: e8 04 fe ff ff call 44b <putc>
647: 83 c4 10 add $0x10,%esp
ap++;
64a: 83 45 e8 04 addl $0x4,-0x18(%ebp)
64e: eb 42 jmp 692 <printf+0x170>
} else if(c == '%'){
650: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
654: 75 17 jne 66d <printf+0x14b>
putc(fd, c);
656: 8b 45 e4 mov -0x1c(%ebp),%eax
659: 0f be c0 movsbl %al,%eax
65c: 83 ec 08 sub $0x8,%esp
65f: 50 push %eax
660: ff 75 08 pushl 0x8(%ebp)
663: e8 e3 fd ff ff call 44b <putc>
668: 83 c4 10 add $0x10,%esp
66b: eb 25 jmp 692 <printf+0x170>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
66d: 83 ec 08 sub $0x8,%esp
670: 6a 25 push $0x25
672: ff 75 08 pushl 0x8(%ebp)
675: e8 d1 fd ff ff call 44b <putc>
67a: 83 c4 10 add $0x10,%esp
putc(fd, c);
67d: 8b 45 e4 mov -0x1c(%ebp),%eax
680: 0f be c0 movsbl %al,%eax
683: 83 ec 08 sub $0x8,%esp
686: 50 push %eax
687: ff 75 08 pushl 0x8(%ebp)
68a: e8 bc fd ff ff call 44b <putc>
68f: 83 c4 10 add $0x10,%esp
}
state = 0;
692: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
699: 83 45 f0 01 addl $0x1,-0x10(%ebp)
69d: 8b 55 0c mov 0xc(%ebp),%edx
6a0: 8b 45 f0 mov -0x10(%ebp),%eax
6a3: 01 d0 add %edx,%eax
6a5: 0f b6 00 movzbl (%eax),%eax
6a8: 84 c0 test %al,%al
6aa: 0f 85 94 fe ff ff jne 544 <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
6b0: 90 nop
6b1: c9 leave
6b2: c3 ret
000006b3 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
6b3: 55 push %ebp
6b4: 89 e5 mov %esp,%ebp
6b6: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
6b9: 8b 45 08 mov 0x8(%ebp),%eax
6bc: 83 e8 08 sub $0x8,%eax
6bf: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6c2: a1 80 0b 00 00 mov 0xb80,%eax
6c7: 89 45 fc mov %eax,-0x4(%ebp)
6ca: eb 24 jmp 6f0 <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6cc: 8b 45 fc mov -0x4(%ebp),%eax
6cf: 8b 00 mov (%eax),%eax
6d1: 3b 45 fc cmp -0x4(%ebp),%eax
6d4: 77 12 ja 6e8 <free+0x35>
6d6: 8b 45 f8 mov -0x8(%ebp),%eax
6d9: 3b 45 fc cmp -0x4(%ebp),%eax
6dc: 77 24 ja 702 <free+0x4f>
6de: 8b 45 fc mov -0x4(%ebp),%eax
6e1: 8b 00 mov (%eax),%eax
6e3: 3b 45 f8 cmp -0x8(%ebp),%eax
6e6: 77 1a ja 702 <free+0x4f>
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6e8: 8b 45 fc mov -0x4(%ebp),%eax
6eb: 8b 00 mov (%eax),%eax
6ed: 89 45 fc mov %eax,-0x4(%ebp)
6f0: 8b 45 f8 mov -0x8(%ebp),%eax
6f3: 3b 45 fc cmp -0x4(%ebp),%eax
6f6: 76 d4 jbe 6cc <free+0x19>
6f8: 8b 45 fc mov -0x4(%ebp),%eax
6fb: 8b 00 mov (%eax),%eax
6fd: 3b 45 f8 cmp -0x8(%ebp),%eax
700: 76 ca jbe 6cc <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
702: 8b 45 f8 mov -0x8(%ebp),%eax
705: 8b 40 04 mov 0x4(%eax),%eax
708: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
70f: 8b 45 f8 mov -0x8(%ebp),%eax
712: 01 c2 add %eax,%edx
714: 8b 45 fc mov -0x4(%ebp),%eax
717: 8b 00 mov (%eax),%eax
719: 39 c2 cmp %eax,%edx
71b: 75 24 jne 741 <free+0x8e>
bp->s.size += p->s.ptr->s.size;
71d: 8b 45 f8 mov -0x8(%ebp),%eax
720: 8b 50 04 mov 0x4(%eax),%edx
723: 8b 45 fc mov -0x4(%ebp),%eax
726: 8b 00 mov (%eax),%eax
728: 8b 40 04 mov 0x4(%eax),%eax
72b: 01 c2 add %eax,%edx
72d: 8b 45 f8 mov -0x8(%ebp),%eax
730: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
733: 8b 45 fc mov -0x4(%ebp),%eax
736: 8b 00 mov (%eax),%eax
738: 8b 10 mov (%eax),%edx
73a: 8b 45 f8 mov -0x8(%ebp),%eax
73d: 89 10 mov %edx,(%eax)
73f: eb 0a jmp 74b <free+0x98>
} else
bp->s.ptr = p->s.ptr;
741: 8b 45 fc mov -0x4(%ebp),%eax
744: 8b 10 mov (%eax),%edx
746: 8b 45 f8 mov -0x8(%ebp),%eax
749: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
74b: 8b 45 fc mov -0x4(%ebp),%eax
74e: 8b 40 04 mov 0x4(%eax),%eax
751: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
758: 8b 45 fc mov -0x4(%ebp),%eax
75b: 01 d0 add %edx,%eax
75d: 3b 45 f8 cmp -0x8(%ebp),%eax
760: 75 20 jne 782 <free+0xcf>
p->s.size += bp->s.size;
762: 8b 45 fc mov -0x4(%ebp),%eax
765: 8b 50 04 mov 0x4(%eax),%edx
768: 8b 45 f8 mov -0x8(%ebp),%eax
76b: 8b 40 04 mov 0x4(%eax),%eax
76e: 01 c2 add %eax,%edx
770: 8b 45 fc mov -0x4(%ebp),%eax
773: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
776: 8b 45 f8 mov -0x8(%ebp),%eax
779: 8b 10 mov (%eax),%edx
77b: 8b 45 fc mov -0x4(%ebp),%eax
77e: 89 10 mov %edx,(%eax)
780: eb 08 jmp 78a <free+0xd7>
} else
p->s.ptr = bp;
782: 8b 45 fc mov -0x4(%ebp),%eax
785: 8b 55 f8 mov -0x8(%ebp),%edx
788: 89 10 mov %edx,(%eax)
freep = p;
78a: 8b 45 fc mov -0x4(%ebp),%eax
78d: a3 80 0b 00 00 mov %eax,0xb80
}
792: 90 nop
793: c9 leave
794: c3 ret
00000795 <morecore>:
static Header*
morecore(uint nu)
{
795: 55 push %ebp
796: 89 e5 mov %esp,%ebp
798: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if(nu < 4096)
79b: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
7a2: 77 07 ja 7ab <morecore+0x16>
nu = 4096;
7a4: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
7ab: 8b 45 08 mov 0x8(%ebp),%eax
7ae: c1 e0 03 shl $0x3,%eax
7b1: 83 ec 0c sub $0xc,%esp
7b4: 50 push %eax
7b5: e8 39 fc ff ff call 3f3 <sbrk>
7ba: 83 c4 10 add $0x10,%esp
7bd: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
7c0: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
7c4: 75 07 jne 7cd <morecore+0x38>
return 0;
7c6: b8 00 00 00 00 mov $0x0,%eax
7cb: eb 26 jmp 7f3 <morecore+0x5e>
hp = (Header*)p;
7cd: 8b 45 f4 mov -0xc(%ebp),%eax
7d0: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
7d3: 8b 45 f0 mov -0x10(%ebp),%eax
7d6: 8b 55 08 mov 0x8(%ebp),%edx
7d9: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
7dc: 8b 45 f0 mov -0x10(%ebp),%eax
7df: 83 c0 08 add $0x8,%eax
7e2: 83 ec 0c sub $0xc,%esp
7e5: 50 push %eax
7e6: e8 c8 fe ff ff call 6b3 <free>
7eb: 83 c4 10 add $0x10,%esp
return freep;
7ee: a1 80 0b 00 00 mov 0xb80,%eax
}
7f3: c9 leave
7f4: c3 ret
000007f5 <malloc>:
void*
malloc(uint nbytes)
{
7f5: 55 push %ebp
7f6: 89 e5 mov %esp,%ebp
7f8: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
7fb: 8b 45 08 mov 0x8(%ebp),%eax
7fe: 83 c0 07 add $0x7,%eax
801: c1 e8 03 shr $0x3,%eax
804: 83 c0 01 add $0x1,%eax
807: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
80a: a1 80 0b 00 00 mov 0xb80,%eax
80f: 89 45 f0 mov %eax,-0x10(%ebp)
812: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
816: 75 23 jne 83b <malloc+0x46>
base.s.ptr = freep = prevp = &base;
818: c7 45 f0 78 0b 00 00 movl $0xb78,-0x10(%ebp)
81f: 8b 45 f0 mov -0x10(%ebp),%eax
822: a3 80 0b 00 00 mov %eax,0xb80
827: a1 80 0b 00 00 mov 0xb80,%eax
82c: a3 78 0b 00 00 mov %eax,0xb78
base.s.size = 0;
831: c7 05 7c 0b 00 00 00 movl $0x0,0xb7c
838: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
83b: 8b 45 f0 mov -0x10(%ebp),%eax
83e: 8b 00 mov (%eax),%eax
840: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
843: 8b 45 f4 mov -0xc(%ebp),%eax
846: 8b 40 04 mov 0x4(%eax),%eax
849: 3b 45 ec cmp -0x14(%ebp),%eax
84c: 72 4d jb 89b <malloc+0xa6>
if(p->s.size == nunits)
84e: 8b 45 f4 mov -0xc(%ebp),%eax
851: 8b 40 04 mov 0x4(%eax),%eax
854: 3b 45 ec cmp -0x14(%ebp),%eax
857: 75 0c jne 865 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
859: 8b 45 f4 mov -0xc(%ebp),%eax
85c: 8b 10 mov (%eax),%edx
85e: 8b 45 f0 mov -0x10(%ebp),%eax
861: 89 10 mov %edx,(%eax)
863: eb 26 jmp 88b <malloc+0x96>
else {
p->s.size -= nunits;
865: 8b 45 f4 mov -0xc(%ebp),%eax
868: 8b 40 04 mov 0x4(%eax),%eax
86b: 2b 45 ec sub -0x14(%ebp),%eax
86e: 89 c2 mov %eax,%edx
870: 8b 45 f4 mov -0xc(%ebp),%eax
873: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
876: 8b 45 f4 mov -0xc(%ebp),%eax
879: 8b 40 04 mov 0x4(%eax),%eax
87c: c1 e0 03 shl $0x3,%eax
87f: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
882: 8b 45 f4 mov -0xc(%ebp),%eax
885: 8b 55 ec mov -0x14(%ebp),%edx
888: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
88b: 8b 45 f0 mov -0x10(%ebp),%eax
88e: a3 80 0b 00 00 mov %eax,0xb80
return (void*)(p + 1);
893: 8b 45 f4 mov -0xc(%ebp),%eax
896: 83 c0 08 add $0x8,%eax
899: eb 3b jmp 8d6 <malloc+0xe1>
}
if(p == freep)
89b: a1 80 0b 00 00 mov 0xb80,%eax
8a0: 39 45 f4 cmp %eax,-0xc(%ebp)
8a3: 75 1e jne 8c3 <malloc+0xce>
if((p = morecore(nunits)) == 0)
8a5: 83 ec 0c sub $0xc,%esp
8a8: ff 75 ec pushl -0x14(%ebp)
8ab: e8 e5 fe ff ff call 795 <morecore>
8b0: 83 c4 10 add $0x10,%esp
8b3: 89 45 f4 mov %eax,-0xc(%ebp)
8b6: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8ba: 75 07 jne 8c3 <malloc+0xce>
return 0;
8bc: b8 00 00 00 00 mov $0x0,%eax
8c1: eb 13 jmp 8d6 <malloc+0xe1>
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
8c3: 8b 45 f4 mov -0xc(%ebp),%eax
8c6: 89 45 f0 mov %eax,-0x10(%ebp)
8c9: 8b 45 f4 mov -0xc(%ebp),%eax
8cc: 8b 00 mov (%eax),%eax
8ce: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
8d1: e9 6d ff ff ff jmp 843 <malloc+0x4e>
}
8d6: c9 leave
8d7: c3 ret
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2038.asm | ljhsiun2/medusa | 9 | 170995 | <filename>Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2038.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x1b903, %rcx
nop
nop
xor %rbp, %rbp
movups (%rcx), %xmm4
vpextrq $0, %xmm4, %r14
nop
nop
nop
nop
inc %rdx
lea addresses_A_ht+0x12943, %rsi
lea addresses_WC_ht+0xf083, %rdi
nop
nop
add $3246, %rax
mov $98, %rcx
rep movsq
nop
dec %rbp
lea addresses_WC_ht+0x1c203, %rdx
nop
nop
nop
nop
nop
add $41385, %rax
mov (%rdx), %bp
add $53843, %rdi
lea addresses_WT_ht+0x1c103, %rsi
clflush (%rsi)
nop
inc %rdi
and $0xffffffffffffffc0, %rsi
movaps (%rsi), %xmm1
vpextrq $1, %xmm1, %r14
nop
dec %rdx
lea addresses_A_ht+0xb5c3, %r14
nop
nop
sub %rsi, %rsi
movl $0x61626364, (%r14)
nop
xor %rcx, %rcx
lea addresses_WT_ht+0x13703, %rsi
lea addresses_D_ht+0x15903, %rdi
nop
nop
nop
nop
add $8388, %rax
mov $69, %rcx
rep movsq
sub $17417, %rdi
lea addresses_WC_ht+0x154f3, %rsi
lea addresses_A_ht+0x1cf83, %rdi
nop
nop
nop
nop
inc %rax
mov $109, %rcx
rep movsb
nop
nop
nop
nop
inc %rax
lea addresses_WT_ht+0x17903, %rdx
nop
nop
nop
nop
sub $25192, %rdi
mov (%rdx), %r14
nop
nop
nop
nop
and $45215, %rax
lea addresses_UC_ht+0x19483, %rsi
lea addresses_D_ht+0xe903, %rdi
add $41869, %r9
mov $104, %rcx
rep movsw
xor $40528, %rax
lea addresses_D_ht+0xbd03, %rdx
nop
nop
nop
nop
nop
sub %r14, %r14
movb $0x61, (%rdx)
nop
nop
nop
and %r9, %r9
lea addresses_WT_ht+0xe023, %r9
nop
nop
nop
nop
xor $46983, %r14
movw $0x6162, (%r9)
nop
dec %r9
lea addresses_A_ht+0x4e4b, %rdi
nop
nop
nop
dec %rsi
mov (%rdi), %r9w
nop
sub $36831, %rsi
lea addresses_WC_ht+0x173c3, %rsi
lea addresses_WC_ht+0x6903, %rdi
nop
nop
sub %rdx, %rdx
mov $122, %rcx
rep movsb
nop
add %r14, %r14
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %rcx
push %rdi
push %rsi
// Faulty Load
lea addresses_UC+0x1103, %rdi
and %r15, %r15
movb (%rdi), %r14b
lea oracles, %rdi
and $0xff, %r14
shlq $12, %r14
mov (%rdi,%r14,1), %r14
pop %rsi
pop %rdi
pop %rcx
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 11, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': True, 'congruent': 11, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 10, 'size': 1, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 4, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
antlr_demo/antlr_demo/antlr4oc/g4/HyperTalk.g4 | caicai0/ios_demo | 1 | 5368 | <reponame>caicai0/ios_demo
/*
* MIT License
*
* Copyright (c) 2017 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
grammar HyperTalk;
// Start symbol accepting only well-formed HyperTalk scripts that consist of handlers, functions, whitespace and
// comments (representing scipts that are assignable to objects like buttons, fields and cards). Disallows statements or
// expressions that are not inside of a handler or function block.
script
: handler script
| function script
| NEWLINE script
| EOF
;
// Start symbol accepting any sequence of HyperTalk statements, expressions, whitespace and comments. Suitable when
// evaluating the message box or HyperTalk strings via the 'do' command and 'value of' function.
scriptlet
: statement EOF
| multilineScriptlet
;
multilineScriptlet
: statement NEWLINE multilineScriptlet
| statement EOF
| NEWLINE multilineScriptlet
| EOF
;
handler
: 'on' handlerName NEWLINE+ statementList? 'end' handlerName
| 'on' handlerName parameterList NEWLINE+ statementList? 'end' handlerName
;
function
: 'function' ID NEWLINE+ statementList? 'end' ID
| 'function' ID parameterList NEWLINE+ statementList? 'end' ID
;
handlerName
: ID
| commandName // Handlers can take the name of a command keyword (other keywords are disallowed)
;
parameterList
: ID
| parameterList ',' ID
;
statementList
: statement NEWLINE+ statementList
| statement NEWLINE+
;
statement
: commandStmnt
| functionCall
| messageStatement
| expression
| ifStatement
| repeatStatement
| globalStmnt
| returnStmnt
;
globalStmnt
: 'global' parameterList
;
returnStmnt
: 'return' expression
| 'return'
;
ifStatement
: 'if' expression thenStatement
;
thenStatement
: NEWLINE? 'then' statement
| NEWLINE? 'then' statement NEWLINE? elseStatement?
| NEWLINE? 'then' NEWLINE+ statementList? (elseStatement | 'end' 'if')
;
elseStatement
: 'else' statement (NEWLINE+ 'end' 'if')?
| 'else' NEWLINE+ statementList? 'end' 'if'
;
repeatStatement
: 'repeat' repeatRange NEWLINE+ statementList 'end' 'repeat'
| 'repeat' repeatRange NEWLINE+ 'end' 'repeat'
;
messageStatement
: ID
| ID listExpression
;
commandStmnt
: 'add' expression 'to' expression
| 'answer' expression 'with' factor 'or' factor 'or' factor
| 'answer' expression 'with' factor 'or' factor
| 'answer' expression 'with' factor
| 'answer' expression
| 'ask' expression 'with' expression
| 'ask' expression
| 'beep'
| 'beep' expression
| 'choose' toolExpression 'tool'?
| 'choose' 'tool' toolExpression
| 'click' 'at' listExpression
| 'click' 'at' listExpression 'with' listExpression
| 'close' 'file' expression
| 'convert' container 'to' convertible
| 'convert' container 'from' convertible 'to' convertible
| 'convert' expression 'to' convertible
| 'convert' expression 'from' convertible 'to' convertible
| 'create' 'menu' expression
| 'delete' expression
| 'dial' expression
| 'disable' expression
| 'divide' expression 'by' expression
| 'do' expression
| 'domenu' expression
| 'drag' 'from' listExpression 'to' listExpression
| 'drag' 'from' listExpression 'to' listExpression 'with' listExpression
| 'edit' 'the'? 'script' of expression
| 'enable' expression
| 'exit' handlerName
| 'exit' 'repeat'
| 'exit' 'to' 'hypercard'
| 'export' 'paint' 'to' 'file' expression
| 'find' expression? 'international'? expression of expression of 'marked' cards
| 'find' expression? 'international'? expression of expression
| 'find' expression? 'international'? expression of 'marked' cards
| 'find' expression? 'international'? expression
| 'get' expression
| 'go' 'to'? expression 'with' 'visual' expression
| 'go' 'to'? expression
| 'go' 'back'
| 'go' 'back' 'with' 'visual' expression
| 'hide' expression
| 'hide' card picture
| 'hide' background picture
| 'hide' picture of expression
| 'hide' 'titlebar'
| 'import' 'paint' 'from' 'file' expression
| 'lock' 'screen'
| 'multiply' expression 'by' expression
| 'next' 'repeat'
| 'open' 'file' expression
| 'pass' handlerName
| 'play' musicExpression
| 'pop' card
| 'push' card
| 'push' expression
| 'put' listExpression
| 'put' listExpression preposition expression
| 'read' 'from' 'file' expression
| 'read' 'from' 'file' expression 'for' expression
| 'read' 'from' 'file' expression 'at' expression 'for' expression
| 'read' 'from' 'file' expression 'until' expression
| 'reset' 'the'? 'menubar'
| 'reset' 'paint'
| 'select' 'empty'
| 'select' 'text' of expression
| 'select' 'before' 'text' of expression
| 'select' 'after' 'text' of expression
| 'select' expression
| 'select' 'before' expression
| 'select' 'after' expression
| 'set' property 'to' propertyValue
| 'send' listExpression 'to' expression
| 'show' expression
| 'show' card picture
| 'show' background picture
| 'show' picture of expression
| 'show' 'titlebar'
| 'sort' sortChunkType expression sortDirection sortStyle
| 'sort' sortChunkType expression sortDirection sortStyle 'by' expression
| 'sort' sortDirection sortStyle 'by' expression
| 'sort' 'this'? 'stack' sortDirection sortStyle 'by' expression
| 'sort' 'the'? cards (of 'this' 'stack')? sortDirection sortStyle 'by' expression
| 'sort' 'the'? 'marked' cards (of 'this' 'stack')? sortDirection sortStyle 'by' expression
| 'sort' expression sortDirection sortStyle 'by' expression
| 'sort' 'the'? cards of expression sortDirection sortStyle 'by' expression
| 'sort' 'the'? 'marked' cards of expression sortDirection sortStyle 'by' expression
| 'speak' expression
| 'speak' expression 'with' gender=('male'|'female'|'neuter'|'robotic') 'voice'
| 'speak' expression 'with' 'voice' expression
| 'subtract' expression 'from' expression
| 'type' expression
| 'type' expression 'with' ('commandkey' | 'cmdkey')
| 'unlock' 'screen'
| 'unlock' 'screen' 'with' 'visual' expression
| 'visual' expression
| 'wait' expression timeUnit
| 'wait' 'for' expression timeUnit
| 'wait' 'until' expression
| 'wait' 'while' expression
| 'write' expression 'to' 'file' expression
| 'write' expression 'to' 'file' expression 'at' ('eof' | 'end')
| 'write' expression 'to' 'file' expression 'at' expression
;
convertible
: conversionFormat
| conversionFormat 'and' conversionFormat
;
conversionFormat
: seconds
| 'dateitems'
| length 'date'
| length 'time'
;
length
: ('english' | 'long')
| ('abbreviated' | 'abbrev' | 'abbr')
| 'short'
|
;
sortDirection
: 'ascending'
| 'descending'
|
;
sortChunkType
: 'the'? line of
| 'the'? item of
| 'the'? word of
| 'the'? character of
|
;
sortStyle
: 'text'
| 'numeric'
| 'international'
| 'datetime'
|
;
repeatRange
: duration
| count
| 'with' ID '=' range
| 'forever'
|
;
duration
: 'until' expression
| 'while' expression
;
count
: 'for' expression 'times'
| 'for' expression
| expression 'times'
| expression
;
range
: expression 'down' 'to' expression
| expression 'to' expression
;
chunk
: chunk chunk
| ordinal character of
| character expression 'to' expression of
| character expression of
| ordinal word of
| word expression 'to' expression of
| word expression of
| ordinal item of
| item expression 'to' expression of
| item expression of
| ordinal line of
| line expression 'to' expression of
| line expression of
;
menu
: 'menu' factor
| ordinal 'menu'
;
menuItem
: 'menuitem' factor of menu
| ordinal 'menuitem' of menu
;
property
: partProperty
| globalProperty
;
globalProperty
: 'the'? propertyName
;
partProperty
: 'the'? propertyName of factor
| 'the'? length propertyName of factor
;
part
: message
| card 'part' factor
| background 'part' factor
| 'me'
| buttonPart
| fieldPart
| bkgndPart
| cardPart
| stackPart
;
stackPart
: 'this' stack
| stack factor
;
buttonPart
: card? button 'id' factor
| background button 'id' factor
| card? button factor
| background button factor
| ordinal card? button
| ordinal background button
| buttonPart of cardPart
;
fieldPart
: card field 'id' factor
| background? field 'id' factor
| card field factor
| background? field factor
| ordinal card field
| ordinal background? field
| fieldPart of cardPart
;
cardPart
: 'this' card
| card 'id' factor
| position card
| ordinal card
| card factor
| cardPart of bkgndPart
;
bkgndPart
: 'this' background
| background 'id' factor
| background factor
| ordinal background
| position background
;
listExpression
: expression
| expression ',' listExpression
;
expression
: factor
| 'not' expression
| '-' expression
| op=('there is a'|'there is an'|'there is no'|'there is not a'|'there is not an') expression
| expression '^' expression
| expression op=('mod'| 'div'| '/'| '*') expression
| expression op=('+'| '-') expression
| expression op=('&&'| '&') expression
| expression op=('>='|'<='|'≤'|'≥'|'<'|'>'|'contains'|'is in'|'is not in'|'is a'|'is an'|'is not a'|'is not an'|'is within'|'is not within') expression
| expression op=('='|'is not'|'is'|'<>'|'≠') expression
| expression 'and' expression
| expression 'or' expression
;
factor
: literal
| '-' literal
| '(' expression ')'
| effectExpression
| functionCall
| container
| chunk factor
;
container
: ID
| 'the'? 'selection'
| 'target'
| property
| menu
| menuItem
| message
| part
| chunk container
;
musicExpression
: expression expression
| expression 'tempo' expression expression
| expression 'tempo' expression
| expression
;
toolExpression
: 'text'
| 'select'
| 'field'
| 'button'
| 'line'
| ('reg' | 'regular')? ('poly' | 'polygon')
| 'round'? ('rect' | 'rectangle')
| 'spray' 'can'?
| expression
;
effectExpression
: 'effect'? effect
| 'effect'? effect 'to' image
| 'effect'? effect speed
| 'effect'? effect speed 'to' image
;
functionCall
: builtInFunc
| ID '(' listExpression? ')'
;
builtInFunc
: 'the' zeroArgFunc
| 'the'? singleArgFunc of factor
| singleArgFunc '(' listExpression ')'
| multiArgFunc '(' listExpression ')'
;
zeroArgFunc
: 'mouse'
| 'mouseloc'
| 'result'
| ('commandkey' | 'cmdkey')
| 'shiftkey'
| 'optionkey'
| 'ticks'
| seconds
| length 'time'
| length 'date'
| 'tool'
| 'mouseclick'
| 'number' 'of' card? 'parts'
| 'number' 'of' background 'parts'
| 'number' 'of' card? button
| 'number' 'of' background button
| 'number' 'of' card field
| 'number' 'of' background? field
| 'number' 'of' 'menus'
| 'number' 'of' cards (of 'this' 'stack')?
| 'number' 'of' 'marked' cards
| 'number' 'of' background (of 'this' 'stack')?
| 'menus'
| 'diskspace'
| 'params'
| 'paramcount'
| 'sound'
| 'selectedtext'
| 'selectedchunk'
| 'selectedfield'
| 'selectedline'
| 'target'
| 'speech'
| 'voices'
| 'clicktext'
| 'mouseh'
| 'mousev'
| 'screenrect'
| 'clickloc'
| 'clickh'
| 'clickv'
| 'foundchunk'
| 'foundfield'
| 'foundline'
| 'foundtext'
;
singleArgFunc
: 'average'
| 'min'
| 'max'
| 'sum'
| 'number' 'of' character
| 'number' 'of' word
| 'number' 'of' item
| 'number' 'of' line
| 'number' 'of' 'menuitems'
| 'number' 'of' cards
| 'number'
| 'random'
| 'sqrt'
| 'trunc'
| 'sin'
| 'cos'
| 'tan'
| 'atan'
| 'exp'
| 'exp1'
| 'exp2'
| 'ln'
| 'ln1'
| 'log2'
| 'abs'
| 'chartonum'
| 'numtochar'
| 'value'
| 'length'
| 'diskspace'
| 'param'
;
multiArgFunc
: singleArgFunc
| 'annuity'
| 'compound'
| 'offset'
;
literal
: constant
| modifierKey
| mouseState
| knownType
| findType
| LITERAL
;
preposition
: 'before'
| 'after'
| 'into'
;
constant
: cardinalValue
| 'empty'
| 'pi'
| 'quote'
| 'return'
| 'space'
| 'tab'
| 'formfeed'
| 'linefeed'
| 'comma'
| 'colon'
;
cardinalValue
: 'zero'
| 'one'
| 'two'
| 'three'
| 'four'
| 'five'
| 'six'
| 'seven'
| 'eight'
| 'nine'
| 'ten'
;
ordinal
: 'the'? ordinalValue
;
ordinalValue
: 'first'
| 'second'
| 'third'
| 'fourth'
| 'fifth'
| 'sixth'
| 'seventh'
| 'eighth'
| 'ninth'
| 'tenth'
| ('mid' | 'middle')
| 'last'
| 'any'
;
mouseState
: 'up'
| 'down'
;
modifierKey
: 'commandkey'
| 'cmdkey'
| 'optionkey'
| 'shiftkey'
;
knownType
: 'number'
| 'integer'
| 'point'
| 'rect'
| 'rectangle'
| 'date'
| 'logical'
| 'boolean'
| 'bool'
;
findType
: 'word'
| 'chars'
| 'whole'
| 'string'
;
// Not all properties need to be enumerated here, only those sharing a name with another keyword.
propertyName
: 'marked'
| 'selectedtext'
| 'selectedchunk'
| 'selectedfield'
| 'selectedline'
| 'number'
| 'id'
| 'rect'
| 'rectangle'
| 'bottom'
| 'left'
| 'right'
| 'top'
| 'center'
| 'scroll'
| 'script'
| ID
;
// Not all property values need to be enumerated here, only known values sharing a name with another keyword.
propertyValue
: 'plain'
| 'menu'
| 'bottom'
| 'left'
| 'right'
| 'top'
| 'center'
| listExpression
;
commandName
: 'answer'
| 'ask'
| 'put'
| 'get'
| 'set'
| 'send'
| 'wait'
| 'sort'
| 'go'
| 'enable'
| 'disable'
| 'read'
| 'write'
| 'hide'
| 'show'
| 'add'
| 'subtract'
| 'multiply'
| 'divide'
| 'choose'
| 'click'
| 'drag'
| 'type'
| 'lock'
| 'unlock'
| 'pass'
| 'domenu'
| 'visual'
| 'reset'
| 'create'
| 'delete'
| 'play'
| 'dial'
| 'beep'
| 'open'
| 'close'
| 'select'
| 'find'
| 'import'
| 'export'
;
picture
: 'picture'
| 'pict'
;
seconds
: 'seconds'
| 'secs'
| 'second'
| 'sec'
;
speed
: 'fast'
| ('slow' | 'slowly')
| 'very' 'fast'
| 'very' ('slow' | 'slowly')
;
image
: 'black'
| 'card'
| ('gray' | 'grey')
| 'inverse'
| 'white'
;
effect
: 'dissolve'
| 'barn' 'door' 'open'
| 'barn' 'door' 'close'
| 'checkerboard'
| 'iris' 'open'
| 'iris' 'close'
| 'plain'
| 'push' 'up'
| 'push' 'down'
| 'push' 'left'
| 'push' 'right'
| 'scroll' 'down'
| 'scroll' 'up'
| 'scroll' 'left'
| 'scroll' 'right'
| 'shrink' 'to' 'top'
| 'shrink' 'to' 'center'
| 'shrink' 'to' 'bottom'
| 'stretch' 'from' 'top'
| 'stretch' 'from' 'center'
| 'stretch' 'from' 'bottom'
| 'venetian' 'blinds'
| 'wipe' 'up'
| 'wipe' 'down'
| 'wipe' 'left'
| 'wipe' 'right'
| 'zoom' 'in'
| 'zoom' 'out'
| 'zoom' 'open'
| 'zoom' 'close'
;
timeUnit
: 'ticks'
| 'tick'
| seconds
;
position
: 'the'? 'next'
| 'the'? ('prev' | 'previous')
| 'this'
;
message
: 'the'? ('message' | 'msg') ('box' | 'window' | )
;
cards
: 'cards'
| 'cds'
;
card
: 'card'
| 'cd'
;
background
: 'background'
| 'backgrounds'
| 'bkgnd'
| 'bkgnds'
| 'bg'
| 'bgs'
;
button
: 'button'
| 'buttons'
| 'btn'
| 'btns'
;
field
: 'field'
| 'fields'
| 'fld'
| 'flds'
;
stack
: 'stack'
;
character
: 'character'
| 'characters'
| 'char'
| 'chars'
;
word
: 'word'
| 'words'
;
line
: 'line'
| 'lines'
;
item
: 'item'
| 'items'
;
of
: 'of'
| 'from'
| 'in'
;
ID
: (ALPHA (ALPHA | DIGIT)*)
;
BREAK
: ('|' | '¬') WHITESPACE? COMMENT? WHITESPACE? NEWLINE -> skip
;
LITERAL
: STRING_LITERAL
| NUMBER_LITERAL
;
INTEGER_LITERAL
: DIGIT+
;
NUMBER_LITERAL
: INTEGER_LITERAL
| '.' INTEGER_LITERAL
| INTEGER_LITERAL '.'
| INTEGER_LITERAL '.' INTEGER_LITERAL
;
STRING_LITERAL
: '"' ~('"' | '\r' | '\n')* '"'
;
ALPHA
: ('a' .. 'z' | 'A' .. 'Z')+
;
DIGIT
: ('0' .. '9')+
;
COMMENT
: ('--' ~('\r' | '\n' | '|')*) -> skip
;
NEWLINE
: ('\n' | '\r')+
;
WHITESPACE
: (' ' | '\t')+ -> skip
;
UNLEXED_CHAR
: .
;
|
source/asis/spec/ada-tags-generic_dispatching_constructor.ads | faelys/gela-asis | 4 | 11298 | ------------------------------------------------------------------------------
-- A d a r u n - t i m e s p e c i f i c a t i o n --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of ada.ads file --
------------------------------------------------------------------------------
-- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $
generic
type T (<>) is abstract tagged limited private;
type Parameters (<>) is limited private;
with function Constructor (Params : not null access Parameters)
return T is abstract;
function Ada.Tags.Generic_Dispatching_Constructor
(The_Tag : in Tag;
Params : not null access Parameters)
return T'Class;
pragma Preelaborate (Ada.Tags.Generic_Dispatching_Constructor);
pragma Convention (Intrinsic, Ada.Tags.Generic_Dispatching_Constructor);
|
test/constants/test_constants-write.ads | skill-lang/skillAdaTestSuite | 1 | 29198 | <reponame>skill-lang/skillAdaTestSuite<gh_stars>1-10
with Ada.Directories;
with Ahven.Framework;
with Constants.Api;
with Ada.Text_IO;
package Test_Constants.Write is
package Skill renames Constants.Api;
use Constants;
use Constants.Api;
type Test is new Ahven.Framework.Test_Case with null record;
procedure Initialize (T : in out Test);
procedure Set_Up (T : in out Test);
procedure Tear_Down (T : in out Test);
procedure A (T : in out Ahven.Framework.Test_Case'Class);
procedure B (T : in out Ahven.Framework.Test_Case'Class);
procedure C (T : in out Ahven.Framework.Test_Case'Class);
procedure D (T : in out Ahven.Framework.Test_Case'Class);
procedure E (T : in out Ahven.Framework.Test_Case'Class);
end Test_Constants.Write;
|
generated-sources/ada/mojang-sessions/src/model/com-github-asyncmc-mojang-sessions-ada-model-models.ads | AsyncMC/Mojang-API-Libs | 0 | 183 | -- Mojang Session API
-- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
--
-- OpenAPI spec version: 2020_06_05
--
--
-- NOTE: This package is auto generated by the swagger code generator 3.3.4.
-- https://openapi-generator.tech
-- Do not edit the class manually.
with Swagger.Streams;
with Ada.Containers.Vectors;
package com.github.asyncmc.mojang.sessions.ada.model.Models is
type SessionApiError_Type is
record
Error : Swagger.Nullable_UString;
Path : Swagger.Nullable_UString;
end record;
package SessionApiError_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => SessionApiError_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SessionApiError_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SessionApiError_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SessionApiError_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SessionApiError_Type_Vectors.Vector);
type PlayerSkinURL_Type is
record
Url : Swagger.UString;
end record;
package PlayerSkinURL_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => PlayerSkinURL_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerSkinURL_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerSkinURL_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerSkinURL_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerSkinURL_Type_Vectors.Vector);
type PlayerTextureURL_Type is
record
Url : Swagger.UString;
end record;
package PlayerTextureURL_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => PlayerTextureURL_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerTextureURL_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerTextureURL_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerTextureURL_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerTextureURL_Type_Vectors.Vector);
type PlayerTexture_Type is
record
S_K_I_N : com.github.asyncmc.mojang.sessions.ada.model.Models.PlayerSkinURL_Type;
C_A_P_E : com.github.asyncmc.mojang.sessions.ada.model.Models.PlayerTextureURL_Type;
end record;
package PlayerTexture_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => PlayerTexture_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerTexture_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerTexture_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerTexture_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerTexture_Type_Vectors.Vector);
type PlayerProfileTexturePropertyValue_Type is
record
Timestamp : Swagger.Long;
Profile_Id : Swagger.UString;
Profile_Name : Swagger.UString;
Signature_Required : Swagger.Nullable_Boolean;
Textures : com.github.asyncmc.mojang.sessions.ada.model.Models.PlayerTexture_Type;
end record;
package PlayerProfileTexturePropertyValue_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => PlayerProfileTexturePropertyValue_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerProfileTexturePropertyValue_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerProfileTexturePropertyValue_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerProfileTexturePropertyValue_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerProfileTexturePropertyValue_Type_Vectors.Vector);
type PlayerSkinMetadata_Type is
record
Model : Swagger.Nullable_UString;
end record;
package PlayerSkinMetadata_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => PlayerSkinMetadata_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerSkinMetadata_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerSkinMetadata_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerSkinMetadata_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerSkinMetadata_Type_Vectors.Vector);
type PlayerProfile_Type is
record
Id : Swagger.UString;
Name : Swagger.UString;
Legacy : Swagger.Nullable_Boolean;
Properties : com.github.asyncmc.mojang.sessions.ada.model.Models.PlayerProfileProperty_Type_Vectors.Vector;
end record;
package PlayerProfile_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => PlayerProfile_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerProfile_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerProfile_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerProfile_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerProfile_Type_Vectors.Vector);
type PlayerProfileProperty_Type is
record
Name : Swagger.UString;
Value : ByteArray_Type;
Signature : ByteArray_Type;
end record;
package PlayerProfileProperty_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => PlayerProfileProperty_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerProfileProperty_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PlayerProfileProperty_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerProfileProperty_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PlayerProfileProperty_Type_Vectors.Vector);
end com.github.asyncmc.mojang.sessions.ada.model.Models;
|
Cubical/Categories/Limits/Limits.agda | lpw25/cubical | 0 | 10832 | <filename>Cubical/Categories/Limits/Limits.agda
{-# OPTIONS --safe #-}
module Cubical.Categories.Limits.Limits where
open import Cubical.Foundations.Prelude
open import Cubical.Categories.Category
open import Cubical.Categories.Functor
open import Cubical.Categories.NaturalTransformation
private
variable
ℓJ ℓJ' ℓC ℓC' : Level
ℓ ℓ' ℓ'' : Level
module _ {J : Category ℓJ ℓJ'}
{C : Category ℓC ℓC'} where
open Category
open Functor
open NatTrans
-- functor which sends all objects to c and all
-- morphisms to the identity
constF : (c : C .ob) → Functor J C
constF c .F-ob _ = c
constF c .F-hom _ = C .id
constF c .F-id = refl
constF c .F-seq _ _ = sym (C .⋆IdL _)
-- a cone is a natural transformation from the constant functor at x to K
Cone : (K : Functor J C) → C .ob → Type _
Cone K x = NatTrans (constF x) K
module _ {K : Functor J C} where
-- precomposes a cone with a morphism
_◼_ : ∀ {d c : C .ob}
→ (f : C [ d , c ])
→ Cone K c
→ Cone K d
(f ◼ μ) .N-ob x = f ⋆⟨ C ⟩ μ ⟦ x ⟧
(f ◼ μ) .N-hom {x = x} {y} k
= C .id ⋆⟨ C ⟩ (f ⋆⟨ C ⟩ μ ⟦ y ⟧)
≡⟨ C .⋆IdL _ ⟩
f ⋆⟨ C ⟩ μ ⟦ y ⟧
≡⟨ cong (λ v → f ⋆⟨ C ⟩ v) (sym (C .⋆IdL _)) ⟩
f ⋆⟨ C ⟩ (C .id ⋆⟨ C ⟩ μ ⟦ y ⟧)
≡⟨ cong (λ v → f ⋆⟨ C ⟩ v) (μ .N-hom k) ⟩
f ⋆⟨ C ⟩ (μ ⟦ x ⟧ ⋆⟨ C ⟩ K ⟪ k ⟫)
≡⟨ sym (C .⋆Assoc _ _ _) ⟩
f ⋆⟨ C ⟩ μ ⟦ x ⟧ ⋆⟨ C ⟩ K ⟪ k ⟫
∎
-- μ factors ν if there's a morphism such that the natural transformation
-- from precomposing it with ν gives you back μ
_factors_ : {u v : C .ob} (μ : Cone K u) (ν : Cone K v) → Type _
_factors_ {u} {v} μ ν = Σ[ mor ∈ C [ v , u ] ] ν ≡ (mor ◼ μ)
-- μ uniquely factors ν if the factor from above is contractible
_uniquelyFactors_ : {u v : C .ob} (μ : Cone K u) (ν : Cone K v) → Type _
_uniquelyFactors_ {u} {v} μ ν = isContr (μ factors ν)
module _ (K : Functor J C) where
-- a Limit is a cone such that all cones are uniquely factored by it
record isLimit (head : C .ob) : Type (ℓ-max (ℓ-max ℓJ ℓJ') (ℓ-max ℓC ℓC')) where
constructor islimit
field
cone : Cone K head
-- TODO: change this to terminal object in category of Cones?
up : ∀ {v} (ν : Cone K v) → cone uniquelyFactors ν
record Limit : Type (ℓ-max (ℓ-max ℓJ ℓJ') (ℓ-max ℓC ℓC')) where
field
head : C .ob
islim : isLimit head
-- a Category is complete if it has all limits
complete' : {ℓJ ℓJ' : Level} (C : Category ℓC ℓC') → Type _
complete' {ℓJ = ℓJ} {ℓJ'} C = (J : Category ℓJ ℓJ') (K : Functor J C) → Limit K
complete : (C : Category ℓC ℓC') → Typeω
complete C = ∀ {ℓJ ℓJ'} → complete' {ℓJ = ℓJ} {ℓJ'} C
|
src/gen-artifacts-distribs-libs.ads | My-Colaborations/dynamo | 15 | 3856 | -----------------------------------------------------------------------
-- gen-artifacts-distribs-libs -- Unix shared library extraction and distribution
-- Copyright (C) 2012 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with EL.Expressions;
with Util.Strings.Vectors;
-- The <b>Gen.Artifacts.Distribs.Libs</b> package provides a specific
-- distribution rule which gather the shared libraries used by executables
-- and put them in a target distribution directory.
--
-- <install mode='libs' dir='lib'>
-- <library>libgnat</library>
-- <library>libmysql*</library>
-- <fileset dir="bin">
-- <include name="*-server"/>
-- </fileset>
-- </install>
--
-- Libraries to copy in the distribution are specified in the <b>library</b>
-- rule description. The library name must match the pattern defined.
--
-- The command works by executing the Unix application <b>ldd</b> on the
-- executable. It parses the <b>ldd</b> output and collects the libraries
-- that the program is using. It then copies the selected libraries
-- in the target directory.
private package Gen.Artifacts.Distribs.Libs is
-- Create a distribution rule to extract the shared libraries used by an executable
-- and copy a selected subset in the target directory.
function Create_Rule (Node : in DOM.Core.Node) return Distrib_Rule_Access;
-- ------------------------------
-- Distribution artifact
-- ------------------------------
type Libs_Rule is new Distrib_Rule with private;
type Libs_Rule_Access is access all Libs_Rule'Class;
-- Check if the library whose absolute path is defined in <b>Source</b> must be
-- copied in the target directory and copy that library if needed.
procedure Copy (Rule : in Libs_Rule;
Dir : in String;
Source : in String);
-- Get a name to qualify the installation rule (used for logs).
overriding
function Get_Install_Name (Rule : in Libs_Rule) return String;
-- Get the target path associate with the given source file for the distribution rule.
overriding
function Get_Target_Path (Rule : in Libs_Rule;
Base : in String;
File : in File_Record) return String;
overriding
procedure Install (Rule : in Libs_Rule;
Path : in String;
Files : in File_Vector;
Context : in out Generator'Class);
private
type Libs_Rule is new Distrib_Rule with record
Command : EL.Expressions.Expression;
Libraries : Util.Strings.Vectors.Vector;
end record;
end Gen.Artifacts.Distribs.Libs;
|
programs/oeis/080/A080531.asm | karttu/loda | 0 | 92393 | <gh_stars>0
; A080531: Number of nucleons in longest known radioactive decay series ending with Lead 208 ("thorium series"), reversed.
; 208,208,212,212,216,220,224,224,228,228,232,236,240,244,248,252,252,256,260,264,268,272
mov $2,$0
lpb $2,1
sub $0,1
div $2,3
lpe
mov $1,$0
lpb $0,1
sub $0,8
sub $1,1
lpe
mul $1,4
add $1,208
|
programs/oeis/094/A094160.asm | karttu/loda | 0 | 10066 | <reponame>karttu/loda
; A094160: Column 4 of A048790.
; 0,4,76,344,936,1980,3604,5936,9104,13236,18460,24904,32696,41964,52836,65440,79904,96356,114924,135736,158920,184604,212916,243984,277936,314900,355004,398376,445144,495436,549380,607104,668736,734404,804236,878360,956904,1039996,1127764,1220336,1317840,1420404,1528156,1641224,1759736,1883820,2013604,2149216,2290784,2438436,2592300,2752504,2919176,3092444,3272436,3459280,3653104,3854036,4062204,4277736,4500760,4731404,4969796,5216064,5470336,5732740,6003404,6282456,6570024,6866236,7171220,7485104,7808016,8140084,8481436,8832200,9192504,9562476,9942244,10331936,10731680,11141604,11561836,11992504,12433736,12885660,13348404,13822096,14306864,14802836,15310140,15828904,16359256,16901324,17455236,18021120,18599104,19189316,19791884,20406936,21034600,21675004,22328276,22994544,23673936,24366580,25072604,25792136,26525304,27272236,28033060,28807904,29596896,30400164,31217836,32050040,32896904,33758556,34635124,35526736,36433520,37355604,38293116,39246184,40214936,41199500,42200004,43216576,44249344,45298436,46363980,47446104,48544936,49660604,50793236,51942960,53109904,54294196,55495964,56715336,57952440,59207404,60480356,61771424,63080736,64408420,65754604,67119416,68502984,69905436,71326900,72767504,74227376,75706644,77205436,78723880,80262104,81820236,83398404,84996736,86615360,88254404,89913996,91594264,93295336,95017340,96760404,98524656,100310224,102117236,103945820,105796104,107668216,109562284,111478436,113416800,115377504,117360676,119366444,121394936,123446280,125520604,127618036,129738704,131882736,134050260,136241404,138456296,140695064,142957836,145244740,147555904,149891456,152251524,154636236,157045720,159480104,161939516,164424084,166933936,169469200,172030004,174616476,177228744,179866936,182531180,185221604,187938336,190681504,193451236,196247660,199070904,201921096,204798364,207702836,210634640,213593904,216580756,219595324,222637736,225708120,228806604,231933316,235088384,238271936,241484100,244725004,247994776,251293544,254621436,257978580,261365104,264781136,268226804,271702236,275207560,278742904,282308396,285904164,289530336,293187040,296874404,300592556,304341624,308121736,311933020,315775604,319649616,323555184,327492436
mov $2,$0
mov $3,$0
lpb $3,1
mov $0,$2
sub $3,1
sub $0,$3
mov $4,$0
mul $4,4
mov $5,$0
sub $5,1
mul $5,8
pow $5,2
add $4,$5
add $1,$4
lpe
|
source/games/roadrunner.asm | paulscottrobson/atari-cosmos | 0 | 18126 | <filename>source/games/roadrunner.asm
; **********************************************************************************************************
; **********************************************************************************************************
;
; Road Runner
;
; All in one page !
;
; **********************************************************************************************************
; **********************************************************************************************************
page
RRLastObject = 10 ; Road Objects are 0-10.
RRLastKillObject = 6 ; Fatal Objects are 0-6 these flash.
RoadRunner:
jsrp ClearScreen ; Get rid of everything
lbi 0,Player ; Player on far right central
stii 7
lbi 1,Player
stii 8+2
;
; Main loop
;
RRMainLoop:
jsrp Update ; Update display
jsrp MoveVPlayer ; Player moves vertically
nop
;
; Make all the objects flash. Swap with page 2.
;
RRSwapOver:
lbi 0,RRLastKillObject
RRSwapLoop:
ld 2
x 2
xds 0
jp RRSwapLoop
lbi Timer4 ; Check timer
clra
ske
jp RRMainLoop
jp RRMoveAll
jp RRMainLoop
;
; Work through all the objects
;
RRMoveAll:
lbi 0,RRLastObject
RRMoveObjects:
ld 2 ; Get X and switch to 2
add ; Add it. At least one of these is zero.
aisc 15 ; Skips if non-zero, e.g. in use.
jp RRCreateObject
ld 0 ; Read 2.obj. ID which as X.
aisc 15 ; Skip if this is non-zero.
ld 2 ; Switch to 0.x which must be non-zero.
ld 0 ; Read and bump X, it cannot overflow
aisc 1
x 0
clra ; A = 0
skmbz 3 ; skip if bit 3 is clear, not reached edge.
x 0 ; Kills it.
clra ; Back to page 2.
aisc 2
xabr
RRNext:
ld 0 ; Fetch obj.2
xds 2 ; Loop back, switching back to page 0
jp RRMoveObjects
lbi 0,Player ; Check for collision
jsrp CheckCollision
jmp RRMainLoop
aisc 15-RRLastKillObject ; If 0,1,2 are fatals, this is 13, 0,1,2 don't skip.
jmp ShowHolo2LifeLost ; show holo 2, life lost (can save a byte here if needed)
jsrp BumpCounter
jsrp SFXHighShortBeep
jp RRMainLoop ; and loop round again
;
; Object not in use.
;
RRCreateObject:
jsr Random ; Get random value
aisc 6 ; Will skip with value 0-5 if creating this time
jp RRNext
;
; Create new object B = 2,X, A = Y position.
;
x 2 ; Save Y in 2.obj, go to 0.obj
clra
aisc 1
x 2 ; Set 0.obj to 1, switch back to 2.obj
clra
x 3 ; Clear that, switch to 1.obj and retrieve Y
x 3 ; Save in obj.1 and switch back to page 2
jp RRNext
|
alloy4fun_models/trashltl/models/5/GCBrtYHMvAP5LjkqC.als | Kaixi26/org.alloytools.alloy | 0 | 4311 | <gh_stars>0
open main
pred idGCBrtYHMvAP5LjkqC_prop6 {
all t:Trash | always ( t in Trash)
}
pred __repair { idGCBrtYHMvAP5LjkqC_prop6 }
check __repair { idGCBrtYHMvAP5LjkqC_prop6 <=> prop6o } |
Lab 4/Lab4/Caden_Verzino_Felipe_OrricoScognamiglio_Lab4_Sourcecode.asm | felipeorrico/ECE375-Assembly | 0 | 19923 | <reponame>felipeorrico/ECE375-Assembly
;************************************************************
;*
;* Caden_Verzino_Felipe_OrricoScognamiglio_Lab4_Sourcecode.asm
;*
;* This program implements the ATmega LCD library and prints
;* two different strings depending on which switches are
;* pressed. It can also clear the LCD if S8 is pressed.
;*
;* This is the main code file for Lab4
;*
;************************************************************
;*
;* Author: <NAME> & <NAME>
;* Date: 01/28/2021
;*
;************************************************************
.include "m128def.inc" ; Include definition file
;************************************************************
;* Internal Register Definitions and Constants
;************************************************************
.def mpr = r16 ; Multipurpose register is
; required for LCD Driver
;************************************************************
;* Start of Code Segment
;************************************************************
.cseg ; Beginning of code segment
;************************************************************
;* Interrupt Vectors
;************************************************************
.org $0000 ; Beginning of IVs
rjmp INIT ; Reset interrupt
.org $0046 ; End of Interrupt Vectors
;************************************************************
;* Program Initialization
;************************************************************
INIT: ; The initialization routine
; Initialize Stack Pointer
; Code snippet foud in page 20 of AVR starter guide
LDI mpr, LOW(RAMEND) ; Low Byte of End SRAM Address
OUT SPL, mpr ; Write byte to SPL
LDI mpr, HIGH(RAMEND) ; High Byte of End SRAM Address
OUT SPH, mpr ; Write byte to SPH
; Initialize Port D for input (from Lab 1 example code)
ldi mpr, $00 ; Set Port D Data Direction Register
out DDRD, mpr ; for input
ldi mpr, $FF ; Initialize Port D Data Register
out PORTD, mpr ; so all Port D inputs are Tri-State
; Initialize LCD Display
RCALL LCDInit ; Initialize the LCD
RCALL LCDClr ; Clear the LCD
; NOTE that there is no RET or RJMP from INIT, this
; is because the next instruction executed is the
; first instruction of the main program
;***********************************************************
;* Main Program
;***********************************************************
MAIN: ; The Main program
; Display the strings on the LCD Display
IN mpr, PIND ; Get input from Port D
CPI mpr, $FE ; Check if S1 is pressed
BRNE S2 ; Branch if not pressed to next CPI
RCALL Print1 ; Call function to print names
S2: CPI mpr, $FD ; Check if S2 is pressed
BRNE S8 ; Branch if not pressed to next CPI
RCALL Print2 ; Call function to print names
S8: CPI mpr, $7F ; Check if S8 is pressed
BRNE MAIN ; Branch if not pressed to MAIN
RCALL LCDClr ; Call function to print names
rjmp MAIN ; jump back to main and create an infinite
; while loop. Generally, every main program is an
; infinite while loop, never let the main program
; just run off
;***********************************************************
;* Functions and Subroutines
;***********************************************************
;-----------------------------------------------------------
; Func: Print1
; Desc: Prints contents of both strings if S1 is pressed
;-----------------------------------------------------------
Print1:
; Selected line 1 for printing
LDI YL, $00 ; Pointing Y to $0100
LDI YH, $01 ; Pointing Y to $0100
; Load string1 (address) from memory into Z
LDI ZL, LOW(STRING1_BEG<<1) ; Load String address (LOW) from Program Memory
LDI ZH, HIGH(STRING1_BEG<<1) ; Load String address (HIGH) from Program Memory
Loop: ; Loop for entire string
CPI ZL, LOW(STRING1_END<<1) ; Check if Z(LOW) is pointing to LOW(STRING1_END<<1)
BREQ END ; Branch id ZL is equal to ($10 << 1) to END
LPM mpr, Z+ ; Load character from Z address into mpr and post-increment Z
ST Y+, mpr ; Store mpr into (Y) and post-increment Y
RJMP Loop ; Loop back to Loop
END:
RCALL LCDWrLn1 ; Print First Line to LCD
; Selected line 2 for printing
LDI YL, $10 ; Pointing Y to $0110
LDI YH, $01 ; Pointing Y to $0110
; Load string1 from memory into Z (Address)
LDI ZL, LOW(STRING2_BEG<<1) ; Load String address (LOW) from Program Memory
LDI ZH, HIGH(STRING2_BEG<<1) ; Load String address (HIGH) from Program Memory
Loop2: ; Loop for entire string
CPI ZL, LOW(STRING2_END<<1) ; Check if Z(LOW) is pointing to LOW(STRING2_END<<1)
BREQ END2 ; Branch if ZL is equal to LOW(STRING2_END<<1)
LPM mpr, Z+ ; Load character from Z address into mpr and post-increment Z
ST Y+, mpr ; Store mpr into (Y) and post-increment Y
RJMP Loop2 ; Loop to Loop2
END2:
RCALL LCDWrLn2 ; Print Second Line to LCD
ret
;-----------------------------------------------------------
; Func: Print2
; Desc: Prints contents of both strings if S2 is pressed
;-----------------------------------------------------------
Print2:
; Selected line 1 for printing
LDI YL, $00 ; Pointing Y to $0100
LDI YH, $01 ; Pointing Y to $0100
; Load string1 (address) from memory into Z
LDI ZL, LOW(STRING2_BEG<<1) ; Load String address (LOW) from Program Memory
LDI ZH, HIGH(STRING2_BEG<<1) ; Load String address (HIGH) from Program Memory
Loop3: ; Loop for entire string
CPI ZL, LOW(STRING2_END<<1) ; Check if Z(LOW) is pointing to LOW(STRING1_END<<1)
BREQ END3 ; Branch id ZL is equal to ($10 << 1) to END
LPM mpr, Z+ ; Load character from Z address into mpr and post-increment Z
ST Y+, mpr ; Store mpr into (Y) and post-increment Y
RJMP Loop3 ; Loop back to Loop
END3:
RCALL LCDWrLn1 ; Print First Line to LCD
; Selected line 2 for printing
LDI YL, $10 ; Pointing Y to $0110
LDI YH, $01 ; Pointing Y to $0110
; Load string1 from memory into Z (Address)
LDI ZL, LOW(STRING1_BEG<<1) ; Load String address (LOW) from Program Memory
LDI ZH, HIGH(STRING1_BEG<<1) ; Load String address (HIGH) from Program Memory
Loop4: ; Loop for entire string
CPI ZL, LOW(STRING1_END<<1) ; Check if Z(LOW) is pointing to LOW(STRING2_END<<1)
BREQ END4 ; Branch if ZL is equal to LOW(STRING2_END<<1)
LPM mpr, Z+ ; Load character from Z address into mpr and post-increment Z
ST Y+, mpr ; Store mpr into (Y) and post-increment Y
RJMP Loop4 ; Loop to Loop2
END4:
RCALL LCDWrLn2 ; Print Second Line to LCD
ret
;***********************************************************
;* Stored Program Data
;***********************************************************
STRING1_BEG:
.DB "<NAME> " ; Declaring STRING1 in ProgMem
STRING1_END:
STRING2_BEG:
.DB "<NAME> " ; Declaring STRING2 in ProgMem
STRING2_END:
;***********************************************************
;* Additional Program Includes
;***********************************************************
.include "LCDDriver.asm" ; Include the LCD Driver
|
test/Fail/CoinductionAndUnivalence.agda | KDr2/agda | 0 | 14146 | <filename>test/Fail/CoinductionAndUnivalence.agda
{- <NAME>, 26-05-2014
Issue 1023
Example by <NAME>, adapted by <NAME>
-}
{-# OPTIONS --cubical-compatible --guardedness #-}
module CoinductionAndUnivalence where
open import Common.Coinduction
open import Common.Equality
prop = Set
data False : prop where
magic : ∀ {a} {A : Set a} → False → A
magic ()
data Pandora : prop where
C : ∞ False → Pandora
postulate
ext : (f : False → Pandora) → (g : Pandora → False) →
(∀ x → f (g x) ≡ x) → (∀ y → g (f y) ≡ y) →
False ≡ Pandora
foo : False ≡ Pandora
foo = ext f g fg gf
where
f : False → Pandora
f ()
g : Pandora → False
g (C c) = ♭ c
fg : ∀ x → f (g x) ≡ x
fg x = magic (g x)
gf : ∀ y → g (f y) ≡ y
gf ()
loop : False
loop rewrite foo = C (♯ loop)
|
oeis/021/A021288.asm | neoneye/loda-programs | 11 | 3070 | ; A021288: Decimal expansion of 1/284.
; 0,0,3,5,2,1,1,2,6,7,6,0,5,6,3,3,8,0,2,8,1,6,9,0,1,4,0,8,4,5,0,7,0,4,2,2,5,3,5,2,1,1,2,6,7,6,0,5,6,3,3,8,0,2,8,1,6,9,0,1,4,0,8,4,5,0,7,0,4,2,2,5,3,5,2,1,1,2,6,7,6,0,5,6,3,3,8,0,2,8,1,6,9,0,1,4,0,8,4
mov $2,10
pow $2,$0
mul $2,5
div $2,142
mov $0,$2
mod $0,10
|
src/features/userspace.asm | FranchuFranchu/fran-os | 1 | 29534 | <gh_stars>1-10
; IN = EBX: Userspace code
kernel_switch_to_userspace:
; We will fake the return stack for iret to make the cpu
; believe that a userspace process triggered an interrupt
mov ax,0x23
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax ; we don't need to worry about SS. it's handled by iret
mov eax,esp
push 0x23 ; user data segment with bottom 2 bits set for ring 3
push eax ; push our current ss for the iret stack frame
pushf
push 0x1B; ; user code segment with bottom 2 bits set for ring 3
push ebx ; may need to remove the _ for this to work right
xchg bx, bx
iret
kernel_task_state_segment:
.prev_tss: dd 0 ; The previous TSS - if we used hardware task switching this would form a linked list.
.esp0: dd 0 ; The stack pointer to load when we change to kernel mode.
.ss0: dd 0 ; The stack segment to load when we change to kernel mode.
.esp1: dd 0 ; everything below here is unusued now..
.ss1: dd 0
.esp2: dd 0
.ss2: dd 0
.cr3: dd 0
.eip: dd 0
.eflags: dd 0
.eax: dd 0
.ecx: dd 0
.edx: dd 0
.ebx: dd 0
.esp: dd 0
.ebp: dd 0
.esi: dd 0
.edi: dd 0
.es: dd 0
.cs: dd 0
.ss: dd 0
.ds: dd 0
.fs: dd 0
.gs: dd 0
.ldt: dd 0
.trap: dw 0
.iomap_base: dw 0
kernel_task_state_segment_end:
kernel_userspace_setup:
; Setup the TSS
mov eax, esp
mov [kernel_task_state_segment.esp0], eax
xor eax, eax
mov ax, ss
mov [kernel_task_state_segment.ss0], eax
mov eax, kernel_task_state_segment
; Set base in the GDT
mov ebx, eax
mov [kernel_gdt_task_state_segment.base_0_15], bx
mov ebx, eax
shr ebx, 16
mov [kernel_gdt_task_state_segment.base_16_23], bl
mov ebx, eax
shr ebx, 24
mov [kernel_gdt_task_state_segment.base_24_31], bl
; Set limit
; Note that the limit is a 20-bit value
mov eax, kernel_task_state_segment_end - kernel_task_state_segment
mov ebx, eax
mov [kernel_gdt_task_state_segment.limit_0_15], bx
mov ebx, eax
shr ebx, 16
and bl, 0x0F
or [kernel_gdt_task_state_segment.limit_and_flags], bl
; Set the "present" flag
or byte [kernel_gdt_task_state_segment.access], 0x80
mov ax, 0x2B
ltr ax
ret |
gcc-gcc-7_3_0-release/gcc/ada/a-cuprqu.adb | best08618/asylo | 7 | 12358 | <reponame>best08618/asylo
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- ADA.CONTAINERS.UNBOUNDED_PRIORITY_QUEUES --
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- This unit was originally developed by <NAME>. --
------------------------------------------------------------------------------
package body Ada.Containers.Unbounded_Priority_Queues is
protected body Queue is
-----------------
-- Current_Use --
-----------------
function Current_Use return Count_Type is
begin
return Q_Elems.Length;
end Current_Use;
-------------
-- Dequeue --
-------------
entry Dequeue (Element : out Queue_Interfaces.Element_Type)
when Q_Elems.Length > 0
is
-- Grab the first item of the set, and remove it from the set
C : constant Cursor := First (Q_Elems);
begin
Element := Sets.Element (C).Item;
Delete_First (Q_Elems);
end Dequeue;
--------------------------------
-- Dequeue_Only_High_Priority --
--------------------------------
procedure Dequeue_Only_High_Priority
(At_Least : Queue_Priority;
Element : in out Queue_Interfaces.Element_Type;
Success : out Boolean)
is
-- Grab the first item. If it exists and has appropriate priority,
-- set Success to True, and remove that item. Otherwise, set Success
-- to False.
C : constant Cursor := First (Q_Elems);
begin
Success := Has_Element (C) and then
not Before (At_Least, Get_Priority (Sets.Element (C).Item));
if Success then
Element := Sets.Element (C).Item;
Delete_First (Q_Elems);
end if;
end Dequeue_Only_High_Priority;
-------------
-- Enqueue --
-------------
entry Enqueue (New_Item : Queue_Interfaces.Element_Type) when True is
begin
Insert (Q_Elems, (Next_Sequence_Number, New_Item));
Next_Sequence_Number := Next_Sequence_Number + 1;
-- If we reached a new high-water mark, increase Max_Length
if Q_Elems.Length > Max_Length then
pragma Assert (Max_Length + 1 = Q_Elems.Length);
Max_Length := Q_Elems.Length;
end if;
end Enqueue;
--------------
-- Peak_Use --
--------------
function Peak_Use return Count_Type is
begin
return Max_Length;
end Peak_Use;
end Queue;
end Ada.Containers.Unbounded_Priority_Queues;
|
programs/oeis/126/A126562.asm | karttu/loda | 1 | 165022 | <reponame>karttu/loda
; A126562: Number of intersections of at least four edges in a cube of n X n X n smaller cubes.
; 0,7,32,81,160,275,432,637,896,1215,1600,2057,2592,3211,3920,4725,5632,6647,7776,9025,10400,11907,13552,15341,17280,19375,21632,24057,26656,29435,32400,35557,38912,42471,46240,50225,54432,58867,63536,68445
mov $1,6
add $1,$0
mul $1,$0
mul $1,$0
|
yasm-1.3.0/modules/parsers/nasm/tests/dirwarning.asm | xu5343/ffmpegtoolkit_CentOS7 | 2,151 | 240781 | <gh_stars>1000+
[warning -w]
|
codes.asm | Uxeron/Disasm | 0 | 89965 | <gh_stars>0
names db 'UNKNOWN' ; 00
db 'AAA ' ; 01
db 'AAD ' ; 02
db 'AAM ' ; 03
db 'AAS ' ; 04
db 'ADC ' ; 05
db 'ADD ' ; 06
db 'AND ' ; 07
db 'CALL ' ; 08
db 'CBW ' ; 09
db 'CLC ' ; 0A
db 'CLD ' ; 0B
db 'CLI ' ; 0C
db 'CMC ' ; 0D
db 'CMP ' ; 0E
db 'CMPSB ' ; 0F
db 'CMPSW ' ; 10
db 'CWD ' ; 11
db 'DAA ' ; 12
db 'DAS ' ; 13
db 'DEC ' ; 14
db 'DIV ' ; 15
db 'ESC ' ; 16
db 'HLT ' ; 17
db 'IDIV ' ; 18
db 'IMUL ' ; 19
db 'IN ' ; 1A
db 'INC ' ; 1B
db 'INT ' ; 1C
db 'INTO ' ; 1D
db 'IRET ' ; 1E
db 'JA ' ; 1F
db 'JB ' ; 20
db 'JCXZ ' ; 21
db 'JE ' ; 22
db 'JG ' ; 23
db 'JL ' ; 24
db 'JMP ' ; 25
db 'JNA ' ; 26
db 'JNB ' ; 27
db 'JNE ' ; 28
db 'JNG ' ; 29
db 'JNL ' ; 2A
db 'JNO ' ; 2B
db 'JNP ' ; 2C
db 'JNS ' ; 2D
db 'JO ' ; 2E
db 'JP ' ; 2F
db 'JS ' ; 30
db 'LAHF ' ; 31
db 'LDS ' ; 32
db 'LEA ' ; 33
db 'LES ' ; 34
db 'LOCK ' ; 35
db 'LODSB ' ; 36
db 'LODSW ' ; 37
db 'LOOP ' ; 38
db 'LOOPE ' ; 39
db 'LOOPNE ' ; 3A
db 'MOV ' ; 3B
db 'MOVSB ' ; 3C
db 'MOVSW ' ; 3D
db 'MUL ' ; 3E
db 'NEG ' ; 3F
db 'NOP ' ; 40
db 'NOT ' ; 41
db 'OR ' ; 42
db 'OUT ' ; 43
db 'POP ' ; 44
db 'POPF ' ; 45
db 'PUSH ' ; 46
db 'PUSHF ' ; 47
db 'RCL ' ; 48
db 'RCR ' ; 49
db 'REP ' ; 4A
db 'REPNE ' ; 4B
db 'RET ' ; 4C
db 'RETF ' ; 4D
db 'RETN ' ; 4E
db 'ROL ' ; 4F
db 'ROR ' ; 50
db 'SAHF ' ; 51
db 'SAR ' ; 52
db 'SBB ' ; 53
db 'SCASB ' ; 54
db 'SCASW ' ; 55
db 'SEGCS ' ; 56
db 'SEGDS ' ; 57
db 'SEGES ' ; 58
db 'SEGSS ' ; 59
db 'SHL ' ; 5A
db 'SHR ' ; 5B
db 'STC ' ; 5C
db 'STD ' ; 5D
db 'STI ' ; 5E
db 'STOSB ' ; 5F
db 'STOSW ' ; 60
db 'SUB ' ; 61
db 'TEST ' ; 62
db 'WAIT ' ; 63
db 'XCHG ' ; 64
db 'XLAT ' ; 65
db 'XOR ' ; 66
; 0 1 2 3 4 5 6 7
regs dw 'AL','CL','DL','BL','AH','CH','DH','BH'
regs2 dw 'AX','CX','DX','BX','SP','BP','SI','DI'
mem db 'BX+SI','BX+DI','BP+SI','BP+DI',0h,0h
mem2 dw 0h,0h,0h,0h,'SI','DI','BP','BX'
regsS dw 'ES' ; 0
dw 'CS' ; 1
dw 'SS' ; 2
dw 'DS' ; 3
farTxt db 'far '
bptr db 'byte ptr '
wptr db 'word ptr '
; Bits composition
; sreg scvw
; sc - subcode, specifies which block of names to look at for rMWN command
; Read functions
rMWR equ 01h ; Read MOD with REG
rMWN equ 02h ; Read MOD with name code
rBIT equ 03h ; Read next command byte as bits
rOFF equ 04h ; Read offset
rILM equ 05h ; Read immediate LSB [MSB]
rALM equ 06h ; Read address ALSB AMSB
; Write functions
wROM equ 10h ; Write r/m
wREG equ 11h ; Write REG
wNAM equ 12h ; Write command name
wCOM equ 13h ; Write comma (,)
wACC equ 14h ; Write accumulator
wIML equ 15h ; Write MSB LSB
wAML equ 16h ; Write [AMSB ALSB]
wIPO equ 17h ; Write IP+offset
wSEG equ 18h ; Write SR
wPRM equ 19h ; Write size ptr r/m
; Special functions
sPRE equ 20h ; Set the prefix for next command
sEXP equ 21h ; Write sign-extended LSB
sSPC equ 22h ; reg = 0: write 1; reg = 1: write AL; reg = 2: write AX; reg = 3: write 3; reg = 4: write "far"; reg = 5: write CL
sESC equ 23h ; Read next command byte as yyy and then write hex("reg yyy")
sIAM equ 24h ; Write MSB LSB:AMSB ALSB
sEXT equ 25h ; Execute extended function
sIPI equ 26h ; Write IP+MSB LSB
sREP equ 27h ; Step into different command using offset as address
outOffset equ 40h
namOffset equ 58h
argOffset equ 60h
emptySpace db 38h DUP(' ')
db 0Ah, 0Dh
functions dw 0h, frMWR, frMWN, frBIT, frOFF, frILM, frALM, 0h, 0h,0h,0h,0h,0h,0h,0h,0h
dw fwROM, fwREG, fwNAM, fwCOM, fwACC, fwIML, fwAML, fwIPO, fwSEG, fwPRM,0h,0h,0h,0h,0h,0h
dw fsPRE, fsEXP, fsSPC, fsESC, fsIAM, fsEXT, fsIPI, fsREP,0h,0h,0h,0h,0h,0h,0h
; 000 001 010 011 100 101 110 111
subNames db 1Bh, 14h, 08h, 08h, 25h, 25h, 46h, 00h ; 0xFE - 0xFF
db 62h, 00h, 41h, 3Fh, 3Eh, 19h, 15h, 18h ; 0xF6 - 0xF7
db 4Fh, 50h, 48h, 49h, 5Ah, 5Bh, 00h, 52h ; 0xD0 - 0xD3
db 06h, 42h, 05h, 53h, 07h, 61h, 66h, 0Eh ; 0x80 - 0x83
; Hex Com Args Size
codes db 06h, rBIT,000h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 00 ADD r/m, reg Byte
db 06h, rBIT,001h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 01 ADD r/m, reg Word
db 06h, rBIT,000h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 02 ADD reg, r/m Byte
db 06h, rBIT,001h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 03 ADD reg, r/m Word
db 06h, rBIT,000h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 04 ADD AL, LSB Byte
db 06h, rBIT,001h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 05 ADD AX, MSB LSB Word
db 46h, rBIT,000h,wNAM,wSEG, 0h, 0h, 0h, 0h,0 ; 06 PUSH ES
db 44h, rBIT,000h,wNAM,wSEG, 0h, 0h, 0h, 0h,0 ; 07 POP ES
db 42h, rBIT,000h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 08 OR r/m, reg Byte
db 42h, rBIT,001h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 09 OR r/m, reg Word
db 42h, rBIT,000h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 0A OR reg, r/m Byte
db 42h, rBIT,001h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 0B OR reg, r/m Word
db 42h, rBIT,000h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 0C OR AL, LSB Byte
db 42h, rBIT,001h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 0D OR AX, MSB LSB Word
db 46h, rBIT,010h,wNAM,wSEG, 0h, 0h, 0h, 0h,0 ; 0E PUSH CS
db 44h, rBIT,010h,wNAM,wSEG, 0h, 0h, 0h, 0h,0 ; 0F POP CS
db 05h, rBIT,000h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 10 ADC r/m, reg Byte
db 05h, rBIT,001h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 11 ADC r/m, reg Word
db 05h, rBIT,000h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 12 ADC reg, r/m Byte
db 05h, rBIT,001h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 13 ADC reg, r/m Word
db 05h, rBIT,000h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 14 ADC AL, LSB Byte
db 05h, rBIT,001h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 15 ADC AX, MSB LSB Word
db 46h, rBIT,020h,wNAM,wSEG, 0h, 0h, 0h, 0h,0 ; 16 PUSH SS
db 44h, rBIT,020h,wNAM,wSEG, 0h, 0h, 0h, 0h,0 ; 17 POP SS
db 53h, rBIT,000h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 18 SBB r/m, reg Byte
db 53h, rBIT,001h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 19 SBB r/m, reg Word
db 53h, rBIT,000h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 1A SBB reg, r/m Byte
db 53h, rBIT,001h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 1B SBB reg, r/m Word
db 53h, rBIT,000h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 1C SBB AL, LSB Byte
db 53h, rBIT,001h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 1D SBB AX, MSB LSB Word
db 46h, rBIT,030h,wNAM,wSEG, 0h, 0h, 0h, 0h,0 ; 1E PUSH DS
db 44h, rBIT,030h,wNAM,wSEG, 0h, 0h, 0h, 0h,0 ; 1F POP DS
db 07h, rBIT,000h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 20 AND r/m, reg Byte
db 07h, rBIT,001h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 21 AND r/m, reg Word
db 07h, rBIT,000h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 22 AND reg, r/m Byte
db 07h, rBIT,001h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 23 AND reg, r/m Word
db 07h, rBIT,000h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 24 AND AL, LSB Byte
db 07h, rBIT,001h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 25 AND AX, MSB LSB Word
db 00h, rBIT,000h,sPRE, 0h, 0h, 0h, 0h, 0h,0 ; 26 Prefix ES
db 12h, wNAM,000h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 27 DAA
db 61h, rBIT,000h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 28 SUB r/m, reg Byte
db 61h, rBIT,001h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 29 SUB r/m, reg Word
db 61h, rBIT,000h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 2A SUB reg, r/m Byte
db 61h, rBIT,001h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 2B SUB reg, r/m Word
db 61h, rBIT,000h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 2C SUB AL, LSB Byte
db 61h, rBIT,001h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 2D SUB AX, MSB LSB Word
db 00h, rBIT,010h,sPRE, 0h, 0h, 0h, 0h, 0h,0 ; 2E Prefix CS
db 13h, wNAM,000h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 2F DAS
db 66h, rBIT,000h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 30 XOR r/m, reg Byte
db 66h, rBIT,001h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 31 XOR r/m, reg Word
db 66h, rBIT,000h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 32 XOR reg, r/m Byte
db 66h, rBIT,001h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 33 XOR reg, r/m Word
db 66h, rBIT,000h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 34 XOR AL, LSB Byte
db 66h, rBIT,001h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 35 XOR AX, MSB LSB Word
db 00h, rBIT,020h,sPRE, 0h, 0h, 0h, 0h, 0h,0 ; 36 Prefix SS
db 01h, wNAM,000h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 37 AAA
db 0Eh, rBIT,000h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 38 CMP r/m, reg Byte
db 0Eh, rBIT,001h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 39 CMP r/m, reg Word
db 0Eh, rBIT,000h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 3A CMP reg, r/m Byte
db 0Eh, rBIT,001h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 3B CMP reg, r/m Word
db 0Eh, rBIT,000h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 3C CMP AL, LSB Byte
db 0Eh, rBIT,001h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; 3D CMP AX, MSB LSB Word
db 00h, rBIT,030h,sPRE, 0h, 0h, 0h, 0h, 0h,0 ; 3E Prefix DS
db 04h, wNAM,000h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 3F AAS
db 1Bh, rBIT,001h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 40 INC AX Word
db 1Bh, rBIT,011h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 41 INC CX Word
db 1Bh, rBIT,021h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 42 INC DX Word
db 1Bh, rBIT,031h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 43 INC BX Word
db 1Bh, rBIT,041h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 44 INC SP Word
db 1Bh, rBIT,051h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 45 INC BP Word
db 1Bh, rBIT,061h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 46 INC SI Word
db 1Bh, rBIT,071h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 47 INC DI Word
db 14h, rBIT,001h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 48 DEC AX Word
db 14h, rBIT,011h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 49 DEC CX Word
db 14h, rBIT,021h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 4A DEC DX Word
db 14h, rBIT,031h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 4B DEC BX Word
db 14h, rBIT,041h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 4C DEC SP Word
db 14h, rBIT,051h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 4D DEC BP Word
db 14h, rBIT,061h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 4E DEC SI Word
db 14h, rBIT,071h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 4F DEC DI Word
db 46h, rBIT,001h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 50 PUSH AX Word
db 46h, rBIT,011h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 51 PUSH CX Word
db 46h, rBIT,021h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 52 PUSH DX Word
db 46h, rBIT,031h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 53 PUSH BX Word
db 46h, rBIT,041h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 54 PUSH SP Word
db 46h, rBIT,051h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 55 PUSH BP Word
db 46h, rBIT,061h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 56 PUSH SI Word
db 46h, rBIT,071h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 57 PUSH DI Word
db 44h, rBIT,001h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 58 POP AX Word
db 44h, rBIT,011h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 59 POP CX Word
db 44h, rBIT,021h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 5A POP DX Word
db 44h, rBIT,031h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 5B POP BX Word
db 44h, rBIT,041h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 5C POP SP Word
db 44h, rBIT,051h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 5D POP BP Word
db 44h, rBIT,061h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 5E POP SI Word
db 44h, rBIT,071h,wNAM,wREG, 0h, 0h, 0h, 0h,0 ; 5F POP DI Word
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 60 NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 61 NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 62 NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 63 NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 64 NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 65 NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 66 NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 67 NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 68 NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 69 NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 6A NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 6B NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 6C NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 6D NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 6E NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 6F NO COMMAND
db 2Eh, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 70 JO IP+offset
db 2Bh, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 71 JNO IP+offset
db 20h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 72 JB IP+offset
db 27h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 73 JNB IP+offset
db 22h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 74 JE IP+offset
db 28h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 75 JNE IP+offset
db 26h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 76 JNA IP+offset
db 1Fh, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 77 JA IP+offset
db 30h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 78 JS IP+offset
db 2Dh, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 79 JNS IP+offset
db 2Fh, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 7A JP IP+offset
db 25h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 7B JNP IP+offset
db 24h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 7C JL IP+offset
db 2Ah, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 7D JNL IP+offset
db 29h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 7E JNG IP+offset
db 23h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; 7F JG IP+offset
db 00h, rBIT,00Ch,rMWN,rILM,wNAM,wPRM,wCOM,wIML,0 ; 80 Comm depends on code Byte
db 00h, rBIT,00Dh,rMWN,rILM,wNAM,wPRM,wCOM,wIML,0 ; 81 Comm depends on code Word
db 00h, rBIT,00Ch,rMWN,rILM,wNAM,wPRM,wCOM,wIML,0 ; 82 Comm depends on code Byte
db 00h, rBIT,08Dh,rMWN,rILM,wNAM,wPRM,wCOM,sEXP,0 ; 83 Comm depends on code Word
db 62h, rBIT,000h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 84 TEST reg, r/m Byte
db 62h, rBIT,001h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 85 TEST reg, r/m Word
db 64h, rBIT,000h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 86 XCHG reg, r/m Byte
db 64h, rBIT,001h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 87 XCHG reg, r/m Word
db 3Bh, rBIT,000h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 88 MOV r/m, reg Byte
db 3Bh, rBIT,001h,rMWR,wNAM,wROM,wCOM,wREG, 0h,0 ; 89 MOV r/m, reg Word
db 3Bh, rBIT,000h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 8A MOV reg, r/m Byte
db 3Bh, rBIT,001h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; 8B MOV reg, r/m Word
db 3Bh, rBIT,001h,rMWR,wNAM,wROM,wCOM,wSEG, 0h,0 ; 8C MOV r/m, SEG
db 33h, rMWR,wNAM,wREG,wCOM,wROM, 0h, 0h, 0h,0 ; 8D LEA reg, r/m
db 3Bh, rMWR,wNAM,wSEG,wCOM,wROM, 0h, 0h, 0h,0 ; 8E MOV SEG, r/m
db 44h, rMWR,wNAM,wROM, 0h, 0h, 0h, 0h, 0h,0 ; 8F POP r/m
db 40h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 90 NOP
db 64h, rBIT,011h,wNAM,wREG,wCOM,wACC, 0h, 0h,0 ; 91 XCHG CX, AX Word
db 64h, rBIT,021h,wNAM,wREG,wCOM,wACC, 0h, 0h,0 ; 92 XCHG DX, AX Word
db 64h, rBIT,031h,wNAM,wREG,wCOM,wACC, 0h, 0h,0 ; 93 XCHG BX, AX Word
db 64h, rBIT,041h,wNAM,wREG,wCOM,wACC, 0h, 0h,0 ; 94 XCHG SP, AX Word
db 64h, rBIT,051h,wNAM,wREG,wCOM,wACC, 0h, 0h,0 ; 95 XCHG BP, AX Word
db 64h, rBIT,061h,wNAM,wREG,wCOM,wACC, 0h, 0h,0 ; 96 XCHG SI, AX Word
db 64h, rBIT,071h,wNAM,wREG,wCOM,wACC, 0h, 0h,0 ; 97 XCHG DI, AX Word
db 09h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 98 CBW
db 11h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 99 CWD
db 08h, rBIT,001h,rALM,rILM,wNAM,sIAM, 0h, 0h,0 ; 9A CALL MSB LSB:AMSB ALSB
db 63h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 9B WAIT
db 47h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 9C PUSHF
db 45h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 9D POPF
db 51h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 9E SAHF
db 31h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; 9F LAHF
db 3Bh, rBIT,000h,rALM,wNAM,wACC,wCOM,wAML, 0h,0 ; A0 MOV AL, AMSB ALSB Byte
db 3Bh, rBIT,001h,rALM,wNAM,wACC,wCOM,wAML, 0h,0 ; A1 MOV AX, AMSB ALSB Word
db 3Bh, rBIT,000h,rALM,wNAM,wAML,wCOM,wACC, 0h,0 ; A2 MOV AMSB ALSB, AL Byte
db 3Bh, rBIT,001h,rALM,wNAM,wAML,wCOM,wACC, 0h,0 ; A3 MOV AMSB ALSB, AX Word
db 3Ch, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; A4 MOVSB
db 3Dh, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; A5 MOVSW
db 0Fh, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; A6 CMPSB
db 10h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; A7 CMPSW
db 62h, rBIT,000h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; A8 TEST AL, LSB Byte
db 62h, rBIT,001h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; A9 TEST AX, MSB, LSB Byte
db 5Fh, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; AA STOSB
db 60h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; AB STOSW
db 36h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; AC LODSB
db 37h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; AD LODSW
db 54h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; AE SCASB
db 55h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; AF SCASW
db 3Bh, rBIT,000h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; B0 MOV AL, LSB Byte
db 3Bh, rBIT,010h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; B1 MOV CL, LSB Byte
db 3Bh, rBIT,020h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; B2 MOV DL, LSB Byte
db 3Bh, rBIT,030h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; B3 MOV BL, LSB Byte
db 3Bh, rBIT,040h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; B4 MOV AH, LSB Byte
db 3Bh, rBIT,050h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; B5 MOV CH, LSB Byte
db 3Bh, rBIT,060h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; B6 MOV DH, LSB Byte
db 3Bh, rBIT,070h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; B7 MOV BH, LSB Byte
db 3Bh, rBIT,001h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; B8 MOV AX, MSB LSB Word
db 3Bh, rBIT,011h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; B9 MOV CX, MSB LSB Word
db 3Bh, rBIT,021h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; BA MOV DX, MSB LSB Word
db 3Bh, rBIT,031h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; BB MOV BX, MSB LSB Word
db 3Bh, rBIT,041h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; BC MOV SP, MSB LSB Word
db 3Bh, rBIT,051h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; BD MOV BP, MSB LSB Word
db 3Bh, rBIT,061h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; BE MOV SI, MSB LSB Word
db 3Bh, rBIT,071h,rILM,wNAM,wREG,wCOM,wIML, 0h,0 ; BF MOV DI, MSB LSB Word
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; C0 NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; C1 NO COMMAND
db 4Ch, rBIT,001h,rILM,wNAM,wIML, 0h, 0h, 0h,0 ; C2 RET MSB LSB Word
db 4Ch, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; C3 RET
db 34h, rBIT,001h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; C4 LES reg, r/m
db 32h, rBIT,001h,rMWR,wNAM,wREG,wCOM,wROM, 0h,0 ; C5 LDS reg, r/m
db 3Bh, rBIT,000h,rMWR,rILM,wNAM,wPRM,wCOM,wIML,0 ; C6 MOV r/m, LSB
db 3Bh, rBIT,001h,rMWR,rILM,wNAM,wPRM,wCOM,wIML,0 ; C7 MOV r/m, MSB LSB
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; C8 NO COMMAND
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; C9 NO COMMAND
db 40h, rBIT,001h,rILM,wNAM,wIML, 0h, 0h, 0h,0 ; CA RETF MSB LSB
db 40h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; CB RETF
db 1Ch, rBIT,030h,wNAM,sSPC, 0h, 0h, 0h, 0h,0 ; CC INT 3
db 1Ch, rBIT,000h,rILM,wNAM,wIML, 0h, 0h, 0h,0 ; CD INT number
db 1Dh, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; CE INTO
db 1Eh, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; CF IRET
db 00h, rBIT,008h,rMWN,wNAM,wROM,wCOM,sSPC, 0h,0 ; D0 Comm depends on code Byte
db 00h, rBIT,009h,rMWN,wNAM,wROM,wCOM,sSPC, 0h,0 ; D1 Comm depends on code Word
db 00h, rBIT,058h,rMWN,wNAM,wROM,wCOM,sSPC, 0h,0 ; D2 Comm depends on code Byte
db 00h, rBIT,059h,rMWN,wNAM,wROM,wCOM,sSPC, 0h,0 ; D3 Comm depends on code Word
db 03h, rOFF,wNAM, 0h, 0h, 0h, 0h, 0h, 0h,0 ; D4 AAM
db 02h, rOFF,wNAM, 0h, 0h, 0h, 0h, 0h, 0h,0 ; D5 AAD
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; D6 NO COMMAND
db 65h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; D7 XLAT
db 16h, rBIT,000h,rMWR,wNAM,sESC,000h,wCOM,wROM,0 ; D8 ESC hex(000 yyy), r/m
db 16h, rBIT,000h,rMWR,wNAM,sESC,001h,wCOM,wROM,0 ; D9 ESC hex(001 yyy), r/m
db 16h, rBIT,000h,rMWR,wNAM,sESC,002h,wCOM,wROM,0 ; DA ESC hex(010 yyy), r/m
db 16h, rBIT,000h,rMWR,wNAM,sESC,003h,wCOM,wROM,0 ; DB ESC hex(011 yyy), r/m
db 16h, rBIT,000h,rMWR,wNAM,sESC,004h,wCOM,wROM,0 ; DC ESC hex(100 yyy), r/m
db 16h, rBIT,000h,rMWR,wNAM,sESC,005h,wCOM,wROM,0 ; DD ESC hex(101 yyy), r/m
db 16h, rBIT,000h,rMWR,wNAM,sESC,006h,wCOM,wROM,0 ; DE ESC hex(110 yyy), r/m
db 16h, rBIT,000h,rMWR,wNAM,sESC,007h,wCOM,wROM,0 ; DF ESC hex(111 yyy), r/m
db 3Ah, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; E0 LOOPNE IP+offset
db 39h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; E1 LOOPE IP+offset
db 38h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; E2 LOOP IP+offset
db 21h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; E3 JCXZ IP+offset
db 1Ah, rBIT,000h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; E4 IN AL, port
db 1Ah, rBIT,020h,rILM,wNAM,sSPC,wCOM,wIML, 0h,0 ; E5 IN AX, port
db 43h, rBIT,000h,rILM,wNAM,wACC,wCOM,wIML, 0h,0 ; E6 OUT AL, port
db 43h, rBIT,020h,rILM,wNAM,sSPC,wCOM,wIML, 0h,0 ; E7 OUT AX, port
db 08h, rBIT,001h,rILM,wNAM,sIPI, 0h, 0h, 0h,0 ; E8 CALL MSB LSB
db 25h, rBIT,001h,rILM,wNAM,sIPI, 0h, 0h, 0h,0 ; E9 JMP MSB LSB
db 25h, rBIT,001h,rALM,rILM,wNAM,sIAM, 0h, 0h,0 ; EA JMP MSB LSB:AMSB ALSB
db 25h, rOFF,wNAM,wIPO, 0h, 0h, 0h, 0h, 0h,0 ; EB JMP IP+offset
db 1Ah, rBIT,000h,wNAM,wACC,wCOM,rBIT,021h,wREG,0 ; EC IN AL, DX
db 1Ah, rBIT,021h,wNAM,wACC,wCOM,wREG, 0h, 0h,0 ; ED IN AX, DX
db 43h, rBIT,000h,wNAM,wACC,wCOM,rBIT,021h,wREG,0 ; EE OUT AL, DX
db 43h, rBIT,021h,wNAM,wACC,wCOM,wREG, 0h, 0h,0 ; EF OUT AX, DX
db 35h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; F0 LOCK
db 00h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; F1 NO COMMAND
db 4Bh, rOFF,wNAM,sREP,wNAM, 0h, 0h, 0h, 0h,0 ; F2 REPNE
db 4Ah, rOFF,wNAM,sREP,wNAM, 0h, 0h, 0h, 0h,0 ; F3 REP
db 17h, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; F4 HLT
db 0Dh, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; F5 CMC
db 00h, rBIT,004h,rMWN,sEXT, 0h, 0h, 0h, 0h,0 ; F6 Comm depends on code Byte
db 00h, rBIT,005h,rMWN,sEXT, 0h, 0h, 0h, 0h,0 ; F7 Comm depends on code Word
db 0Ah, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; F8 CLC
db 5Ch, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; F9 STC
db 0Ch, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; FA CLI
db 5Eh, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; FB STI
db 0Bh, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; FC CLD
db 5Dh, wNAM, 0h, 0h, 0h, 0h, 0h, 0h, 0h,0 ; FD STD
db 00h, rBIT,000h,rMWN,sEXT, 0h, 0h, 0h, 0h,0 ; FE Comm depends on code Byte
db 00h, rBIT,041h,rMWN,sEXT, 0h, 0h, 0h, 0h,0 ; FF Comm depends on code Word
extCodes db wNAM,wROM, 0h, 0h, 0h,0 ; 000
db wNAM,wROM, 0h, 0h, 0h,0 ; 001
db wNAM,wROM, 0h, 0h, 0h,0 ; 010
db wNAM,sSPC,wROM, 0h, 0h,0 ; 011
db wNAM,wROM, 0h, 0h, 0h,0 ; 100
db wNAM,sSPC,wROM, 0h, 0h,0 ; 101
db wNAM,wROM, 0h, 0h, 0h,0 ; 110
db 0h, 0h, 0h, 0h, 0h,0 ; 111
db rILM,wNAM,wPRM,wCOM,wIML,0 ; 000
db 0h, 0h, 0h, 0h, 0h,0 ; 001
db wNAM,wROM, 0h, 0h, 0h,0 ; 010
db wNAM,wROM, 0h, 0h, 0h,0 ; 011
db wNAM,wROM, 0h, 0h, 0h,0 ; 100
db wNAM,wROM, 0h, 0h, 0h,0 ; 101
db wNAM,wROM, 0h, 0h, 0h,0 ; 110
db wNAM,wROM, 0h, 0h, 0h,0 ; 111
|
oeis/315/A315399.asm | neoneye/loda-programs | 11 | 162204 | <reponame>neoneye/loda-programs
; A315399: Coordination sequence Gal.4.43.4 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by <NAME>
; 1,6,11,15,19,23,27,32,38,44,49,53,57,61,65,70,76,82,87,91,95,99,103,108,114,120,125,129,133,137,141,146,152,158,163,167,171,175,179,184,190,196,201,205,209,213,217,222,228,234
mov $5,$0
mul $0,2
add $0,6
mov $3,3
mov $4,3
lpb $0
mov $2,$0
sub $2,10
add $3,6
add $4,6
trn $2,$4
add $2,$3
mov $0,$2
lpe
sub $0,6
trn $0,1
lpb $5
add $0,4
sub $5,1
lpe
add $0,1
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_811.asm | ljhsiun2/medusa | 9 | 85751 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r15
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x58b5, %rsi
lea addresses_A_ht+0xeb5, %rdi
nop
dec %r11
mov $78, %rcx
rep movsl
sub %rax, %rax
lea addresses_D_ht+0x1225d, %rsi
lea addresses_D_ht+0x104b5, %rdi
clflush (%rsi)
nop
nop
add %r13, %r13
mov $40, %rcx
rep movsb
nop
nop
nop
nop
nop
xor $14458, %rsi
lea addresses_WT_ht+0xf0b5, %rsi
nop
nop
nop
nop
nop
cmp $47933, %r15
mov (%rsi), %ecx
nop
nop
nop
add %r13, %r13
lea addresses_A_ht+0x8b5, %rsi
nop
nop
nop
nop
add %rcx, %rcx
movb (%rsi), %al
nop
nop
sub %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_PSE+0x2b5, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
cmp $12793, %r9
mov $0x5152535455565758, %rdx
movq %rdx, (%rdi)
nop
nop
nop
add %rbp, %rbp
// Faulty Load
lea addresses_A+0x78b5, %rdx
clflush (%rdx)
nop
nop
nop
nop
add %rax, %rax
movups (%rdx), %xmm7
vpextrq $0, %xmm7, %rbp
lea oracles, %rsi
and $0xff, %rbp
shlq $12, %rbp
mov (%rsi,%rbp,1), %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 8}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}, 'dst': {'same': True, 'congruent': 8, 'type': 'addresses_A_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 10}}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
|
data/baseStats/parasect.asm | adhi-thirumala/EvoYellow | 16 | 174805 | <filename>data/baseStats/parasect.asm
db DEX_PARASECT ; pokedex id
db 60 ; base hp
db 95 ; base attack
db 80 ; base defense
db 30 ; base speed
db 80 ; base special
db BUG ; species type 1
db GRASS ; species type 2
db 47 ; catch rate
db 128 ; base exp yield
INCBIN "pic/ymon/parasect.pic",0,1 ; 77, sprite dimensions
dw ParasectPicFront
dw ParasectPicBack
; attacks known at lvl 0
db SCRATCH
db STUN_SPORE
db LEECH_LIFE
db 0
db 0 ; growth rate
; learnset
tmlearn 3,6,8
tmlearn 9,10,15
tmlearn 20,21,22
tmlearn 28,31,32
tmlearn 33,34,40
tmlearn 44
tmlearn 50,51
db BANK(ParasectPicFront)
|
Testing-File/Test_Ex15.asm | srsarangi/riscv-emulator | 0 | 164236 | <reponame>srsarangi/riscv-emulator
@Assembly Program to print 10 multiples of 9
.main:
addi x1, x0, 9
addi x2, x0, 1
addi x3, x0, 11
.loop:
mul x4, x1, x2
.print x4
addi x2, x2, 1
bne x2, x3, .loop
end |
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0xca_notsx.log_21829_28.asm | ljhsiun2/medusa | 9 | 85078 | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r15
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0xa561, %r15
nop
nop
nop
nop
sub %rdx, %rdx
movw $0x6162, (%r15)
nop
nop
sub $19255, %rax
lea addresses_UC_ht+0x1cceb, %rsi
nop
nop
nop
nop
sub %r13, %r13
mov $0x6162636465666768, %r12
movq %r12, %xmm7
movups %xmm7, (%rsi)
nop
nop
nop
sub %rdx, %rdx
lea addresses_A_ht+0x16a87, %rdx
sub %rax, %rax
mov $0x6162636465666768, %r15
movq %r15, (%rdx)
nop
nop
nop
nop
nop
inc %rax
lea addresses_D_ht+0x11799, %r12
nop
nop
nop
nop
nop
cmp $26131, %rsi
movb (%r12), %al
nop
nop
dec %r13
lea addresses_A_ht+0xfa27, %r15
nop
cmp $15785, %r13
movb $0x61, (%r15)
nop
nop
nop
inc %rsi
lea addresses_WC_ht+0x154a7, %rdx
nop
nop
and $6848, %r13
movups (%rdx), %xmm3
vpextrq $0, %xmm3, %r15
nop
nop
nop
xor %r12, %r12
lea addresses_WT_ht+0x17da7, %rsi
lea addresses_D_ht+0x14e27, %rdi
clflush (%rsi)
and %rbp, %rbp
mov $76, %rcx
rep movsq
nop
nop
nop
nop
and %r12, %r12
lea addresses_WC_ht+0x1c027, %rsi
lea addresses_WT_ht+0xce87, %rdi
clflush (%rsi)
add %r15, %r15
mov $52, %rcx
rep movsq
nop
nop
nop
nop
nop
cmp $31530, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r15
push %r9
push %rax
push %rbp
push %rsi
// Store
lea addresses_UC+0x18ccf, %r14
nop
nop
nop
nop
nop
add %r15, %r15
movb $0x51, (%r14)
nop
add $35063, %r14
// Store
lea addresses_normal+0xfd1f, %rax
nop
nop
nop
nop
nop
cmp $40009, %r10
movw $0x5152, (%rax)
nop
nop
nop
add %rax, %rax
// Store
mov $0x527, %r14
nop
cmp $58464, %rbp
mov $0x5152535455565758, %r15
movq %r15, %xmm1
vmovups %ymm1, (%r14)
nop
nop
nop
add $16612, %rbp
// Store
lea addresses_D+0x1a227, %r9
add %r15, %r15
movl $0x51525354, (%r9)
nop
nop
nop
nop
nop
cmp $37058, %r14
// Store
lea addresses_PSE+0x1e027, %rsi
cmp $34846, %r15
mov $0x5152535455565758, %r10
movq %r10, (%rsi)
nop
nop
xor $37273, %r10
// Store
mov $0x78904600000005a3, %rax
xor $22036, %rbp
mov $0x5152535455565758, %r14
movq %r14, %xmm4
movups %xmm4, (%rax)
nop
nop
add %rsi, %rsi
// Faulty Load
lea addresses_D+0x1a227, %rsi
nop
nop
xor %rbp, %rbp
mov (%rsi), %eax
lea oracles, %r15
and $0xff, %rax
shlq $12, %rax
mov (%r15,%rax,1), %rax
pop %rsi
pop %rbp
pop %rax
pop %r9
pop %r15
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_UC', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_normal', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_P', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_PSE', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_NC', 'size': 16, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': True, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}}
{'54': 21829}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
|
Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xca.log_21829_918.asm | ljhsiun2/medusa | 9 | 83138 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %r9
push %rax
push %rbp
push %rcx
lea addresses_D_ht+0xbd7e, %rbp
nop
nop
nop
nop
nop
xor $51855, %r13
movw $0x6162, (%rbp)
nop
sub %r9, %r9
lea addresses_WC_ht+0x155fe, %rcx
nop
add %rax, %rax
movl $0x61626364, (%rcx)
nop
nop
nop
nop
nop
cmp %rbp, %rbp
lea addresses_A_ht+0x10d1e, %rbp
cmp %r11, %r11
mov (%rbp), %r9w
nop
nop
nop
nop
nop
dec %rcx
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r8
push %r9
push %rbp
push %rbx
push %rdi
// Store
mov $0xc7e, %rbx
nop
nop
dec %r8
movb $0x51, (%rbx)
xor $25790, %r12
// Faulty Load
lea addresses_RW+0x207e, %r9
nop
nop
sub $48429, %r10
mov (%r9), %bp
lea oracles, %r8
and $0xff, %rbp
shlq $12, %rbp
mov (%r8,%rbp,1), %rbp
pop %rdi
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_RW', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_P', 'same': False, 'AVXalign': False, 'congruent': 9}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_RW', 'same': True, 'AVXalign': True, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': True, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_A_ht', 'same': True, 'AVXalign': True, 'congruent': 4}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
oeis/318/A318961.asm | neoneye/loda-programs | 11 | 8847 | <reponame>neoneye/loda-programs<filename>oeis/318/A318961.asm<gh_stars>10-100
; A318961: One of the two successive approximations up to 2^n for 2-adic integer sqrt(-7). This is the 3 (mod 4) case.
; Submitted by <NAME>
; 3,3,11,11,11,75,75,331,843,1867,3915,8011,16203,16203,16203,81739,212811,474955,474955,474955,2572107,6766411,6766411,23543627,57098059,57098059,57098059,57098059,593968971,1667710795,1667710795,1667710795,1667710795,18847579979,53207318347,121926795083,121926795083,121926795083,671682608971,671682608971,671682608971,5069729120075,5069729120075,5069729120075,5069729120075,75438473297739,75438473297739,356913450008395,919863403429707,919863403429707,3171663217114955,3171663217114955
mov $1,2
mov $2,2
lpb $0
sub $0,1
mul $1,2
pow $2,2
add $2,2
mod $2,$1
lpe
mov $0,$2
mul $0,2
sub $0,1
|
src/hott/level/sets/core.agda | pcapriotti/agda-base | 20 | 16090 | <filename>src/hott/level/sets/core.agda
{-# OPTIONS --without-K #-}
module hott.level.sets.core where
open import sum
open import equality.core
open import sets.unit
open import sets.empty
open import hott.level.core
⊤-contr : ∀ {i} → contr (⊤ {i})
⊤-contr = tt , λ { tt → refl }
⊥-prop : ∀ {i} → h 1 (⊥ {i})
⊥-prop x _ = ⊥-elim x
|
tests/messages-test_data-tests-messages_container.ads | thindil/steamsky | 80 | 27329 | <reponame>thindil/steamsky
package Messages.Test_Data.Tests.Messages_Container is
end Messages.Test_Data.Tests.Messages_Container;
|
programs/oeis/157/A157670.asm | neoneye/loda | 22 | 160142 | ; A157670: a(n) = 531441*n^2 - 322218*n + 48842.
; 258065,1530170,3865157,7263026,11723777,17247410,23833925,31483322,40195601,49970762,60808805,72709730,85673537,99700226,114789797,130942250,148157585,166435802,185776901,206180882,227647745,250177490,273770117,298425626,324144017,350925290,378769445,407676482,437646401,468679202,500774885,533933450,568154897,603439226,639786437,677196530,715669505,755205362,795804101,837465722,880190225,923977610,968827877,1014741026,1061717057,1109755970,1158857765,1209022442,1260250001,1312540442,1365893765,1420309970,1475789057,1532331026,1589935877,1648603610,1708334225,1769127722,1830984101,1893903362,1957885505,2022930530,2089038437,2156209226,2224442897,2293739450,2364098885,2435521202,2508006401,2581554482,2656165445,2731839290,2808576017,2886375626,2965238117,3045163490,3126151745,3208202882,3291316901,3375493802,3460733585,3547036250,3634401797,3722830226,3812321537,3902875730,3994492805,4087172762,4180915601,4275721322,4371589925,4468521410,4566515777,4665573026,4765693157,4866876170,4969122065,5072430842,5176802501,5282237042
seq $0,157669 ; a(n) = 19683*n - 5967.
pow $0,2
sub $0,188128656
div $0,531441
mul $0,729
add $0,258065
|
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_21829_65.asm | ljhsiun2/medusa | 9 | 240775 | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r15
push %rbx
push %rcx
// Faulty Load
lea addresses_WT+0xb922, %r11
nop
add $47160, %r12
mov (%r11), %rcx
lea oracles, %r12
and $0xff, %rcx
shlq $12, %rcx
mov (%r12,%rcx,1), %rcx
pop %rcx
pop %rbx
pop %r15
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': True, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
alloy4fun_models/trashltl/models/5/Sai5yddEch6sXbkdX.als | Kaixi26/org.alloytools.alloy | 0 | 3715 | open main
pred idSai5yddEch6sXbkdX_prop6 {
eventually some t:Trash | always t in Trash
}
pred __repair { idSai5yddEch6sXbkdX_prop6 }
check __repair { idSai5yddEch6sXbkdX_prop6 <=> prop6o } |
oeis/325/A325911.asm | neoneye/loda-programs | 11 | 178381 | ; A325911: Screaming numbers in base 16: numbers that have hexadecimal representation of AAAAAAA...
; Submitted by <NAME>
; 10,170,2730,43690,699050,11184810,178956970,2863311530,45812984490,733007751850,11728124029610,187649984473770,3002399751580330,48038396025285290,768614336404564650,12297829382473034410,196765270119568550570,3148244321913096809130,50371909150609548946090,805950546409752783137450,12895208742556044530199210,206323339880896712483187370,3301173438094347399730997930,52818775009509558395695966890,845100400152152934331135470250,13521606402434446949298167524010,216345702438951151188770680384170
mov $1,16
pow $1,$0
mov $0,$1
div $0,15
mul $0,16
add $0,1
mul $0,10
|
libsrc/math/mbf32/c/asm/___mbf32_LOG.asm | jpoikela/z88dk | 640 | 14486 | SECTION code_fp_mbf32
PUBLIC ___mbf32_LOG
EXTERN LOG
defc ___mbf32_LOG = LOG
|
ecdsa128/src/GFp_src/src/submod.asm | FloydZ/Crypto-Hash | 11 | 244234 | .686p
.mmx
.model flat,stdcall
option casemap:none
option prologue:none
option epilogue:none
extern __mod:DWORD
.code
submod proc ptrA:DWORD, ptrB:DWORD, ptrC:DWORD
;a-b=c mod __mod
pushad
mov esi, dword ptr [esp+20h+4]
mov edi, dword ptr [esp+20h+8]
mov ebp, dword ptr [esp+20h+12]
mov eax, dword ptr [esi ]
mov ebx, dword ptr [esi+ 4]
mov ecx, dword ptr [esi+ 8]
mov edx, dword ptr [esi+12]
sub eax, dword ptr [edi ]
sbb ebx, dword ptr [edi+ 4]
sbb ecx, dword ptr [edi+ 8]
sbb edx, dword ptr [edi+12]
jnc @F
add eax, dword ptr [__mod ]
adc ebx, dword ptr [__mod+ 4]
adc ecx, dword ptr [__mod+ 8]
adc edx, dword ptr [__mod+12]
@@: mov dword ptr [ebp ], eax
mov dword ptr [ebp+ 4], ebx
mov dword ptr [ebp+ 8], ecx
mov dword ptr [ebp+12], edx
popad
ret 12
submod endp
end |
src/kernel/start.asm | DrDeano/DeanOS | 6 | 23547 | [bits 32]
[section .text]
[global start_kernel]
extern kernel_main
start_kernel:
jmp long kernel_main
halt:
cli
hlt
jmp halt |
nicolai/thesis/Deltaplus.agda | nicolaikraus/HoTT-Agda | 1 | 16621 | <reponame>nicolaikraus/HoTT-Agda
{-# OPTIONS --without-K #-}
module Deltaplus where
{- Chapter 9.2: Semi-Simplicial Types
This file contains the definition of the index category
for semi-simplicial with judgmental categorical laws: Δ₊
In other words, we check Proposition 9.2.1.
We want to keep it independent of the other files,
so we do not import anything. -}
{- For simplicity, we only use the lowest universe
(totally sufficient) -}
Type = Set
-- the empty type
data Empty : Type where
-- the unit type
data ⊤ : Type where
* : ⊤
-- the natural numbers
data ℕ : Type where
O : ℕ
S : (n : ℕ) → ℕ
{- Finite types: these are the
=== OBJECTS of Δ₊ ===
-}
data Fin : ℕ → Type where
fz : {n : ℕ} → Fin (S n)
fs : {n : ℕ} → Fin n → Fin (S n)
-- >-relation on finite types
_>fin_ : {n : ℕ} → (i j : Fin n) → Set
fz >fin i = Empty
fs j >fin fz = ⊤
fs j >fin fs i = j >fin i
{- the proposition [we do not need to prove propositionality here, but
we could prove it easily] that a function is increasing;
this is the tricky part: it needs to be done in a way which ensures
that composition will behave nicely (strictly associative etc) later -}
is-increasing : {m n : ℕ} → (Fin m → Fin n) → Type
is-increasing {m} {n} f = {j i : Fin m} → (j >fin i) → ((f j) >fin (f i))
infixr 1 _,_
record Σ (A : Type) (B : A → Type) : Type where
constructor _,_
field
fst : A
snd : B fst
{- Strictly increasing maps: these are the
=== MORPHISMS of Δ₊ ===
-}
_⇒+_ : ℕ → ℕ → Set
m ⇒+ n = Σ (Fin m → Fin n) is-increasing
_∘+_ : {l m n : ℕ} → (m ⇒+ n) → (l ⇒+ m) → (l ⇒+ n)
(g , p₂) ∘+ (f , p₁) = (λ i → g(f(i))) , (λ p → p₂ (p₁ p))
-- === IDENTITY MORPHISMS of Δ₊ ===
idΔ₊ : ∀ {n} → n ⇒+ n
idΔ₊ = (λ x → x) , (λ p → p)
{- Now, let us check that the categorical laws hold judgmentally.
To do this, we use the usual notion of equality. -}
infix 3 _==_
data _==_ {A : Type} (a : A) : A → Type where
idp : a == a
-- === IDENTITY LAWS ===
id-comp : ∀ {m n} → (f : m ⇒+ n) → (idΔ₊ ∘+ f) == f
id-comp f = idp
comp-id : ∀ {m n} → (f : m ⇒+ n) → (f ∘+ idΔ₊) == f
comp-id f = idp
-- === ASSOCIATIVITY LAW ===
comp-assoc : ∀ {i j m n} → (f : i ⇒+ j) → (g : j ⇒+ m) → (h : m ⇒+ n)
→ h ∘+ (g ∘+ f) == (h ∘+ g) ∘+ f
comp-assoc f g h = idp
|
test/Fail/Issue3157.agda | shlevy/agda | 1,989 | 7963 |
variable
X : Set
postulate
foo : ∀ A -> X -- error at `src/full/Agda/TypeChecking/Monad/MetaVars.hs:98`
-- expected: `{X : Set} -> _1 -> X`
Y : Set
bar : ∀ A -> Y -- normal `_1 -> Y` type with unsolved metavar
|
Task/Vector-products/Ada/vector-products.ada | mullikine/RosettaCodeData | 1 | 8498 | <gh_stars>1-10
with Ada.Text_IO;
procedure Vector is
type Float_Vector is array (Positive range <>) of Float;
package Float_IO is new Ada.Text_IO.Float_IO (Float);
procedure Vector_Put (X : Float_Vector) is
begin
Ada.Text_IO.Put ("(");
for I in X'Range loop
Float_IO.Put (X (I), Aft => 1, Exp => 0);
if I /= X'Last then
Ada.Text_IO.Put (", ");
end if;
end loop;
Ada.Text_IO.Put (")");
end Vector_Put;
-- cross product
function "*" (Left, Right : Float_Vector) return Float_Vector is
begin
if Left'Length /= Right'Length then
raise Constraint_Error with "vectors of different size in dot product";
end if;
if Left'Length /= 3 then
raise Constraint_Error with "dot product only implemented for R**3";
end if;
return Float_Vector'(Left (Left'First + 1) * Right (Right'First + 2) -
Left (Left'First + 2) * Right (Right'First + 1),
Left (Left'First + 2) * Right (Right'First) -
Left (Left'First) * Right (Right'First + 2),
Left (Left'First) * Right (Right'First + 1) -
Left (Left'First + 1) * Right (Right'First));
end "*";
-- scalar product
function "*" (Left, Right : Float_Vector) return Float is
Result : Float := 0.0;
I, J : Positive;
begin
if Left'Length /= Right'Length then
raise Constraint_Error with "vectors of different size in scalar product";
end if;
I := Left'First; J := Right'First;
while I <= Left'Last and then J <= Right'Last loop
Result := Result + Left (I) * Right (J);
I := I + 1; J := J + 1;
end loop;
return Result;
end "*";
-- stretching
function "*" (Left : Float_Vector; Right : Float) return Float_Vector is
Result : Float_Vector (Left'Range);
begin
for I in Left'Range loop
Result (I) := Left (I) * Right;
end loop;
return Result;
end "*";
A : constant Float_Vector := (3.0, 4.0, 5.0);
B : constant Float_Vector := (4.0, 3.0, 5.0);
C : constant Float_Vector := (-5.0, -12.0, -13.0);
begin
Ada.Text_IO.Put ("A: "); Vector_Put (A); Ada.Text_IO.New_Line;
Ada.Text_IO.Put ("B: "); Vector_Put (B); Ada.Text_IO.New_Line;
Ada.Text_IO.Put ("C: "); Vector_Put (C); Ada.Text_IO.New_Line;
Ada.Text_IO.New_Line;
Ada.Text_IO.Put ("A dot B = "); Float_IO.Put (A * B, Aft => 1, Exp => 0);
Ada.Text_IO.New_Line;
Ada.Text_IO.Put ("A x B = "); Vector_Put (A * B);
Ada.Text_IO.New_Line;
Ada.Text_IO.Put ("A dot (B x C) = "); Float_IO.Put (A * (B * C), Aft => 1, Exp => 0);
Ada.Text_IO.New_Line;
Ada.Text_IO.Put ("A x (B x C) = "); Vector_Put (A * Float_Vector'(B * C));
Ada.Text_IO.New_Line;
end Vector;
|
examples/fread.asm | Benderx2/FVM | 2 | 174160 | include 'a32.inc'
_start:
LOAD_R0 file_name ; file name
VM_CALL 0x5 ; fopen
LOAD_R1 3 ; Length
LOAD_R2 file_string ; the file name
VM_CALL 0x7 ; Call the fread()
LOAD_R0 file_string
.loopy:
LOAD_BYTE
CMPR R1, 0
JMPF_E .endp
VM_CALL 0x0
JMPF .loopy
.endp:
VM_EXIT
_end_start:
_data:
file_name: db './FILE.TXT', 0
file_string: times 10 db 0
db 0
_end_data:
_bss:
_end_bss:
|
test/Fail/UnequalHiding.agda | cruhland/agda | 1,989 | 946 |
module UnequalHiding where
data One : Set where one : One
f : ({A : Set} -> A -> A) -> One
f = \(id : (A : Set) -> A -> A) -> id One one
|
programs/oeis/064/A064989.asm | jmorken/loda | 1 | 2662 | ; A064989 o=1: Multiplicative with a(2^e) = 1 and a(p^e) = prevprime(p)^e for odd primes p.
; Coded manually 2021-02-28 by <NAME>, https://github.com/karttu
;
; Note that A064989(n) <= n, and in this version also all the intermediate results also are <= n,
; which means that if n is in the valid (positive?) range of the LODA-machine, then a(n) should also be.
;
; A few derived sequences: A064216(n) = A064989(2n-1), A108951(n) = n * A108951(A064989(n)).
; Also A252463(n) = n/2 if n is even, A252463(n) = A064989(n) if n is odd.
;
add $0,1 ; Add one, because A064989 is offset=1 sequence.
mov $1,1 ; Initialize the result-register, the result (which is a product) is constructed into this.
mov $2,2 ; This is the smallest prime-divisor we have encountered so far.
mov $4,1
lpb $0 ; Start the main loop. We stop when there's nothing remaining in $0 anymore. Guaranteed to decrease on every iteration.
mul $1,$4 ; Multiply m by ($2-1) of the previous iteration (and by 1 on the first iteration).
mov $3,$0 ; What's remaining of $0 is safe upper limit for finding its smallest prime factor.
lpb $3 ; Which is done in this subloop: find the next prime >= $2 that divides $0, which = A020639($0).
mov $4,$0
mod $4,$2
cmp $4,0
cmp $4,0
sub $3,$4 ; Subtract one if $2 did not divide n (to continue searching), otherwise subtract zero, and fall out of the loop.
add $2,1 ; Note: when we fall out, the last instance of this incrementing is discarded, and we still have the spf-divisor in $2
lpe
; Now for $0 > 0, we have lpf = A020639(n) in $2.
div $0,$2 ; Divide one instance of that (current) smallest prime factor out of $0.
mov $4,$2
mov $5,$2
lpb $5 ; Then search the first noncomposite < $2 in this naive little loop.
sub $4,1
mov $6,$4
sub $6,1
lpb $6 ; That contains another naive loop for the primality check. Check whether gcd($4,k) = 1 for all k = 1..($4-1).
mov $7,$4
gcd $7,$6
cmp $7,1
sub $6,$7
lpe
cmp $6,0
cmp $6,0 ; Now $6 = 0 only if $4 is either a prime or 1.
sub $5,$6 ; Fall out if $6 is 0 now, that is, if we found the previous prime (or 1).
lpe
sub $4,1 ; Compensate for the lost iteration.
; The previous prime (or 1) should be now located in $4, so at (top of) the next iteration of the main loop it will be multiplied to the product.
lpe
; The result is now in $1.
|
src/fx/dotscroller.asm | bitshifters/teletextr | 8 | 20184 |
; quick & dirty dot scroller
; written to try out Simon's fast PLOT_PIXEL macro
; was thinking about a fixed position (sparse) sprite plot routine for interesting scrollers
; but figured I would get it working with dots first to see if I like it
; now uses own font (pre-rotated) but currently takes up 3 pages (96 characters)
; entire dot map can be moved at runtime by updating cx, cy but that isn't required can optimise out
.start_fx_dotscroller
_DOTSCROLL_SMOOTH = FALSE ; don't like this effect
_DOTSCROLL_BALL = FALSE ; not compatible with _SMOOTH!
_DOTSCROLL_ANGLE = FALSE ; otherwise half circle
\\ Definitions
DOTSCROLL_shadow_addr = &7800
DOTSCROLL_num_columns = 32
DOTSCROLL_num_rows = 8
DOTSCROLL_cols_per_glyph = 8
\\ Dots are defined in this space
DOTSCROLL_dot_centre_x = 128
DOTSCROLL_dot_centre_y = 128
\\ Transformed into teletext pixel space
DOTSCROLL_screen_centre_x = 38
DOTSCROLL_screen_centre_y = 36 ; row 12
\\ Clamping / clipping coordinates
DOTSCROLL_dot_left_clip = DOTSCROLL_dot_centre_x - DOTSCROLL_screen_centre_x
DOTSCROLL_dot_right_clip = DOTSCROLL_dot_centre_x + DOTSCROLL_screen_centre_x
DOTSCROLL_dot_top_clip = DOTSCROLL_dot_centre_y - DOTSCROLL_screen_centre_y ; odd number of pixels vertically
DOTSCROLL_dot_bottom_clip = DOTSCROLL_dot_centre_y + 29 ; ignore bottom 3 lines for reflection
\ ******************************************************************
\ * Dotscroller Plot FX
\ ******************************************************************
.fx_dotscroller_byte
EQUB 0
.fx_dotscroller_cx ; 0 = centre of screen, -ve left, +ve right
EQUB 0
.fx_dotscroller_cy ; 0 = centre of screen, -ve up, +ve down
IF _DOTSCROLL_BALL
EQUB 10
ELSE
IF _DOTSCROLL_ANGLE
EQUB 0
ELSE
EQUB 28
ENDIF
ENDIF
\\ Bits in A, column# in X
.fx_dotscroller_plot_column
\\{
STA fx_dotscroller_byte
\\ X column to table index
TXA
ASL A: ASL A: ASL A
TAX
\\ How many times round the loop?
.fx_dotscroller_plot_column_loop
LDA fx_dotscroller_byte
BEQ fx_dotscroller_plot_column_return
ASL A ; I planned this to be the other way up but fine for now!
STA fx_dotscroller_byte
BCC fx_dotscroller_plot_column_skip_plot
STX fx_dotscroller_plot_column_temp_x+1
.fx_dotscroller_plot_column_table_x
LDA fx_dotscroll_x, X
.fx_dotscroller_plot_column_table_y
LDY fx_dotscroll_y, X
TAX
\\ New centre / offset
\\ Could remove this if not going to animte dot scroller
{
TXA
CLC
ADC fx_dotscroller_cx
TAX
TYA
CLC
ADC fx_dotscroller_cy
TAY
}
\\ Clamping
\\ Could also clip and not draw if out of bounds
{
CPX #DOTSCROLL_dot_left_clip
BCS left_ok
LDX #DOTSCROLL_dot_left_clip
.left_ok
CPX #DOTSCROLL_dot_right_clip
BCC right_ok
LDX #DOTSCROLL_dot_right_clip
.right_ok
CPY #DOTSCROLL_dot_top_clip
BCS top_ok
LDY #DOTSCROLL_dot_top_clip
.top_ok
CPY #DOTSCROLL_dot_bottom_clip
BCC bottom_ok
LDY #DOTSCROLL_dot_bottom_clip
.bottom_ok
}
\\ Adjust to screen
\\ Could remove this if not going to animte dot scroller
{
TXA
SEC
SBC #(DOTSCROLL_dot_centre_x - DOTSCROLL_screen_centre_x)
TAX
TYA
SEC
SBC #(DOTSCROLL_dot_centre_y - DOTSCROLL_screen_centre_y)
TAY
}
\\ Plot that pixel, yo!
{
PLOT_PIXEL
}
.fx_dotscroller_plot_column_temp_x
LDX #0
.fx_dotscroller_plot_column_skip_plot
INX
BNE fx_dotscroller_plot_column_loop
.fx_dotscroller_plot_column_return
RTS
\\}
\ ******************************************************************
\ * Dotscroller Scroll FX
\ ******************************************************************
.fx_dotscroller_set_text
{
STX fx_dotscroller_ptr
STY fx_dotscroller_ptr+1
LDA 0
STA fx_dotscroller_char_idx
STA fx_dotscroller_col_idx
RTS
}
MACRO FX_DOTSCROLLER_SET_FN text_string
{
LDX #LO(text_addr):LDY #HI(text_addr):JMP fx_dotscroller_set_text
.text_addr EQUS text_string, 0 ; sadly MACROs don't like text parameters :(
}
ENDMACRO
IF 0
.fx_dotscroller_set_text_3d
{
LDX #LO(text_addr):LDY #HI(text_addr):JMP fx_dotscroller_set_text
.text_addr EQUS " HOW ABOUT SOME 3D SHAPES? ", 0
}
.fx_dotscroller_set_text_vb
{
LDX #LO(text_addr):LDY #HI(text_addr):JMP fx_dotscroller_set_text
.text_addr EQUS " VECTORBALLS IN TELETEXT?! ", 0
}
.fx_dotscroller_set_text_part
{
LDX #LO(text_addr):LDY #HI(text_addr):JMP fx_dotscroller_set_text
.text_addr EQUS " PARTICLES ON A BEEB? SURE! ", 0
}
.fx_dotscroller_set_text_int
{
LDX #LO(text_addr):LDY #HI(text_addr):JMP fx_dotscroller_set_text
.text_addr EQUS " OLD SCHOOL INTERFERENCE FTW! ", 0
}
.fx_dotscroller_set_text_rot
{
LDX #LO(text_addr):LDY #HI(text_addr):JMP fx_dotscroller_set_text
.text_addr EQUS " ROTOZOOM!!... ", 0
}
.fx_dotscroller_set_text_pl
{
LDX #LO(text_addr):LDY #HI(text_addr):JMP fx_dotscroller_set_text
.text_addr EQUS " GOTTA HAVE SOME PLASMA ", 0
}
\\ NB. Can only have 255 characters max at the moment
.fx_dotscroller_msg
EQUS "HELLO WORLD! THIS IS A DOT SCROLLER WHICH IS SOMEWHAT UNREADABLE BUT BETTER IN UPPERCASE!... 0123456789 "
EQUB 0
ENDIF
.fx_dotscroller_set_text_hello
{
LDX #LO(text_addr):LDY #HI(text_addr):JMP fx_dotscroller_set_text
.text_addr EQUS " HELLO TO EVERYONE AT THE PARTY!! ", 0
}
.fx_dotscroller_char_idx
EQUB 0
.fx_dotscroller_cur_col ; temp during fn
EQUB 0
.fx_dotscroller_col_idx
EQUB 0
.fx_dotscroller_update
{
lda #144+7
ldx #0
jsr mode7_set_column_shadow_fast
\\ Update the centre of our dots
IF _DOTSCROLL_BALL
JSR fx_dotscroller_bounce_centre
ENDIF
\\ Do the scroll text bit
LDA fx_dotscroller_char_idx
STA char_idx + 1
IF _DOTSCROLL_SMOOTH
LDA fx_dotscroller_col_idx
LSR A
STA first_col + 1
BCC use_table_2
\\ Use table 1
LDA #LO(fx_dotscroll_x)
STA fx_dotscroller_plot_column_table_x + 1
LDA #HI(fx_dotscroll_x)
STA fx_dotscroller_plot_column_table_x + 2
LDA #LO(fx_dotscroll_y)
STA fx_dotscroller_plot_column_table_y + 1
LDA #HI(fx_dotscroll_y)
STA fx_dotscroller_plot_column_table_y + 2
JMP start
.use_table_2
LDA #LO(fx_dotscroll_x2)
STA fx_dotscroller_plot_column_table_x + 1
LDA #HI(fx_dotscroll_x2)
STA fx_dotscroller_plot_column_table_x + 2
LDA #LO(fx_dotscroll_y2)
STA fx_dotscroller_plot_column_table_y + 1
LDA #HI(fx_dotscroll_y2)
STA fx_dotscroller_plot_column_table_y + 2
ELSE
LDA fx_dotscroller_col_idx
STA first_col + 1
ENDIF
.start
LDX #0
STX fx_dotscroller_cur_col
.char_loop
.char_idx
LDY #0
LDA (fx_dotscroller_ptr), Y
BNE not_zero
STA char_idx + 1
BEQ char_idx
.not_zero
INY
STY char_idx + 1
\\ Convert char to fb
JSR fx_dotscroller_get_char
\\ Plot columns
.first_col
LDY #0
.col_loop
STY fb_idx + 1
LDA (readptr), Y
LDX fx_dotscroller_cur_col
JSR fx_dotscroller_plot_column
LDX fx_dotscroller_cur_col
INX
STX fx_dotscroller_cur_col
CPX #DOTSCROLL_num_columns
BCS done
.fb_idx
LDY #0
INY
CPY #DOTSCROLL_cols_per_glyph
BCC col_loop
\\ Next char but from start of column
LDA #0
STA first_col + 1
JMP char_loop
.done
LDX fx_dotscroller_col_idx
LDY fx_dotscroller_char_idx
\\ Next column next time
INX
IF _DOTSCROLL_SMOOTH
CPX #DOTSCROLL_cols_per_glyph * 2
ELSE
CPX #DOTSCROLL_cols_per_glyph
ENDIF
BCC same_char
\\ Next char next time
LDX #0
INY
LDA (fx_dotscroller_ptr), Y
BNE same_char
LDY #0
.same_char
STX fx_dotscroller_col_idx
STY fx_dotscroller_char_idx
.return
RTS
}
\ ******************************************************************
\ * Dotscroller Font FX
\ ******************************************************************
\\ Pass character ASCII in A
\\ Return in readptr
.fx_dotscroller_get_char
{
SEC
SBC #32
STA readptr
LDA #0
STA readptr+1
\\ Multiply by 8
ASL readptr
ROL readptr+1
ASL readptr
ROL readptr+1
ASL readptr
ROL readptr+1
\\ Add font address
CLC
LDA #LO(bbc_font_rotated)
ADC readptr
STA readptr
LDA #HI(bbc_font_rotated)
ADC readptr+1
STA readptr+1
\\ Don't bother copying, just return in readptr
.return
RTS
}
\ ******************************************************************
\ * Dotscroller Ball FX
\ ******************************************************************
IF _DOTSCROLL_BALL
.fx_dotscroller_vx
EQUB 2
.fx_dotscroller_vy
EQUB 0
.fx_dotscroller_bounce_centre
{
\\ Update velocity
CLC
LDA fx_dotscroller_vy
ADC #1 ; gravity
STA fx_dotscroller_vy
\\ Update position
CLC
LDA fx_dotscroller_cx
ADC fx_dotscroller_vx ; should be times delta
STA fx_dotscroller_cx
CLC
LDA fx_dotscroller_cy
ADC fx_dotscroller_vy ; should be times delta
STA fx_dotscroller_cy
\\ Collision detection
LDA fx_dotscroller_cy
BMI check_top
\\ Check bottom
CMP #30 ; 10 lines below centre
BCC y_ok
\\ Flip velocity for bounce
CLC
LDA fx_dotscroller_vy
ADC #1
EOR #&FF
ADC #1 ; otherwise lose momentum
STA fx_dotscroller_vy
\\ Clamp y bottom
LDA #30
STA fx_dotscroller_cy
JMP y_ok
.check_top
CMP #&DC ; -36
BCS y_ok
\\ Clamp y top
LDA #&DC ; -36
STA fx_dotscroller_cy
.y_ok
LDA fx_dotscroller_cx
BMI check_left
\\ Check right
CMP #36 ; 10 lines below centre
BCC x_ok
\\ Flip velocity for bounce
CLC
LDA fx_dotscroller_vx
EOR #&FF
ADC #1
STA fx_dotscroller_vx
\\ Clamp x right
LDA #36
STA fx_dotscroller_cx
JMP x_ok
.check_left
CMP #&DC ; -36
BCS x_ok
\\ Flip velocity for bounce
CLC
LDA fx_dotscroller_vx
EOR #&FF
ADC #1
STA fx_dotscroller_vx
\\ Clamp x left
LDA #&DC ; -36
STA fx_dotscroller_cx
.x_ok
.return
RTS
}
ENDIF
\ ******************************************************************
\ * Dotscroller Lookup Tables
\ ******************************************************************
ALIGN &100
.fx_dotscroll_x
{
IF _DOTSCROLL_ANGLE
FOR c, 0, DOTSCROLL_num_columns-1, 1
FOR r, 0, DOTSCROLL_num_rows-1, 1
dx=(c - (DOTSCROLL_num_columns/2))*2
dy=(r - (DOTSCROLL_num_rows/2))*2
EQUB DOTSCROLL_dot_centre_x + dx * SIN(3*PI/4) + dy * COS(3*PI/4)
NEXT
NEXT
ELSE ; half circle
FOR c, 0, DOTSCROLL_num_columns-1, 1
FOR r, 0, DOTSCROLL_num_rows-1, 1
centre_x = DOTSCROLL_dot_centre_x
centre_y = DOTSCROLL_dot_centre_y
IF _DOTSCROLL_BALL
inner = 4
outer = 20
angle = PI/4 + (12*PI/8) * c / DOTSCROLL_num_columns
ELSE
inner = 10
outer = 35
angle = PI/2 + 1 * PI * c / DOTSCROLL_num_columns
ENDIF
distance = inner + (outer - inner) * r / DOTSCROLL_num_rows
EQUB centre_x - distance * SIN(angle)
NEXT
NEXT
ENDIF
}
.fx_dotscroll_y
{
IF _DOTSCROLL_ANGLE
FOR c, 0, DOTSCROLL_num_columns-1, 1
FOR r, 0, DOTSCROLL_num_rows-1, 1
dx=(c - (DOTSCROLL_num_columns/2))*2
dy=(r - (DOTSCROLL_num_rows/2))*2
EQUB DOTSCROLL_dot_centre_y - dy * SIN(3*PI/4) + dx * COS(3*PI/4)
NEXT
NEXT
ELSE ; half circle
FOR c, 0, DOTSCROLL_num_columns-1, 1
FOR r, 0, DOTSCROLL_num_rows-1, 1
centre_x = DOTSCROLL_dot_centre_x
centre_y = DOTSCROLL_dot_centre_y
IF _DOTSCROLL_BALL
inner = 6
outer = 22
angle = PI/4 + (12*PI/8) * c / DOTSCROLL_num_columns
ELSE
inner = 14
outer = 36
angle = PI/2 + 1 * PI * c / DOTSCROLL_num_columns
ENDIF
distance = inner + (outer - inner) * r / DOTSCROLL_num_rows
EQUB centre_y + distance * COS(angle)
NEXT
NEXT
ENDIF
}
IF _DOTSCROLL_SMOOTH
.fx_dotscroll_x2
{
FOR c, 0, DOTSCROLL_num_columns-1, 1
FOR r, 0, DOTSCROLL_num_rows-1, 1
centre_x = DOTSCROLL_dot_centre_x
centre_y = DOTSCROLL_dot_centre_y
inner = 10
outer = 30
distance = inner + (outer - inner) * r / DOTSCROLL_num_rows
angle = PI/2 + PI / (2*DOTSCROLL_num_columns) + 1 * PI * c / DOTSCROLL_num_columns
EQUB centre_x - distance * SIN(angle)
NEXT
NEXT
}
.fx_dotscroll_y2
{
FOR c, 0, DOTSCROLL_num_columns-1, 1
FOR r, 0, DOTSCROLL_num_rows-1, 1
centre_x = DOTSCROLL_dot_centre_x
centre_y = DOTSCROLL_dot_centre_y
inner = 14
outer = 36
distance = inner + (outer - inner) * r / DOTSCROLL_num_rows
angle = PI/2 + PI / (2*DOTSCROLL_num_columns) + 1 * PI * c / DOTSCROLL_num_columns
EQUB centre_y + distance * COS(angle)
NEXT
NEXT
}
ENDIF
.bbc_font_rotated
;INCBIN ".\data\bbc_font_90_deg_cw.bin"
;INCBIN ".\data\bold_font_90_deg_cw.bin"
INCBIN ".\data\square_font_90_deg_cw.bin"
.end_fx_dotscroller |
sources/driver/custom_writers.adb | reznikmm/markdown | 0 | 1191 | <reponame>reznikmm/markdown<gh_stars>0
-- SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with Ada.Strings.Unbounded;
with Ada.Characters.Wide_Wide_Latin_1;
with Ada.Integer_Text_IO;
package body Custom_Writers is
New_Line : constant Wide_Wide_String :=
(1 => Ada.Characters.Wide_Wide_Latin_1.LF);
Amp_Entity_Reference : constant String
:= "&";
-- Apos_Entity_Reference : constant String
-- := "'";
Quot_Entity_Reference : constant String
:= """;
Gt_Entity_Reference : constant String
:= ">";
Lt_Entity_Reference : constant String
:= "<";
procedure Close_Tag (Self : in out Writer'Class);
function Escape
(Text : League.Strings.Universal_String;
Escape_All : Boolean := False)
return League.Strings.Universal_String;
----------------
-- Characters --
----------------
overriding procedure Characters
(Self : in out Writer;
Text : League.Strings.Universal_String;
Success : in out Boolean)
is
pragma Unreferenced (Success);
begin
Self.Close_Tag;
if Self.CDATA then
Self.Output.Put (Text);
else
Self.Output.Put (Escape (Text, False));
end if;
end Characters;
---------------
-- Close_Tag --
---------------
procedure Close_Tag (Self : in out Writer'Class) is
begin
if not Self.Tag.Is_Empty then
Self.Output.Put (">");
Self.Tag.Clear;
end if;
end Close_Tag;
-------------
-- Comment --
-------------
overriding procedure Comment
(Self : in out Writer;
Text : League.Strings.Universal_String;
Success : in out Boolean)
is
pragma Unreferenced (Success);
begin
Self.Output.Put ("<!--");
Self.Output.Put (Text);
Self.Output.Put ("-->");
end Comment;
---------------
-- End_CDATA --
---------------
overriding procedure End_CDATA
(Self : in out Writer;
Success : in out Boolean)
is
pragma Unreferenced (Success);
begin
Self.CDATA := False;
Self.Output.Put ("]]>");
end End_CDATA;
-----------------
-- End_Element --
-----------------
overriding procedure End_Element
(Self : in out Writer;
Namespace_URI : League.Strings.Universal_String;
Local_Name : League.Strings.Universal_String;
Qualified_Name : League.Strings.Universal_String;
Success : in out Boolean)
is
pragma Unreferenced (Namespace_URI, Qualified_Name, Success);
use type League.Strings.Universal_String;
begin
if Self.Tag = Local_Name and then
Self.Tag.To_Wide_Wide_String not in "code" | "html" | "a" | "li"
and then (Self.Tag.Length = 1 or else
Self.Tag (2).To_Wide_Wide_Character not in '1' .. '9')
then
Self.Output.Put ("/>");
Self.Tag.Clear;
else
Self.Close_Tag;
Self.Output.Put ("</");
Self.Output.Put (Local_Name);
Self.Output.Put (">");
end if;
if Local_Name.Starts_With ("h") or else
Local_Name.To_Wide_Wide_String = "p"
then
Self.Output.Put (New_Line);
end if;
end End_Element;
------------------
-- Error_String --
------------------
overriding function Error_String
(Self : Writer) return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return League.Strings.Empty_Universal_String;
end Error_String;
function Escape
(Text : League.Strings.Universal_String;
Escape_All : Boolean := False)
return League.Strings.Universal_String
is
UTF_8 : constant String := Text.To_UTF_8_String;
Result : Ada.Strings.Unbounded.Unbounded_String;
begin
for Code of UTF_8 loop
case Code is
when '&' =>
Ada.Strings.Unbounded.Append (Result, Amp_Entity_Reference);
when '"' =>
if Escape_All then
Ada.Strings.Unbounded.Append (Result, "%22");
else
Ada.Strings.Unbounded.Append (Result, Quot_Entity_Reference);
end if;
when '>' =>
Ada.Strings.Unbounded.Append (Result, Gt_Entity_Reference);
when '<' =>
Ada.Strings.Unbounded.Append (Result, Lt_Entity_Reference);
when 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' |
'-' | '_' | '.' | '~' | '/' | '@' | '+' | ',' |
'(' | ')' | '#' | '?' | '=' | ':' | '*'
=>
Ada.Strings.Unbounded.Append (Result, Code);
-- when '\' =>
-- if Escape_All then
-- Ada.Strings.Unbounded.Append (Result, "%5C");
-- else
-- Ada.Strings.Unbounded.Append (Result, Code);
-- end if;
when others =>
if Escape_All or
Character'Pos (Code) in 16#1# .. 16#8#
| 16#B# .. 16#C#
| 16#E# .. 16#1F#
| 16#7F#
then
declare
Image : String (1 .. 7); -- -#16#xx#
begin
Ada.Integer_Text_IO.Put
(To => Image,
Item => Character'Pos (Code),
Base => 16);
Ada.Strings.Unbounded.Append (Result, "%");
Ada.Strings.Unbounded.Append (Result, Image (5 .. 6));
end;
else
Ada.Strings.Unbounded.Append (Result, Code);
end if;
end case;
end loop;
return League.Strings.From_UTF_8_String
(Ada.Strings.Unbounded.To_String (Result));
end Escape;
overriding procedure Processing_Instruction
(Self : in out Writer;
Target : League.Strings.Universal_String;
Data : League.Strings.Universal_String;
Success : in out Boolean)
is
pragma Unreferenced (Success);
begin
Self.Output.Put ("<?");
Self.Output.Put (Target);
if not Data.Is_Empty then
Self.Output.Put (" ");
Self.Output.Put (Data);
end if;
Self.Output.Put ("?>");
end Processing_Instruction;
----------------------------
-- Set_Output_Destination --
----------------------------
procedure Set_Output_Destination
(Self : in out Writer'Class;
Output : not null SAX_Output_Destination_Access) is
begin
Self.Output := Output;
end Set_Output_Destination;
-----------------
-- Start_CDATA --
-----------------
overriding procedure Start_CDATA
(Self : in out Writer;
Success : in out Boolean)
is
pragma Unreferenced (Success);
begin
Self.Output.Put ("<![CDATA[");
Self.CDATA := True;
end Start_CDATA;
-------------------
-- Start_Element --
-------------------
overriding procedure Start_Element
(Self : in out Writer;
Namespace_URI : League.Strings.Universal_String;
Local_Name : League.Strings.Universal_String;
Qualified_Name : League.Strings.Universal_String;
Attributes : XML.SAX.Attributes.SAX_Attributes;
Success : in out Boolean) is
pragma Unreferenced (Success, Namespace_URI, Qualified_Name);
begin
Self.Close_Tag;
Self.Output.Put ("<");
Self.Output.Put (Local_Name);
if Local_Name.To_Wide_Wide_String = "hr" then
Self.Output.Put (" ");
end if;
for J in 1 .. Attributes.Length loop
Self.Output.Put (" ");
Self.Output.Put (Attributes.Local_Name (J));
Self.Output.Put ("=""");
if Attributes.Local_Name (J).To_Wide_Wide_String = "href" then
Self.Output.Put (Escape (Attributes.Value (J), True));
elsif Attributes.Local_Name (J).To_Wide_Wide_String = "class" then
Self.Output.Put (Attributes.Value (J));
else
Self.Output.Put (Escape (Attributes.Value (J), False));
end if;
Self.Output.Put ("""");
end loop;
Self.Tag := Local_Name;
end Start_Element;
--------------------------
-- Unescaped_Characters --
--------------------------
not overriding procedure Unescaped_Characters
(Self : in out Writer;
Text : League.Strings.Universal_String) is
begin
Self.Close_Tag;
Self.Output.Put (Text);
end Unescaped_Characters;
end Custom_Writers;
|
src/main/java/eric/bottard/Tis100.g4 | ericbottard/tis-100 | 4 | 4193 | grammar Tis100;
node: line*;
line:
label? stmt? COMMENT? NEWLINE;
label: ID ':';
stmt:
'NOP' #NOP
| 'MOV' src ',' dst #MOV
| 'SWP' #SWP
| 'SAV' #SAV
| 'ADD' src #ADD
| 'SUB' src #SUB
| 'NEG' #NEG
| 'JMP' ID #JMP
| 'JEZ' ID #JEZ
| 'JNZ' ID #JNZ
| 'JGZ' ID #JGZ
| 'JLZ' ID #JLZ
| 'JRO' src #JRO
;
src: REGISTER #sourceRegister
| INT #sourceInt
| PORT #sourcePort
;
dst: REGISTER #destinationRegister
| PORT #destinationPort
;
REGISTER:
'ACC'
| 'NIL'
;
PORT:
'UP'
| 'LEFT'
| 'DOWN'
| 'RIGHT'
| 'ANY'
| 'LAST'
;
COMMENT: '#' (~'\n')*;
INT: '-'? DIGIT DIGIT? DIGIT?;
DIGIT: [0-9];
ID: [A-Z0-9\-_$]+;
WS: ' '+ -> skip;
NEWLINE: '\n';
|
lib/chibiakumas/SrcALL/Multiplatform_ChibiWave.asm | gilbertfrancois/msx | 0 | 22409 | <gh_stars>0
ifdef BuildCPC
read "\SrcCPC\CPC_V1_ChibiWave.asm"
endif
ifdef BuildMSX
read "\SrcCPC\CPC_V1_ChibiWave.asm"
endif
ifdef BuildZXS
ifdef ZXSAYWave
read "\SrcCPC\CPC_V1_ChibiWave.asm"
else
read "\SrcZX\ZX48_V1_ChibiWave.asm"
endif
endif
ifdef BuildCLX
read "\SrcCLX\CLX_V1_ChibiWave.asm"
endif
ifdef BuildENT
read "\SrcENT\ENT_V1_ChibiWave.asm"
endif
ifdef BuildSAM
read "\SrcSAM\SAM_V1_ChibiWave.asm"
endif
ifdef BuildSMS
read "\SrcSMS\SMS_V1_ChibiWave.asm"
endif
ifdef BuildSGG
read "\SrcSMS\SMS_V1_ChibiWave.asm"
endif
ifdef BuildGMB
read "\SrcGB\GB_V1_ChibiWave.asm"
endif
ifdef BuildGBC
read "\SrcGB\GB_V1_ChibiWave.asm"
endif
|
test/Compiler/simple/Issue2486/ImportB.agda | shlevy/agda | 1,989 | 15704 | <reponame>shlevy/agda
module Issue2486.ImportB where
open import Issue2486.Haskell
{-# FOREIGN GHC data BBool = BTrue | BFalse #-}
data BBool : Set where
BTrue BFalse : BBool
{-# COMPILE GHC BBool = data BBool ( BTrue | BFalse ) #-}
postulate BList : Set → Set
{-# FOREIGN GHC import MAlonzo.Code.Issue2486.Haskell (MyList) #-}
{-# COMPILE GHC BList = type MyList #-}
|
src/main/antlr4/VLexer.g4 | ArgonDesign/argon-vtools | 0 | 5740 | <filename>src/main/antlr4/VLexer.g4
////////////////////////////////////////////////////////////////////////////////
// Argon Design Ltd. Project P9000 Argon
// Copyright (c) 2016-2018 Argon Design Ltd. All rights reserved.
//
// This file is covered by the BSD (with attribution) license.
// See the LICENSE file for the precise wording of the license.
//
// Module : Argon Verilog Tools
// Author : <NAME>
//
// DESCRIPTION:
//
////////////////////////////////////////////////////////////////////////////////
lexer grammar VLexer;
channels {
WHITESPACE,
COMMENT,
DIRECTIVE
}
// All IEEE 1364-2005 keywords
KWALWAYS : 'always' ;
KWAND : 'and' ;
KWASSIGN : 'assign' ;
KWAUTOMATIC : 'automatic' ;
KWBEGIN : 'begin' ;
KWBUF : 'buf' ;
KWBUFIF0 : 'bufif0' ;
KWBUFIF1 : 'bufif1' ;
KWCASE : 'case' ;
KWCASEX : 'casex' ;
KWCASEZ : 'casez' ;
KWCELL : 'cell' ;
KWCMOS : 'cmos' ;
KWCONFIG : 'config' ;
KWDEASSIGN : 'deassign' ;
KWDEFAULT : 'default' ;
KWDEFPARAM : 'defparam' ;
KWDESIGN : 'design' ;
KWDISABLE : 'disable' ;
KWEDGE : 'edge' ;
KWELSE : 'else' ;
KWEND : 'end' ;
KWENDCASE : 'endcase' ;
KWENDCONFIG : 'endconfig' ;
KWENDFUNCTION : 'endfunction' ;
KWENDGENERATE : 'endgenerate' ;
KWENDMODULE : 'endmodule' ;
KWENDPRIMITIVE : 'endprimitive' ;
KWENDSPECIFY : 'endspecify' ;
KWENDTABLE : 'endtable' ;
KWENDTASK : 'endtask' ;
KWEVENT : 'event' ;
KWFOR : 'for' ;
KWFORCE : 'force' ;
KWFOREVER : 'forever' ;
KWFORK : 'fork' ;
KWFUNCTION : 'function' ;
KWGENERATE : 'generate' ;
KWGENVAR : 'genvar' ;
KWHIGHZ0 : 'highz0' ;
KWHIGHZ1 : 'highz1' ;
KWIF : 'if' ;
KWIFNONE : 'ifnone' ;
KWINCDIR : 'incdir' ;
KWINCLUDE : 'include' ;
KWINITIAL : 'initial' ;
KWINOUT : 'inout' ;
KWINPUT : 'input' ;
KWINSTANCE : 'instance' ;
KWINTEGER : 'integer' ;
KWJOIN : 'join' ;
KWLARGE : 'large' ;
KWLIBLIST : 'liblist' ;
KWLIBRARY : 'library' ;
KWLOCALPARAM : 'localparam' ;
KWMACROMODULE : 'macromodule' ;
KWMEDIUM : 'medium' ;
KWMODULE : 'module' ;
KWNAND : 'nand' ;
KWNEGEDGE : 'negedge' ;
KWNMOS : 'nmos' ;
KWNOR : 'nor' ;
KWNOSHOWCANCELLED : 'noshowcancelled' ;
KWNOT : 'not' ;
KWNOTIF0 : 'notif0' ;
KWNOTIF1 : 'notif1' ;
KWOR : 'or' ;
KWOUTPUT : 'output' ;
KWPARAMETER : 'parameter' ;
KWPMOS : 'pmos' ;
KWPOSEDGE : 'posedge' ;
KWPRIMITIVE : 'primitive' ;
KWPULL0 : 'pull0' ;
KWPULL1 : 'pull1' ;
KWPULLDOWN : 'pulldown' ;
KWPULLUP : 'pullup' ;
KWPULSESTYLE_ONEVENT : 'pulsestyle_onevent' ;
KWPULSESTYLE_ONDETECT : 'pulsestyle_ondetect' ;
KWRCMOS : 'rcmos' ;
KWREAL : 'real' ;
KWREALTIME : 'realtime' ;
KWREG : 'reg' ;
KWRELEASE : 'release' ;
KWREPEAT : 'repeat' ;
KWRNMOS : 'rnmos' ;
KWRPMOS : 'rpmos' ;
KWRTRAN : 'rtran' ;
KWRTRANIF0 : 'rtranif0' ;
KWRTRANIF1 : 'rtranif1' ;
KWSCALARED : 'scalared' ;
KWSHOWCANCELLED : 'showcancelled' ;
KWSIGNED : 'signed' ;
KWSMALL : 'small' ;
KWSPECIFY : 'specify' ;
KWSPECPARAM : 'specparam' ;
KWSTRONG0 : 'strong0' ;
KWSTRONG1 : 'strong1' ;
KWSUPPLY0 : 'supply0' ;
KWSUPPLY1 : 'supply1' ;
KWTABLE : 'table' ;
KWTASK : 'task' ;
KWTIME : 'time' ;
KWTRAN : 'tran' ;
KWTRANIF0 : 'tranif0' ;
KWTRANIF1 : 'tranif1' ;
KWTRI : 'tri' ;
KWTRI0 : 'tri0' ;
KWTRI1 : 'tri1' ;
KWTRIAND : 'triand' ;
KWTRIOR : 'trior' ;
KWTRIREG : 'trireg' ;
KWUNSIGNED : 'unsigned' ;
KWUNSIGNED1 : 'unsigned1' ;
KWUSE : 'use' ;
KWUWIRE : 'uwire' ;
KWVECTORED : 'vectored' ;
KWWAIT : 'wait' ;
KWWAND : 'wand' ;
KWWEAK0 : 'weak0' ;
KWWEAK1 : 'weak1' ;
KWWHILE : 'while' ;
KWWIRE : 'wire' ;
KWWOR : 'wor' ;
KWXNOR : 'xnor' ;
KWXOR : 'xor' ;
// Keywords not explicitly defined in the LRM
KWPATHPULSE : 'PATHPULSE' ;
// Compiler directive keywords
DKWBEGIN_KEYWORDS : '`begin_keywords' ;
DKWCELLDEFINE : '`celldefine' ;
DKWDEFAULT_NETTYPE : '`default_nettype' ;
DKWDEFINE : '`define' ;
DKWELSE : '`else' ;
DKWELSIF : '`elsif' ;
DKWEND_KEYWORDS : '`end_keywords' ;
DKWENDCELLDEFINE : '`endcelldefine' ;
DKWENDIF : '`endif' ;
DKWIFDEF : '`ifdef' ;
DKWIFNDEF : '`ifndef' ;
DKWINCLUDE : '`include' ;
DKWLINE : '`line' ;
DKWNOUNCONNECTED_DRIVE : '`nounconnected_drive' ;
DKWPRAGMA : '`pragma' ;
DKWRESETALL : '`resetall' ;
DKWTIMESCALE : '`timescale' ;
DKWUNCONNECTED_DRIVE : '`unconnected_drive' ;
DKWUNDEF : '`undef' ;
// Operators
BNOT: '~' ;
BAND: '&' ;
BNAND: '~&' ;
BOR: '|' ;
BNOR: '~|' ;
BXOR: '^' ;
BXNOR1: '~^' ;
BXNOR2: '^~' ;
ADD: '+' ;
SUB: '-' ;
MUL: '*' ;
DIV: '/' ;
MOD: '%' ;
POW: '**' ;
NOT: '!' ;
AND: '&&' ;
OR: '||' ;
LSR: '>>' ;
LSL: '<<' ;
ASR: '>>>' ;
ASL: '<<<' ;
EQ: '==' ;
NE: '!=' ;
LT: '<' ;
LE: '<=' ;
GT: '>' ;
GE: '>=' ;
TEQ: '===' ;
TNE: '!==' ;
// Special forms not explicitly defined
AT: '@' ;
HASH: '#' ;
DOLLAR: '$' ;
EQUALITY: '=' ;
QUESTION: '?' ;
LPAREN: '(' ;
RPAREN: ')' ;
LBRACKET: '[' ;
RBRACKET: ']' ;
LBRACE: '{' ;
RBRACE: '}' ;
DOT: '.' ;
COMA: ',' ;
SEMI: ';' ;
COLON: ':' ;
PCOLON: '+:' ;
MCOLON: '-:' ;
SGT: '->' ;
EGT: '=>' ;
MGT: '*>' ;
TAND: '&&&' ;
////////////////////////////////////////////////////////////////////////////////
// fragments
////////////////////////////////////////////////////////////////////////////////
fragment NL
: '\r'? '\n'
;
////////////////////////////////////////////////////////////////////////////////
// A.8.6 Numbers
////////////////////////////////////////////////////////////////////////////////
fragment DDIGIT
: [0-9]
;
fragment XDIGIT
: [xX]
;
fragment ZDIGIT
: [zZ?]
;
fragment BDIGIT
: [01]
| XDIGIT
| ZDIGIT
;
fragment ODIGIT
: [0-7]
| XDIGIT
| ZDIGIT
;
fragment HDIGIT
: [0-9a-fA-F]
| XDIGIT
| ZDIGIT
;
fragment DBASE
: '\'' [sS]? [dD]
;
fragment BBASE
: '\'' [sS]? [bB]
;
fragment OBASE
: '\'' [sS]? [oO]
;
fragment HBASE
: '\'' [sS]? [hH]
;
DVALUE
: DDIGIT ('_' | DDIGIT)*
;
fragment BVALUE
: BDIGIT ('_' | BDIGIT)*
;
fragment OVALUE
: ODIGIT ('_' | ODIGIT)*
;
fragment HVALUE
: HDIGIT ('_' | HDIGIT)*
;
fragment SIZE
: [1-9] ('_' | DDIGIT)*
;
BINT
: SIZE? BBASE BVALUE
;
OINT
: SIZE? OBASE OVALUE
;
HINT
: SIZE? HBASE HVALUE
;
DINT
: SIZE? DBASE DVALUE
;
DX
: SIZE? DBASE XDIGIT '_'*
;
DZ
: SIZE? DBASE ZDIGIT '_'*
;
REAL
: DVALUE '.' DVALUE
;
REALEXP
: DVALUE ('.' DVALUE)? [eE] [+-]? DVALUE
;
////////////////////////////////////////////////////////////////////////////////
// A.8.8 Strings
////////////////////////////////////////////////////////////////////////////////
fragment STRINGESC
: '\\"'
| '\\\\'
| '\\n'
| '\\t'
| '\\' ODIGIT ODIGIT ODIGIT
;
STRING
: '"' (STRINGESC|.)*? '"'
;
////////////////////////////////////////////////////////////////////////////////
// A.9.2 Comments
////////////////////////////////////////////////////////////////////////////////
ONE_LINE_COMMENT
: '//' .*? NL -> channel(COMMENT)
;
BLOCK_COMMENT
: '/*' .*? '*/' -> channel(COMMENT)
;
////////////////////////////////////////////////////////////////////////////////
// A.9.3 Identifiers
////////////////////////////////////////////////////////////////////////////////
SYSID
: '$'[a-zA-Z0-9_$][a-zA-Z0-9_$]*
;
fragment SIMPLEID
: [a-zA-Z_][a-zA-Z0-9_$]*
;
fragment ESCAPEDID
: '\\' [\u0021-\u007E]+
;
fragment MACROID
: '`' SIMPLEID
;
IDENTIFIER
: SIMPLEID
| ESCAPEDID
| MACROID
;
////////////////////////////////////////////////////////////////////////////////
// A.9.4 White space
////////////////////////////////////////////////////////////////////////////////
WS
: ([ \t] | NL)+ -> channel(WHITESPACE)
;
////////////////////////////////////////////////////////////////////////////////
// Catch characters that failed to match any lexer rules
////////////////////////////////////////////////////////////////////////////////
ERRORCHAR : . ;
|
programs/oeis/112/A112873.asm | karttu/loda | 0 | 165359 | <reponame>karttu/loda<filename>programs/oeis/112/A112873.asm
; A112873: Partial sums of A032378.
; 2,5,9,14,20,27,37,49,63,79,97,117,139,163,189,219,252,288,327,369,414,462,513,567,624,684,747,815,887,963,1043,1127,1215,1307,1403,1503,1607,1715,1827,1943,2063,2187,2317,2452,2592,2737,2887,3042,3202,3367,3537
mov $16,$0
mov $18,$0
add $18,1
lpb $18,1
clr $0,16
mov $0,$16
sub $18,1
sub $0,$18
mov $13,$0
mov $15,$0
add $15,1
lpb $15,1
mov $0,$13
sub $15,1
sub $0,$15
mov $9,$0
mov $11,2
lpb $11,1
mov $0,$9
sub $11,1
add $0,$11
mov $5,$0
mul $5,2
mov $6,1
lpb $0,1
add $0,1
add $5,$0
sub $0,1
mov $2,$4
mov $3,2
add $6,3
add $3,$6
add $2,$3
trn $0,$2
lpe
mov $1,$5
mov $12,$11
lpb $12,1
mov $10,$1
sub $12,1
lpe
lpe
lpb $9,1
mov $9,0
sub $10,$1
lpe
mov $1,$10
sub $1,2
add $14,$1
lpe
add $17,$14
lpe
mov $1,$17
|
test/Succeed/Issue1245.agda | cruhland/agda | 1,989 | 4028 | module Issue1245 where
postulate
A B : Set
[_] : A -> B
module M (_ : B) where
module N (a : A) = M [ a ]
|
linear_algebra/givens_qr.adb | jscparker/math_packages | 30 | 19854 |
--------------------------------------------------------------------------
-- package body Givens_QR, QR decomposition using Givens rotations
-- Copyright (C) 2008-2018 <NAME>
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------------------------
with Ada.Numerics;
with Ada.Numerics.Generic_Elementary_Functions;
package body Givens_QR is
package math is new Ada.Numerics.Generic_Elementary_Functions (Real); use math;
Zero : constant Real := +0.0;
One : constant Real := +1.0;
Two : constant Real := +2.0;
Exp_Min : constant Integer := Real'Machine_Emin;
Min_Allowed_Real : constant Real := Two**(Exp_Min - Exp_Min / 8);
type Int64 is range -2**63+1 .. 2**63-1;
-- Make these True:
Scaling_Desired : constant Boolean := True;
Pivoting_Desired : constant Boolean := True;
-- Scaling Prevents overflow during pivoting. With pivoting and
-- scaling enabled, the QR usually reveals the rank of matrix A.
-------------------------------
-- Inverse_Rotate_Col_Vector --
-------------------------------
-- for getting Q*B
procedure Inverse_Rotate_Col_Vector
(B : in out Col_Vector;
lower_right_id : in R_Index; -- low diagonal element (cos) of rot. matrix
upper_left_id : in R_Index; -- top diagonal element (cos) of rot. matrix
Rot : in Rotation;
P_bigger_than_L : in Boolean)
is
B_pvt, B_Low : Real;
c : real renames Rot.Cosine;
s : real renames Rot.Sine;
begin
-- all you do is flip the sign of Sine. s in part 1,
-- and in part 2, 1 + (s-1) becomes -1 - (s-1), where the s-1 is given as s.
if P_bigger_than_L then
if abs s > Zero then -- optimization uses fact that c is always positive.
B_pvt := B(upper_left_id);
B_Low := B(lower_right_id);
B(upper_left_id) := B_pvt - s*(-c*B_pvt + B_Low);
B(lower_right_id) := B_Low - s*( -B_pvt - c*B_Low);
end if;
else
B_pvt := B(upper_left_id);
B_Low := B(lower_right_id);
B(upper_left_id) :=-B_Low + c*( B_Pvt - s*B_Low);
B(lower_right_id) := B_Pvt + c*(+s*B_Pvt + B_Low);
end if;
end Inverse_Rotate_Col_Vector;
pragma Inline (Inverse_Rotate_Col_Vector);
-----------------------
-- Rotate_Col_Vector --
-----------------------
-- for getting Q'*B . Uses actual rotation stored in Q, which is the one
-- used to create R .. (so Q really contains Q_transpose.)
procedure Rotate_Col_Vector
(B : in out Col_Vector;
lower_right_id : in R_Index; -- low diagonal element (cos) of rot. matrix
upper_left_id : in R_Index; -- top diagonal element (cos) of rot. matrix
Rot : in Rotation;
P_bigger_than_L : in Boolean)
is
B_pvt, B_Low : Real;
c : real renames Rot.Cosine;
s : real renames Rot.Sine;
begin
if P_bigger_than_L then
if abs s > Zero then -- rot not identity: use fact c is always positive.
B_pvt := B(upper_left_id);
B_Low := B(lower_right_id);
B(upper_left_id) := B_pvt + s*( c*B_pvt + B_Low);
B(lower_right_id) := B_Low + s*( -B_pvt + c*B_Low);
end if;
else
B_pvt := B(upper_left_id);
B_Low := B(lower_right_id);
B(upper_left_id) := B_Low + c*( B_Pvt + s*B_Low);
B(lower_right_id) :=-B_Pvt + c*(-s*B_Pvt + B_Low);
end if;
end Rotate_Col_Vector;
pragma Inline (Rotate_Col_Vector);
-----------------------------------
-- Find_Id_Of_Max_Element_Of_Row --
-----------------------------------
procedure Get_Id_Of_Max_Element_Of_Row
(The_Row : in Row_Vector;
Starting_Col : in C_Index;
Final_Col : in C_Index;
Id_Of_Max_Element : out C_Index;
Val_of_Max_Element : out Real)
is
Val : Real;
begin
Id_Of_Max_Element := Starting_Col;
Val_of_Max_Element := Abs The_Row(Starting_Col);
if Final_Col > Starting_Col then
for k in Starting_Col+1 .. Final_Col loop
Val := The_Row(k);
if Abs Val > Val_of_Max_Element then
Val_of_Max_Element := Val;
Id_Of_Max_Element := k;
end if;
end loop;
end if;
end Get_Id_Of_Max_Element_Of_Row;
------------------
-- QR_Decompose --
------------------
procedure QR_Decompose
(A : in out A_Matrix;
Q : out Q_Matrix;
Row_Scalings : out Col_Vector;
Col_Permutation : out Permutation;
Final_Row : in R_Index := R_Index'Last;
Final_Col : in C_Index := C_Index'Last;
Starting_Row : in R_Index := R_Index'First;
Starting_Col : in C_Index := C_Index'First)
is
No_of_Rows : constant Real
:= Real (Final_Row) - Real (Starting_Row) + One;
No_of_Cols : constant Real
:= Real (Final_Col) - Real (Starting_Col) + One;
Pivot_Row : R_Index := Starting_Row; -- essential init.
Norm_Squ_of_Col_of_A : Row_Vector;
------------------------------------------------
-- Rotate_Rows_to_Zero_Out_Element_Lo_of_pCol --
------------------------------------------------
-- cos = P/r, sin = L/r, r = sqrt(P*P + L*L)
--
-- (P is for Pivot, L is for Low.
--
-- clockwise rotation: notice all rotations are centered on the diagonal
--
-- 1 0 0 0 0 0 0
-- 0 c s 0 0 P r
-- 0 -s c 0 0 x L = 0
-- 0 0 0 1 0 0 0
-- 0 0 0 0 1 0 0
--
--
-- if |L| >= |P| then tn = P/L <= 1
-- if |P| > |L| then tn = L/P < 1
--
--
-- let t = smaller / larger
--
-- let u = 1/sqrt(1+t*t) and w = sqrt(t*t/(1+t*t)) with
--
-- use (1 - 1/sqrt(1+t*t)) * (1 + 1/sqrt(1+t*t)) = t*t / (1 + t*t)
--
-- 1/sqrt(1+t*t) - 1 = - t*t/(sqrt(1+t*t) + 1+t*t)
-- = -(t/(sqrt(1+t*t))*(t/(1 + Sqrt(1+t*t)))
-- = - Abs (w) * Abs (t)/(1+ sqrt(1+t*t))
-- = u_lo
--
-- u_hi = 1 => u_lo + u_hi = 1/sqrt(1+t*t) = u = Abs (cs) if a<b
--
--
-- hypot = |L| * sqrt(1+t*t) = |L| * (1 + t*t/(1+sqrt(1+t*t)) = hi + lo if t<1
--
--
procedure Rotate_Rows_to_Zero_Out_Element_Lo_of_pCol
(pCol : in C_Index;
Hi_Row : in R_Index;
Lo_Row : in R_Index)
is
Pivot_Col : C_Index renames pCol;
Pivot_Row : R_Index renames Hi_Row;
Low_Row : R_Index renames Lo_Row;
tn, sq : real;
sn, cn : Real;
A_pvt, A_low : real;
cn_minus_1_over_sn, sn_minus_1_over_cn : real;
P : Real := A(Pivot_Row, Pivot_Col); -- P is for Pivot
L : Real := A(Low_Row, Pivot_Col);
Abs_P : constant Real := Abs (P);
Abs_L : constant Real := Abs (L);
P_bigger_than_L : Boolean := True;
begin
-- use Identity if no rotation is performed:
Q.Rot(Low_Row, Pivot_Col).Cosine := Zero;
Q.Rot(Low_Row, Pivot_Col).Sine := Zero;
Q.P_bigger_than_L(Low_Row, Pivot_Col) := True;
if (not L'Valid) or (not P'Valid) then
return; -- having updated Q w. identity
end if;
if Abs_P > Abs_L then -- |s| < |c|
if Abs_P > Zero then
P_bigger_than_L := True;
-- Make P>0 always, so if P<0 then flip signs of both P and L
-- to ensure zero'd out element.
if P < Zero then
L := -L; P := Abs_P;
end if;
tn := L / P; -- P>0 so t has sign of L
sq := Sqrt (One + tn*tn);
sn := tn / sq; -- sn has sign of L
cn_minus_1_over_sn :=-tn / (One + sq);
-- factored out the sn from cn_minus_1
for Col in Pivot_Col .. Final_Col loop
A_pvt := A(Pivot_Row, Col);
A_low := A(Low_Row, Col);
A(Pivot_Row, Col) := A_pvt + sn * (cn_minus_1_over_sn*A_pvt + A_low);
A(Low_Row, Col) := A_low + sn * (-A_pvt + cn_minus_1_over_sn*A_low);
end loop;
Q.Rot(Low_Row, Pivot_Col).Cosine := cn_minus_1_over_sn;
Q.Rot(Low_Row, Pivot_Col).Sine := sn;
Q.P_bigger_than_L(Low_Row, Pivot_Col) := P_bigger_than_L;
end if;
else -- Abs_P <= Abs_L, so abs t := abs (P / L) <= 1
if Abs_L > Zero then
P_bigger_than_L := False;
-- Make L>0 always, so if L<0 then flip signs of both P and L
-- to ensure zero'd out element.
if L < Zero then
L := Abs_L; P := -P;
end if;
tn := P / L; -- L>0 now so, t has sign of P.
sq := Sqrt (One + tn*tn);
cn := tn / sq; -- has sign of P
sn_minus_1_over_cn :=-tn / (One + sq);
-- factored out the cn from sn_minus_1
for Col in Pivot_Col .. Final_Col loop
A_pvt := A(Pivot_Row, Col);
A_low := A(Low_Row, Col);
A(Pivot_Row, Col) := A_low + cn * (A_pvt + sn_minus_1_over_cn*A_low);
A(Low_Row, Col) :=-A_pvt + cn * (-sn_minus_1_over_cn*A_pvt + A_low);
end loop;
Q.Rot(Low_Row, Pivot_Col).Cosine := cn;
Q.Rot(Low_Row, Pivot_Col).Sine := sn_minus_1_over_cn;
Q.P_bigger_than_L(Low_Row, Pivot_Col) := P_bigger_than_L;
end if; -- Abs_L > Zero
end if;
end Rotate_Rows_to_Zero_Out_Element_Lo_of_pCol;
procedure Scale_Rows
(Row_Scalings : out Col_Vector;
Starting_Col : in C_Index := C_Index'First;
Final_Col : in C_Index := C_Index'Last;
Starting_Row : in R_Index := R_Index'First;
Final_Row : in R_Index := R_Index'Last)
is
Norm : Real;
Scale_Factor, Abs_A : Real;
begin
Row_Scalings := (others => One); -- important init
for Row in Starting_Row .. Final_Row loop
--Norm := Zero;
--Get_1_Norm:
--for Col in Starting_Col .. Final_Col loop
--if not A(Row, Col)'valid then raise constraint_error with "7"; end if;
--Norm := Norm + abs A(Row, Col);
--end loop Get_1_Norm;
Norm := Zero;
Get_Infinity_Norm:
for Col in Starting_Col .. Final_Col loop
Abs_A := Abs A(Row, Col);
if Abs_A > Norm then Norm := Abs_A; end if;
end loop Get_Infinity_Norm;
if not Norm'Valid then
raise Ada.Numerics.Argument_Error with "Elements of input matrix invalid.";
end if;
if Norm < Two ** (Real'Machine_Emin - Real'Machine_Emin/16) then
Scale_Factor := Zero;
else
declare
Norm_Exp : constant Integer := Real'Exponent (Norm);
begin
Scale_Factor := Two ** (-Norm_Exp);
end;
end if;
Row_Scalings(Row) := Scale_Factor;
end loop;
for Row in Starting_Row .. Final_Row loop
for Col in Starting_Col .. Final_Col loop
A(Row, Col) := Row_Scalings(Row) * A(Row, Col);
end loop;
end loop;
end Scale_Rows;
-- Find sub Col_Vector with max norm, swap Columns if necessary.
procedure Do_Column_Pivoting
(Starting_Col : in C_Index;
Final_Col : in C_Index;
Starting_Row : in R_Index;
Final_Row : in R_Index;
Pivot_Col : in C_Index;
Col_Permutation : in out Permutation;
Col_Norm_Squared : in out Row_Vector)
is
Pivot_Row : constant R_Index := R_Index (Pivot_Col);
tmp_index, New_Pivot_Col : C_Index;
Pivot_Val, tmp : Real;
begin
if Pivot_Col >= Final_Col then return; end if;
if (Pivot_Col = Starting_Col) or else
((Int64(Pivot_Col) - Int64(Starting_Col)) mod 6 = 0) then
-- Without row scaling, we get overflows if matrix is too large.
-- Get the right answer accurately every N steps:
Col_Norm_Squared := (others => Zero);
for r in Pivot_Row .. Final_Row loop
for c in Pivot_Col .. Final_Col loop
Col_Norm_Squared(c) := Col_Norm_Squared(c) + A(r, c)**2;
end loop;
end loop; -- fastest with Ada array convention rather than fortran.
else
-- Optimization: length of Col is invariant under rotations, so just
-- subtract away the unwanted element in Col from the old sum for Norm_Squ:
-- Norm_Squared (Col) := Norm_Squared (Col) - A(Pivot_Row-1, Col)**2;
-- Has bad accuracy.
for c in Pivot_Col .. Final_Col loop
Col_Norm_Squared(c) := Col_Norm_Squared(c) - A(Pivot_Row-1, c)**2;
end loop;
end if;
Get_Id_Of_Max_Element_Of_Row
(The_Row => Col_Norm_Squared,
Starting_Col => Pivot_Col,
Final_Col => Final_Col,
Id_Of_Max_Element => New_Pivot_Col,
Val_of_Max_Element => Pivot_Val);
if New_Pivot_Col > Pivot_Col then
for r in Starting_Row .. Final_Row loop
tmp := A(r, New_Pivot_Col);
A(r, New_Pivot_Col) := A(r, Pivot_Col);
A(r, Pivot_Col) := tmp;
end loop;
tmp := Col_Norm_Squared (New_Pivot_Col);
Col_Norm_Squared(New_Pivot_Col) := Col_Norm_Squared (Pivot_Col);
Col_Norm_Squared(Pivot_Col) := tmp;
tmp_index := Col_Permutation(New_Pivot_Col);
Col_Permutation(New_Pivot_Col) := Col_Permutation(Pivot_Col);
Col_Permutation(Pivot_Col) := tmp_index;
end if;
end Do_Column_Pivoting;
begin
-- Important Inits.
Q.Rot := (others => (others => Identity));
Q.P_bigger_than_L := (others => (others => True));
Q.Final_Row := Final_Row;
Q.Final_Col := Final_Col;
Q.Starting_Row := Starting_Row;
Q.Starting_Col := Starting_Col;
Row_Scalings := (others => One); -- important init
for j in C_Index loop
Col_Permutation(j) := j;
end loop;
if No_Of_Cols > No_of_Rows then
raise Ada.Numerics.Argument_Error with "Can't have more columns than rows.";
end if;
if No_Of_Cols < 2.0 then
raise Ada.Numerics.Argument_Error with "Need at least 2 columns in matrix.";
end if;
-- Step 1. Column Scaling. Scaling prevents overflow when 2-norms are calculated.
if Scaling_Desired then
Scale_Rows
(Row_Scalings => Row_Scalings,
Starting_Col => Starting_Col,
Final_Col => Final_Col,
Starting_Row => Starting_Row,
Final_Row => Final_Row);
end if;
-- Start the QR decomposition
Pivot_Row := Starting_Row; -- essential init.
for Pivot_Col in Starting_Col .. Final_Col loop
if Pivoting_Desired then
Do_Column_Pivoting
(Starting_Col => Starting_Col,
Final_Col => Final_Col,
Starting_Row => Starting_Row,
Final_Row => Final_Row,
Pivot_Col => Pivot_Col,
Col_Permutation => Col_Permutation,
Col_Norm_Squared => Norm_Squ_of_Col_of_A);
end if; -- pivoting_desired
if Pivot_Row < Final_Row then
for Low_Row in Pivot_Row+1 .. Final_Row loop
Rotate_Rows_to_Zero_Out_Element_Lo_of_pCol
(pCol => Pivot_Col, -- Element to zero out is A(Lo_Row, pCol)
Hi_Row => Pivot_Row, -- High to the eye; its id is lower than Lo_Row's.
Lo_Row => Low_Row);
A(Low_Row, Pivot_Col) := Zero;
end loop; -- over Low_Row
end if; -- Pivot_Row < Final_Row
if Pivot_Row < Final_Row then Pivot_Row := Pivot_Row + 1; end if;
-- We are always finished if Pivot_Row = Final_Row because have M rows >= N cols
end loop; -- over Pivot_Col
-- To unscale the R matrix (A) you scale the Cols of A=R w/ Inv_Row_Scalings(Col).
-- Bad idea because the scaled R=A has diag elements in monotonic decreasing order.
end QR_Decompose;
--------------------
-- Q_x_Col_Vector --
--------------------
-- Get Product = Q*B
--
-- Apply the inverses of all the 2x2 rotation matrices in the order opposite to the
-- order in which they were created: Start w/ most recent and wrk backwards in time.
function Q_x_Col_Vector
(Q : in Q_Matrix;
B : in Col_Vector)
return Col_Vector
is
Product : Col_Vector;
Final_Row : R_Index renames Q.Final_Row;
Final_Col : C_Index renames Q.Final_Col;
Starting_Row : R_Index renames Q.Starting_Row;
Starting_Col : C_Index renames Q.Starting_Col;
Pivot_Row : R_Index := Starting_Row;
P_is_the_Bigger : Boolean;
begin
-- The loop bounds reflect the design of Q. Q is stored in
-- matrix A, which was defined to be M x N via Starting_Row,
-- Starting_Col, etc.
Product := B;
Pivot_Row := R_Index (Int64(Final_Col) + Int64(Starting_Row) - Int64(Starting_Col));
for Pivot_Col in reverse Starting_Col .. Final_Col loop
if Pivot_Row < Final_Row then
for Low_Row in reverse Pivot_Row+1 .. Final_Row loop
P_is_the_bigger := Q.P_bigger_than_L (Low_Row, Pivot_Col);
Inverse_Rotate_Col_Vector
(Product, Low_Row, Pivot_Row, Q.Rot(Low_Row, Pivot_Col), P_is_the_bigger);
end loop;
end if;
if Pivot_Row > Starting_Row then Pivot_Row := Pivot_Row - 1; end if;
end loop;
return Product;
end Q_x_Col_Vector;
------------------------------
-- Q_transpose_x_Col_Vector --
------------------------------
-- Get Product = Q'*B
--
-- Apply the the 2x2 rotation matrices in the order in which they were created.
-- Start w/ oldest and wrk forwards in time.
function Q_transpose_x_Col_Vector
(Q : in Q_Matrix;
B : in Col_Vector)
return Col_Vector
is
Product : Col_Vector;
Final_Row : R_Index renames Q.Final_Row;
Final_Col : C_Index renames Q.Final_Col;
Starting_Row : R_Index renames Q.Starting_Row;
Starting_Col : C_Index renames Q.Starting_Col;
Pivot_Row : R_Index := Starting_Row;
P_is_the_bigger : Boolean;
begin
-- The loop bounds reflect the design of Q. Q is stored in
-- matrix A, which was defined to be M x N via Starting_Row,
-- Starting_Col, etc.
Product := B;
Pivot_Row := Starting_Row;
for Pivot_Col in Starting_Col .. Final_Col loop
if Pivot_Row < Final_Row then
for Low_Row in Pivot_Row+1 .. Final_Row loop
P_is_the_bigger := Q.P_bigger_than_L (Low_Row, Pivot_Col);
Rotate_Col_Vector (Product, Low_Row, Pivot_Row,
Q.Rot(Low_Row, Pivot_Col), P_is_the_bigger);
end loop;
Pivot_Row := Pivot_Row + 1;
end if;
end loop;
return Product;
end Q_transpose_x_Col_Vector;
--------------
-- QR_Solve --
--------------
-- A*X = B.
-- S*A*P = Q*R where S is diagonal matrix of row scalings; P permutes cols.
-- So X = P*R^(-1)*Q'*S*B where Q is orthogonal, so Q' = Q^(-1).
procedure QR_Solve
(X : out Row_Vector;
B : in Col_Vector;
R : in A_Matrix; -- We overwrote A with R, so input A here.
Q : in Q_Matrix;
Row_Scalings : in Col_Vector;
Col_Permutation : in Permutation;
Singularity_Cutoff : in Real := Default_Singularity_Cutoff)
is
Final_Row : R_Index renames Q.Final_Row;
Final_Col : C_Index renames Q.Final_Col;
Starting_Row : R_Index renames Q.Starting_Row;
Starting_Col : C_Index renames Q.Starting_Col;
Max_R_Diagonal_Val : constant Real := Abs R(Starting_Row, Starting_Col);
R_Diagonal_Inv : Row_Vector;
Sum : Real;
B1, B2 : Col_Vector;
B0, X0 : Row_Vector;
Row : R_Index := Starting_Row;
begin
-- X = P * R_inverse * Q' * S * B where diagonal matrix S scaled the rows of A
for i in R_Index loop
B2(i) := Row_Scalings(i) * B(i); -- Row_Scalings was initialized to 1.
end loop;
-- X is out, so init:
for j in C_Index loop
X(j) := Zero;
X0(j) := Zero;
end loop;
-- Get B1 = Q'*B2
B1 := Q_transpose_x_Col_Vector (Q, B2);
-- put Column B1 into a row B0 of A (ie indexed by C_Index):
for i in Starting_Col .. Final_Col loop
Row := R_Index(Int64 (i-Starting_Col) + Int64(Starting_Row));
B0(i) := B1(Row);
end loop;
-- Now R*X0 = B0; solve for X0.
-- No_of_Rows >= No_of_Cols. We stop at Final_Col, so
-- effectively we are assuming that R is square (upper triangular actually).
Row := Starting_Row;
for Col in Starting_Col .. Final_Col loop
if Abs R(Row,Col) < Abs (Singularity_Cutoff * Max_R_Diagonal_Val) or
Abs R(Row,Col) < Min_Allowed_Real then
R_Diagonal_Inv(Col) := Zero;
else
R_Diagonal_Inv(Col) := One / R(Row,Col);
end if;
if Row < Final_Row then Row := Row + 1; end if;
end loop;
X0(Final_Col) := B0(Final_Col) * R_Diagonal_Inv(Final_Col);
if Final_Col > Starting_Col then
for Col in reverse Starting_Col .. Final_Col-1 loop
Row := R_Index (Int64 (Col-Starting_Col) + Int64 (Starting_Row));
Sum := Zero;
for j in Col+1 .. Final_Col loop
Sum := Sum + R(Row, j) * X0(j);
end loop;
X0(Col) := (B0(Col) - Sum) * R_Diagonal_Inv(Col);
end loop;
end if;
for i in C_Index loop
X(Col_Permutation(i)) := X0(i);
end loop;
-- x = S * P * R_inverse * Q' * B
end QR_Solve;
------------------
-- Q_x_V_Matrix --
------------------
-- Get Product = Q*V
-- The columns of V are vectors indexed by R_index.
-- Not Q' times Matrix V but Q*V, so
-- apply the inverses of all the 2x2 rotation matrices in the order opposite to the
-- order in which they were created: Start w/ most recent and wrk backwards in time.
-- The columns of V must be same length as Columns of original matrix A, (hence Q).
-- The number of these Cols is unimportant (set statically: V is a generic formal).
-- Q is MxM: No_of_Rows x No_of_Rows, since Q*R = A, and R has shape of A.
procedure Q_x_V_Matrix
(Q : in Q_Matrix;
V : in out V_Matrix)
is
Final_Row : R_Index renames Q.Final_Row;
Final_Col : C_Index renames Q.Final_Col;
Starting_Row : R_Index renames Q.Starting_Row;
Starting_Col : C_Index renames Q.Starting_Col;
s, c : Real;
V_pvt, V_Low : Real;
Pivot_Row : R_Index := Starting_Row;
begin
-- The loop bounds reflect the design of Q. Q is stored in
-- matrix A, which was defined to be M x N via Starting_Row,
-- Starting_Col, etc.
Pivot_Row := R_Index (Integer(Final_Col)
+ Integer (Starting_Row) - Integer(Starting_Col));
-- The following 2 loops range over all the 2x2 rotation matrices in Q.
-- Each 2x2 rotates 2 Row_Vectors of V.
-- The columns of V must be same length as Columns of original matrix A, (hence Q).
for Pivot_Col in reverse Starting_Col .. Final_Col loop
if Pivot_Row < Final_Row then
for Low_Row in reverse Pivot_Row+1 .. Final_Row loop
s := Q.Rot(Low_Row, Pivot_Col).Sine;
c := Q.Rot(Low_Row, Pivot_Col).Cosine;
if Q.P_bigger_than_L(Low_Row, Pivot_Col) then --abs A(piv,piv )> abs A(low,piv)
--if abs s > Zero then -- rot isn't identity: use fact c is always positive.
for Col in V'Range(2) loop
V_pvt := V(Pivot_Row, Col);
V_Low := V(Low_Row, Col);
V(Pivot_Row, Col) := V_pvt - s*(-c*V_pvt + V_Low);
V(Low_Row, Col) := V_Low - s*( -V_pvt - c*V_Low);
end loop;
--end if;
else
for Col in V'Range(2) loop
V_pvt := V(Pivot_Row, Col);
V_Low := V(Low_Row, Col);
V(Pivot_Row, Col) :=-V_Low + c*( V_Pvt - s*V_Low);
V(Low_Row, Col) := V_Pvt + c*(+s*V_Pvt + V_Low);
end loop;
end if;
end loop; -- Low_Row in Final_Row to Pivot_Row+1
end if;
if Pivot_Row > Starting_Row then Pivot_Row := Pivot_Row - 1; end if;
end loop;
end Q_x_V_Matrix;
----------------------------
-- Q_transpose_x_V_Matrix --
----------------------------
-- Get Product = Q'*V
--
-- Apply the the 2x2 rotation matrices in the order in which they were created.
-- Start w/ oldest and wrk forwards in time. Use the same rotation used to
-- create R (ie the actual rotation stored on Q, not its inverse.
-- Q really contains Q_transpose.)
--
-- The columns of V are vectors indexed by R_index.
-- The columns of V must be same length as Columns of original matrix A, (hence Q).
-- The number of these Cols is unimportant (set statically: V is a generic formal).
-- Q is MxM: No_of_Rows x No_of_Rows, (since Q*R = A, and R has shape of A).
--
procedure Q_transpose_x_V_Matrix
(Q : in Q_Matrix;
V : in out V_Matrix)
is
Final_Row : R_Index renames Q.Final_Row;
Final_Col : C_Index renames Q.Final_Col;
Starting_Row : R_Index renames Q.Starting_Row;
Starting_Col : C_Index renames Q.Starting_Col;
s, c : Real;
V_pvt, V_Low : Real;
Pivot_Row : R_Index := Starting_Row;
begin
-- The loop bounds reflect the design of Q. Q is stored in
-- matrix A, which was defined to be M x N via Starting_Row,
-- Starting_Col, etc.
-- The following 2 loops range over all the 2x2 rotation matrices in Q.
-- Each 2x2 rotates 2 Row_Vectors of V.
-- The columns of V must be same length as Columns of original matrix A, (hence Q).
Pivot_Row := Starting_Row;
for Pivot_Col in Starting_Col .. Final_Col loop
if Pivot_Row < Final_Row then
for Low_Row in Pivot_Row+1 .. Final_Row loop
s := Q.Rot(Low_Row, Pivot_Col).Sine;
c := Q.Rot(Low_Row, Pivot_Col).Cosine;
if Q.P_bigger_than_L(Low_Row, Pivot_Col) then --abs A(piv,piv )> abs A(low,piv)
--if abs s > Zero then -- rot not identity: use fact c is always positive.
for Col in V'Range(2) loop
V_pvt := V(Pivot_Row, Col);
V_Low := V(Low_Row, Col);
V(Pivot_Row, Col) := V_pvt + s*(c*V_pvt + V_Low);
V(Low_Row, Col) := V_Low + s*( -V_pvt + c*V_Low);
end loop;
--end if;
else
for Col in V'Range(2) loop
V_pvt := V(Pivot_Row, Col);
V_Low := V(Low_Row, Col);
V(Pivot_Row, Col) := V_Low + c*( V_Pvt + s*V_Low);
V(Low_Row, Col) :=-V_Pvt + c*(-s*V_Pvt + V_Low);
end loop;
end if;
end loop;
Pivot_Row := Pivot_Row + 1;
end if;
end loop;
end Q_transpose_x_V_Matrix;
--------------------
-- Q_x_Matrix --
--------------------
-- Get Product = Q*A
procedure Q_x_Matrix
(Q : in Q_Matrix;
A : in out A_Matrix)
is
B : Col_Vector := (others => Zero);
C : Col_Vector;
Final_Row : R_Index renames Q.Final_Row;
Final_Col : C_Index renames Q.Final_Col;
Starting_Row : R_Index renames Q.Starting_Row;
Starting_Col : C_Index renames Q.Starting_Col;
begin
for Col in Starting_Col .. Final_Col loop
for Row in Starting_Row .. Final_Row loop
B(Row) := A(Row, Col);
end loop;
C := Q_x_Col_Vector (Q, B);
for Row in Starting_Row .. Final_Row loop
A(Row, Col) := C(Row);
end loop;
end loop;
end Q_x_Matrix;
end Givens_QR;
|
README.agda | nad/partiality-monad | 2 | 536 | <reponame>nad/partiality-monad<gh_stars>1-10
------------------------------------------------------------------------
-- Code related to the paper "Partiality, Revisited: The Partiality
-- Monad as a Quotient Inductive-Inductive Type"
--
-- <NAME>, <NAME> and <NAME>
------------------------------------------------------------------------
-- Note that this is a version of the code that does not quite match
-- the description in the paper. Some key changes (there might be
-- others):
--
-- * The partiality monad is not postulated, but defined as a QIIT
-- (Agda's cubical features are used). The types and eliminators are
-- marked as "abstract", so the eliminators do not compute.
--
-- * Rewrite rules are no longer used. Instead the propositional
-- truncation and set quotient operators are defined as
-- (non-abstract) QITs.
--
-- * The set quotient operator that is used can be applied to
-- arbitrary binary relations, not only propositional ones.
{-# OPTIONS --cubical --sized-types #-}
module README where
-- Note that our definition of the partiality monad and some of the
-- results are heavily inspired by the section on Cauchy reals in the
-- HoTT book (first edition).
-- The partiality algebra code uses ideas and concepts from "Inductive
-- types in homotopy type theory" by Awodey, Gambino and Sojakova,
-- "Inductive Types in Homotopy Type Theory" by Sojakova, "Quotient
-- inductive-inductive types" by Altenkirch, Capriotti, Dijkstra and
-- <NAME>, and Gabe Dijkstra's PhD thesis.
------------------------------------------------------------------------
-- Pointers to results from the paper
-- In order to more easily find code corresponding to results from the
-- paper, see the following module. Note that some of the code
-- referenced below is not discussed at all in the paper.
import README.Pointers-to-results-from-the-paper
------------------------------------------------------------------------
-- Partiality algebras
-- Partiality algebras.
import Partiality-algebra
-- Some partiality algebra properties.
import Partiality-algebra.Properties
-- Partiality algebra categories.
import Partiality-algebra.Category
-- Eliminators and initiality.
import Partiality-algebra.Eliminators
-- Monotone functions.
import Partiality-algebra.Monotone
-- ω-continuous functions.
import Partiality-algebra.Omega-continuous
-- Strict ω-continuous functions.
import Partiality-algebra.Strict-omega-continuous
-- Fixpoint combinators.
import Partiality-algebra.Fixpoints
-- Pi with partiality algebra families as codomains.
import Partiality-algebra.Pi
------------------------------------------------------------------------
-- The partiality monad
-- A quotient inductive-inductive definition of the partiality monad.
import Partiality-monad.Inductive
-- Specialised eliminators.
import Partiality-monad.Inductive.Eliminators
-- A function that runs computations.
import Partiality-monad.Inductive.Approximate
-- An alternative characterisation of the information ordering, along
-- with related results.
import Partiality-monad.Inductive.Alternative-order
-- Monotone functions.
import Partiality-monad.Inductive.Monotone
-- ω-continuous functions.
import Partiality-monad.Inductive.Omega-continuous
-- The partiality monad's monad instance.
import Partiality-monad.Inductive.Monad
-- The partiality monad's monad instance, defined via an adjunction.
import Partiality-monad.Inductive.Monad.Adjunction
-- Strict ω-continuous functions.
import Partiality-monad.Inductive.Strict-omega-continuous
-- Fixpoint combinators.
import Partiality-monad.Inductive.Fixpoints
------------------------------------------------------------------------
-- Some examples
-- A function that, given a stream, tries to find an element
-- satisfying a predicate.
import Search
-- Examples involving simple λ-calculi.
import README.Lambda
------------------------------------------------------------------------
-- An alternative definition of the delay monad
-- The delay monad, defined using increasing sequences of potential
-- values.
import Delay-monad.Alternative
-- Various properties.
import Delay-monad.Alternative.Properties
-- Theorems relating the coinductive definition of the delay
-- monad to the alternative one and to another type.
import Delay-monad.Alternative.Equivalence
-- Termination predicates.
import Delay-monad.Alternative.Termination
-- Information orderings.
import Delay-monad.Alternative.Partial-order
-- Weak bisimilarity.
import Delay-monad.Alternative.Weak-bisimilarity
-- Two eliminators for Delay-monad.Alternative.Delay (A / R).
import Delay-monad.Alternative.Eliminators
------------------------------------------------------------------------
-- The delay monad quotiented by weak bisimilarity
-- The delay monad quotiented by weak bisimilarity.
import Partiality-monad.Coinductive
-- A partial order.
import Partiality-monad.Coinductive.Partial-order
-- An alternative definition of the partiality monad: a variant of the
-- delay monad quotiented by a notion of weak bisimilarity.
import Partiality-monad.Coinductive.Alternative
------------------------------------------------------------------------
-- A proof of equivalence
-- The partiality monads in Partiality-monad.Inductive and
-- Partiality-monad.Coinductive are pointwise equivalent, for sets,
-- assuming extensionality and countable choice.
import Partiality-monad.Equivalence
------------------------------------------------------------------------
-- ω-cpos
-- Pointed and non-pointed ω-cpos.
import Omega-cpo
-- The code in the following three modules is based on a suggestion
-- from <NAME>.
-- A quotient inductive-inductive definition of the lifting
-- construction on ω-cpos.
import Lifting
-- An alternative but equivalent definition of the partiality monad
-- (but only for sets), based on the lifting construction in Lifting.
import Lifting.Partiality-monad
|
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_21829_1032.asm | ljhsiun2/medusa | 9 | 244864 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x929a, %r12
nop
nop
nop
nop
add %rax, %rax
and $0xffffffffffffffc0, %r12
vmovaps (%r12), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %r9
and %r11, %r11
lea addresses_normal_ht+0x11fda, %rsi
lea addresses_A_ht+0x134da, %rdi
nop
nop
inc %r11
mov $92, %rcx
rep movsw
dec %r11
lea addresses_D_ht+0xdf5a, %rsi
lea addresses_WC_ht+0x31a, %rdi
clflush (%rdi)
cmp %r8, %r8
mov $116, %rcx
rep movsq
nop
nop
nop
xor $63332, %rdi
lea addresses_A_ht+0x1767a, %r8
sub %r11, %r11
movups (%r8), %xmm5
vpextrq $0, %xmm5, %r9
nop
nop
nop
nop
and $21478, %r11
lea addresses_WT_ht+0x148da, %rcx
nop
nop
add $65180, %rax
movups (%rcx), %xmm4
vpextrq $1, %xmm4, %r11
nop
nop
nop
nop
nop
inc %r9
lea addresses_WT_ht+0x198da, %rcx
nop
nop
nop
nop
xor $62153, %r12
mov $0x6162636465666768, %rsi
movq %rsi, %xmm0
and $0xffffffffffffffc0, %rcx
vmovntdq %ymm0, (%rcx)
nop
nop
cmp %rsi, %rsi
lea addresses_D_ht+0x113fa, %rsi
lea addresses_normal_ht+0x1063a, %rdi
nop
nop
nop
nop
nop
xor %r12, %r12
mov $124, %rcx
rep movsb
nop
nop
nop
dec %r12
lea addresses_WC_ht+0x14da, %rsi
nop
nop
nop
nop
inc %rcx
mov (%rsi), %di
add $18352, %rcx
lea addresses_normal_ht+0xa52a, %rdi
nop
sub %rax, %rax
movl $0x61626364, (%rdi)
nop
nop
nop
nop
dec %rdi
lea addresses_WT_ht+0x5048, %rdi
nop
nop
nop
nop
xor $41769, %r9
mov (%rdi), %rsi
nop
nop
xor %r11, %r11
lea addresses_UC_ht+0x15ada, %r9
nop
nop
nop
nop
nop
dec %r8
vmovups (%r9), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $0, %xmm7, %rsi
nop
nop
nop
and $45718, %rdi
lea addresses_WT_ht+0x1c96b, %rcx
nop
nop
nop
cmp $48517, %r8
movl $0x61626364, (%rcx)
nop
nop
sub $47958, %r8
lea addresses_A_ht+0x1d2da, %r9
nop
nop
nop
add $57512, %rsi
mov (%r9), %r12w
nop
dec %r12
lea addresses_WT_ht+0x110da, %rsi
lea addresses_normal_ht+0x1335a, %rdi
nop
sub $31670, %rax
mov $73, %rcx
rep movsb
and %r12, %r12
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r15
push %rdi
push %rdx
push %rsi
// Store
lea addresses_D+0x16640, %r15
nop
nop
nop
nop
nop
xor %rdi, %rdi
movw $0x5152, (%r15)
nop
nop
nop
cmp %rsi, %rsi
// Faulty Load
lea addresses_WC+0x1b8da, %r10
nop
nop
nop
nop
inc %r14
mov (%r10), %r12w
lea oracles, %r15
and $0xff, %r12
shlq $12, %r12
mov (%r15,%r12,1), %r12
pop %rsi
pop %rdx
pop %rdi
pop %r15
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': True, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': True, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 6}, 'dst': {'same': True, 'type': 'addresses_WC_ht', 'congruent': 6}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': True, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 6}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
FuckXC3/diasmm.asm | adpushpop/FuckXC3 | 87 | 83663 | <filename>FuckXC3/diasmm.asm
EXTERN jmp_ObpCreateHandle_1:QWORD;
EXTERN jmp_ObpCreateHandle_2:QWORD;
.CODE
;*************************************************************
;*************************************************************
pushaq MACRO
push r15
push r14
push r13
push r12
push r11
push r10
push r9
push r8
push rdi
push rsi
push rbp
push rbp ; rsp
push rbx
push rdx
push rcx
push rax
ENDM
;*************************************************************
;*************************************************************
;*************************************************************
;*************************************************************
popaq MACRO
pop rax
pop rcx
pop rdx
pop rbx
pop rbp ; rsp
pop rbp
pop rsi
pop rdi
pop r8
pop r9
pop r10
pop r11
pop r12
pop r13
pop r14
pop r15
ENDM
;*************************************************************
;*************************************************************
;*************************************************************
;*************************************************************
ObpCreateHandle_1 PROC
mov eax, [rbx+10h]
mov [rbx+10h], r13d
mov r9, rdx
or [rbx+14h], eax
mov rax, [rsp+0B8h]
lea rcx, [rbx+20h]
mov eax, [rax+5Ch]
pushfq
cmp eax,0
jne __ret__
mov eax,1f000fh
__ret__:
popfq
jmp jmp_ObpCreateHandle_1
ObpCreateHandle_1 ENDP
;*************************************************************
;*************************************************************
;*************************************************************
;*************************************************************
ObpCreateHandle_2 PROC
mov edx, [rsp+50h]
mov r8, [rsp+118h]
movzx eax, byte ptr [r8-18h]
lea r14, [r8-30h]
mov rbp, [r15+rax*8]
mov eax, [rbp+5Ch]
pushfq
cmp eax,0
jne __ret__
mov eax,1f000fh
__ret__:
popfq
jmp jmp_ObpCreateHandle_2
ObpCreateHandle_2 ENDP
;*************************************************************
;*************************************************************
_read_r12 PROC
mov rax,r12
ret
_read_r12 ENDP
END |
js/packages/k0-integration-tests-fabric/itermscripts/fabric_0_k0.applescript | appliedblockchain/k0 | 63 | 1749 | tell application "System Events" to keystroke "t" using command down
set tree_height to 4
tell application "iTerm"
activate
select first window
tell current session of current window
split horizontally with default profile
split horizontally with default profile
end tell
tell session 1 of current tab of current window
split vertically with default profile
split vertically with default profile
split vertically with default profile
end tell
tell session 5 of current tab of current window
split vertically with default profile
split vertically with default profile
split vertically with default profile
end tell
my start_server(1, tree_height, 11400)
my start_server(2, tree_height, 12400)
my start_server(3, tree_height, 13400)
my start_server(4, tree_height, 14400)
my start_mtserver(5, tree_height, 11410)
my start_mtserver(6, tree_height, 12410)
my start_mtserver(7, tree_height, 13410)
my start_mtserver(8, tree_height, 14410)
end tell
on start_server(session_num, tree_height, port)
my run_k0_command(session_num, "cpp/build/src/server " & tree_height & " /tmp/k0keys/commitment_pk /tmp/k0keys/commitment_vk /tmp/k0keys/addition_pk /tmp/k0keys/addition_vk /tmp/k0keys/transfer_pk /tmp/k0keys/transfer_vk /tmp/k0keys/withdrawal_pk /tmp/k0keys/withdrawal_vk /tmp/k0keys/example_pk /tmp/k0keys/example_vk " & port)
end start_server
on start_mtserver(session_num, tree_height, port)
my run_k0_command(session_num, "cpp/build/src/mtserver " & tree_height & " " & port)
end start_mtserver
on run_k0_command(session_num, cmd)
tell application "iTerm"
tell session session_num of current tab of current window
write text "cd ~/go/src/github.com/appliedblockchain/k0"
write text cmd
end tell
end tell
end run_k0_command |
agda-stdlib/src/Data/Fin/Reflection.agda | DreamLinuxer/popl21-artifact | 5 | 8942 | <reponame>DreamLinuxer/popl21-artifact
------------------------------------------------------------------------
-- The Agda standard library
--
-- Reflection utilities for Fin
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Fin.Reflection where
open import Data.Nat.Base as ℕ hiding (module ℕ)
open import Data.Fin.Base as Fin hiding (module Fin)
open import Data.List.Base
open import Reflection.Term
open import Reflection.Argument
------------------------------------------------------------------------
-- Term
toTerm : ∀ {n} → Fin n → Term
toTerm zero = con (quote Fin.zero) (1 ⋯⟅∷⟆ [])
toTerm (suc i) = con (quote Fin.suc) (1 ⋯⟅∷⟆ toTerm i ⟨∷⟩ [])
|
Cubical/HITs/SetTruncation/Properties.agda | Edlyr/cubical | 0 | 17028 | {-
This file contains:
- Properties of set truncations
-}
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.SetTruncation.Properties where
open import Cubical.HITs.SetTruncation.Base
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.GroupoidLaws
open import Cubical.Foundations.Function
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Univalence
open import Cubical.Data.Sigma
open import Cubical.HITs.PropositionalTruncation
renaming (rec to pRec ; elim to pElim) hiding (elim2 ; elim3 ; rec2 ; map)
private
variable
ℓ ℓ' ℓ'' : Level
A B C D : Type ℓ
rec : isSet B → (A → B) → ∥ A ∥₂ → B
rec Bset f ∣ x ∣₂ = f x
rec Bset f (squash₂ x y p q i j) =
Bset _ _ (cong (rec Bset f) p) (cong (rec Bset f) q) i j
rec2 : isSet C → (A → B → C) → ∥ A ∥₂ → ∥ B ∥₂ → C
rec2 Cset f ∣ x ∣₂ ∣ y ∣₂ = f x y
rec2 Cset f ∣ x ∣₂ (squash₂ y z p q i j) =
Cset _ _ (cong (rec2 Cset f ∣ x ∣₂) p) (cong (rec2 Cset f ∣ x ∣₂) q) i j
rec2 Cset f (squash₂ x y p q i j) z =
Cset _ _ (cong (λ a → rec2 Cset f a z) p) (cong (λ a → rec2 Cset f a z) q) i j
-- Old version:
-- rec2 Cset f = rec (isSetΠ λ _ → Cset) λ x → rec Cset (f x)
-- lemma 6.9.1 in HoTT book
elim : {B : ∥ A ∥₂ → Type ℓ}
(Bset : (x : ∥ A ∥₂) → isSet (B x))
(f : (a : A) → B (∣ a ∣₂))
(x : ∥ A ∥₂) → B x
elim Bset f ∣ a ∣₂ = f a
elim Bset f (squash₂ x y p q i j) =
isOfHLevel→isOfHLevelDep 2 Bset _ _
(cong (elim Bset f) p) (cong (elim Bset f) q) (squash₂ x y p q) i j
elim2 : {C : ∥ A ∥₂ → ∥ B ∥₂ → Type ℓ}
(Cset : ((x : ∥ A ∥₂) (y : ∥ B ∥₂) → isSet (C x y)))
(f : (a : A) (b : B) → C ∣ a ∣₂ ∣ b ∣₂)
(x : ∥ A ∥₂) (y : ∥ B ∥₂) → C x y
elim2 Cset f ∣ x ∣₂ ∣ y ∣₂ = f x y
elim2 Cset f ∣ x ∣₂ (squash₂ y z p q i j) =
isOfHLevel→isOfHLevelDep 2 (λ a → Cset ∣ x ∣₂ a) _ _
(cong (elim2 Cset f ∣ x ∣₂) p) (cong (elim2 Cset f ∣ x ∣₂) q) (squash₂ y z p q) i j
elim2 Cset f (squash₂ x y p q i j) z =
isOfHLevel→isOfHLevelDep 2 (λ a → Cset a z) _ _
(cong (λ a → elim2 Cset f a z) p) (cong (λ a → elim2 Cset f a z) q) (squash₂ x y p q) i j
-- Old version:
-- elim2 Cset f = elim (λ _ → isSetΠ (λ _ → Cset _ _))
-- (λ a → elim (λ _ → Cset _ _) (f a))
-- TODO: generalize
elim3 : {B : (x y z : ∥ A ∥₂) → Type ℓ}
(Bset : ((x y z : ∥ A ∥₂) → isSet (B x y z)))
(g : (a b c : A) → B ∣ a ∣₂ ∣ b ∣₂ ∣ c ∣₂)
(x y z : ∥ A ∥₂) → B x y z
elim3 Bset g = elim2 (λ _ _ → isSetΠ (λ _ → Bset _ _ _))
(λ a b → elim (λ _ → Bset _ _ _) (g a b))
-- the recursor for maps into groupoids following the "HIT proof" in:
-- https://arxiv.org/abs/1507.01150
-- i.e. for any type A and groupoid B we can construct a map ∥ A ∥₂ → B
-- from a map A → B satisfying the condition
-- ∀ (a b : A) (p q : a ≡ b) → cong f p ≡ cong f q
-- TODO: prove that this is an equivalence
module rec→Gpd {A : Type ℓ} {B : Type ℓ'} (Bgpd : isGroupoid B) (f : A → B)
(congFConst : ∀ (a b : A) (p q : a ≡ b) → cong f p ≡ cong f q) where
data H : Type ℓ where
η : A → H
ε : ∀ (a b : A) → ∥ a ≡ b ∥ → η a ≡ η b -- prop. trunc. of a≡b
δ : ∀ (a b : A) (p : a ≡ b) → ε a b ∣ p ∣ ≡ cong η p
gtrunc : isGroupoid H
-- write elimination principle for H
module Helim {P : H → Type ℓ''} (Pgpd : ∀ h → isGroupoid (P h))
(η* : (a : A) → P (η a))
(ε* : ∀ (a b : A) (∣p∣ : ∥ a ≡ b ∥)
→ PathP (λ i → P (ε a b ∣p∣ i)) (η* a) (η* b))
(δ* : ∀ (a b : A) (p : a ≡ b)
→ PathP (λ i → PathP (λ j → P (δ a b p i j)) (η* a) (η* b))
(ε* a b ∣ p ∣) (cong η* p)) where
fun : (h : H) → P h
fun (η a) = η* a
fun (ε a b ∣p∣ i) = ε* a b ∣p∣ i
fun (δ a b p i j) = δ* a b p i j
fun (gtrunc x y p q α β i j k) = isOfHLevel→isOfHLevelDep 3 Pgpd
(fun x) (fun y)
(cong fun p) (cong fun q)
(cong (cong fun) α) (cong (cong fun) β)
(gtrunc x y p q α β) i j k
module Hrec {C : Type ℓ''} (Cgpd : isGroupoid C)
(η* : A → C)
(ε* : ∀ (a b : A) → ∥ a ≡ b ∥ → η* a ≡ η* b)
(δ* : ∀ (a b : A) (p : a ≡ b) → ε* a b ∣ p ∣ ≡ cong η* p) where
fun : H → C
fun (η a) = η* a
fun (ε a b ∣p∣ i) = ε* a b ∣p∣ i
fun (δ a b p i j) = δ* a b p i j
fun (gtrunc x y p q α β i j k) = Cgpd (fun x) (fun y) (cong fun p) (cong fun q)
(cong (cong fun) α) (cong (cong fun) β) i j k
module HelimProp {P : H → Type ℓ''} (Pprop : ∀ h → isProp (P h))
(η* : (a : A) → P (η a)) where
fun : ∀ h → P h
fun = Helim.fun (λ _ → isSet→isGroupoid (isProp→isSet (Pprop _))) η*
(λ a b ∣p∣ → isOfHLevel→isOfHLevelDep 1 Pprop _ _ (ε a b ∣p∣))
λ a b p → isOfHLevel→isOfHLevelDep 1
{B = λ p → PathP (λ i → P (p i)) (η* a) (η* b)}
(λ _ → isOfHLevelPathP 1 (Pprop _) _ _) _ _ (δ a b p)
-- The main trick: eliminating into hsets is easy
-- i.e. H has the universal property of set truncation...
module HelimSet {P : H → Type ℓ''} (Pset : ∀ h → isSet (P h))
(η* : ∀ a → P (η a)) where
fun : (h : H) → P h
fun = Helim.fun (λ _ → isSet→isGroupoid (Pset _)) η* ε*
λ a b p → isOfHLevel→isOfHLevelDep 1
{B = λ p → PathP (λ i → P (p i)) (η* a) (η* b)}
(λ _ → isOfHLevelPathP' 1 (Pset _) _ _) _ _ (δ a b p)
where
ε* : (a b : A) (∣p∣ : ∥ a ≡ b ∥) → PathP (λ i → P (ε a b ∣p∣ i)) (η* a) (η* b)
ε* a b = pElim (λ _ → isOfHLevelPathP' 1 (Pset _) (η* a) (η* b))
λ p → subst (λ x → PathP (λ i → P (x i)) (η* a) (η* b))
(sym (δ a b p)) (cong η* p)
-- Now we need to prove that H is a set.
-- We start with a little lemma:
localHedbergLemma : {X : Type ℓ''} (P : X → Type ℓ'')
→ (∀ x → isProp (P x))
→ ((x : X) → P x → (y : X) → P y → x ≡ y)
--------------------------------------------------
→ (x : X) → P x → (y : X) → isProp (x ≡ y)
localHedbergLemma {X = X} P Pprop P→≡ x px y = isPropRetract
(λ p → subst P p px) (λ py → sym (P→≡ x px x px) ∙ P→≡ x px y py)
isRetract (Pprop y)
where
isRetract : (p : x ≡ y) → (sym (P→≡ x px x px)) ∙ P→≡ x px y (subst P p px) ≡ p
isRetract = J (λ y' p' → (sym (P→≡ x px x px)) ∙ P→≡ x px y' (subst P p' px) ≡ p')
(subst (λ px' → sym (P→≡ x px x px) ∙ P→≡ x px x px' ≡ refl)
(sym (substRefl {B = P} px)) (lCancel (P→≡ x px x px)))
Hset : isSet H
Hset = HelimProp.fun (λ _ → isPropΠ λ _ → isPropIsProp) baseCaseLeft
where
baseCaseLeft : (a₀ : A) (y : H) → isProp (η a₀ ≡ y)
baseCaseLeft a₀ = localHedbergLemma (λ x → Q x .fst) (λ x → Q x .snd) Q→≡ _ ∣ refl ∣
where
Q : H → hProp ℓ
Q = HelimSet.fun (λ _ → isSetHProp) λ b → ∥ a₀ ≡ b ∥ , propTruncIsProp
-- Q (η b) = ∥ a ≡ b ∥
Q→≡ : (x : H) → Q x .fst → (y : H) → Q y .fst → x ≡ y
Q→≡ = HelimSet.fun (λ _ → isSetΠ3 λ _ _ _ → gtrunc _ _)
λ a p → HelimSet.fun (λ _ → isSetΠ λ _ → gtrunc _ _)
λ b q → sym (ε a₀ a p) ∙ ε a₀ b q
-- our desired function will split through H,
-- i.e. we get a function ∥ A ∥₂ → H → B
fun : ∥ A ∥₂ → B
fun = f₁ ∘ f₂
where
f₁ : H → B
f₁ = Hrec.fun Bgpd f εᶠ λ _ _ _ → refl
where
εᶠ : (a b : A) → ∥ a ≡ b ∥ → f a ≡ f b
εᶠ a b = rec→Set (Bgpd _ _) (cong f) λ p q → congFConst a b p q
-- this is the inductive step,
-- we use that maps ∥ A ∥ → B for an hset B
-- correspond to 2-Constant maps A → B (which cong f is by assumption)
f₂ : ∥ A ∥₂ → H
f₂ = rec Hset η
map : (A → B) → ∥ A ∥₂ → ∥ B ∥₂
map f = rec squash₂ λ x → ∣ f x ∣₂
setTruncUniversal : isSet B → (∥ A ∥₂ → B) ≃ (A → B)
setTruncUniversal {B = B} Bset =
isoToEquiv (iso (λ h x → h ∣ x ∣₂) (rec Bset) (λ _ → refl) rinv)
where
rinv : (f : ∥ A ∥₂ → B) → rec Bset (λ x → f ∣ x ∣₂) ≡ f
rinv f i x =
elim (λ x → isProp→isSet (Bset (rec Bset (λ x → f ∣ x ∣₂) x) (f x)))
(λ _ → refl) x i
setTruncIsSet : isSet ∥ A ∥₂
setTruncIsSet a b p q = squash₂ a b p q
setTruncIdempotentIso : isSet A → Iso ∥ A ∥₂ A
Iso.fun (setTruncIdempotentIso hA) = rec hA (idfun _)
Iso.inv (setTruncIdempotentIso hA) x = ∣ x ∣₂
Iso.rightInv (setTruncIdempotentIso hA) _ = refl
Iso.leftInv (setTruncIdempotentIso hA) = elim (λ _ → isSet→isGroupoid setTruncIsSet _ _) (λ _ → refl)
setTruncIdempotent≃ : isSet A → ∥ A ∥₂ ≃ A
setTruncIdempotent≃ {A = A} hA = isoToEquiv (setTruncIdempotentIso hA)
setTruncIdempotent : isSet A → ∥ A ∥₂ ≡ A
setTruncIdempotent hA = ua (setTruncIdempotent≃ hA)
isContr→isContrSetTrunc : isContr A → isContr (∥ A ∥₂)
isContr→isContrSetTrunc contr = ∣ fst contr ∣₂
, elim (λ _ → isOfHLevelPath 2 (setTruncIsSet) _ _)
λ a → cong ∣_∣₂ (snd contr a)
setTruncIso : Iso A B → Iso ∥ A ∥₂ ∥ B ∥₂
Iso.fun (setTruncIso is) = rec setTruncIsSet (λ x → ∣ Iso.fun is x ∣₂)
Iso.inv (setTruncIso is) = rec setTruncIsSet (λ x → ∣ Iso.inv is x ∣₂)
Iso.rightInv (setTruncIso is) =
elim (λ _ → isOfHLevelPath 2 setTruncIsSet _ _)
λ a → cong ∣_∣₂ (Iso.rightInv is a)
Iso.leftInv (setTruncIso is) =
elim (λ _ → isOfHLevelPath 2 setTruncIsSet _ _)
λ a → cong ∣_∣₂ (Iso.leftInv is a)
setSigmaIso : {B : A → Type ℓ} → Iso ∥ Σ A B ∥₂ ∥ Σ A (λ x → ∥ B x ∥₂) ∥₂
setSigmaIso {A = A} {B = B} = iso fun funinv sect retr
where
{- writing it out explicitly to avoid yellow highlighting -}
fun : ∥ Σ A B ∥₂ → ∥ Σ A (λ x → ∥ B x ∥₂) ∥₂
fun = rec setTruncIsSet λ {(a , p) → ∣ a , ∣ p ∣₂ ∣₂}
funinv : ∥ Σ A (λ x → ∥ B x ∥₂) ∥₂ → ∥ Σ A B ∥₂
funinv = rec setTruncIsSet (λ {(a , p) → rec setTruncIsSet (λ p → ∣ a , p ∣₂) p})
sect : section fun funinv
sect = elim (λ _ → isOfHLevelPath 2 setTruncIsSet _ _)
λ { (a , p) → elim {B = λ p → fun (funinv ∣ a , p ∣₂) ≡ ∣ a , p ∣₂}
(λ p → isOfHLevelPath 2 setTruncIsSet _ _) (λ _ → refl) p }
retr : retract fun funinv
retr = elim (λ _ → isOfHLevelPath 2 setTruncIsSet _ _)
λ { _ → refl }
sigmaElim : {B : ∥ A ∥₂ → Type ℓ} {C : Σ ∥ A ∥₂ B → Type ℓ'}
(Bset : (x : Σ ∥ A ∥₂ B) → isSet (C x))
(g : (a : A) (b : B ∣ a ∣₂) → C (∣ a ∣₂ , b))
(x : Σ ∥ A ∥₂ B) → C x
sigmaElim {B = B} {C = C} set g (x , y) =
elim {B = λ x → (y : B x) → C (x , y)} (λ _ → isSetΠ λ _ → set _) g x y
sigmaProdElim : {C : ∥ A ∥₂ × ∥ B ∥₂ → Type ℓ} {D : Σ (∥ A ∥₂ × ∥ B ∥₂) C → Type ℓ'}
(Bset : (x : Σ (∥ A ∥₂ × ∥ B ∥₂) C) → isSet (D x))
(g : (a : A) (b : B) (c : C (∣ a ∣₂ , ∣ b ∣₂)) → D ((∣ a ∣₂ , ∣ b ∣₂) , c))
(x : Σ (∥ A ∥₂ × ∥ B ∥₂) C) → D x
sigmaProdElim {B = B} {C = C} {D = D} set g ((x , y) , c) =
elim {B = λ x → (y : ∥ B ∥₂) (c : C (x , y)) → D ((x , y) , c)}
(λ _ → isSetΠ λ _ → isSetΠ λ _ → set _)
(λ x → elim (λ _ → isSetΠ λ _ → set _) (g x))
x y c
prodElim : {C : ∥ A ∥₂ × ∥ B ∥₂ → Type ℓ}
→ ((x : ∥ A ∥₂ × ∥ B ∥₂) → isSet (C x))
→ ((a : A) (b : B) → C (∣ a ∣₂ , ∣ b ∣₂))
→ (x : ∥ A ∥₂ × ∥ B ∥₂) → C x
prodElim setC f (a , b) = elim2 (λ x y → setC (x , y)) f a b
prodRec : {C : Type ℓ} → isSet C → (A → B → C) → ∥ A ∥₂ × ∥ B ∥₂ → C
prodRec setC f (a , b) = rec2 setC f a b
prodElim2 : {E : (∥ A ∥₂ × ∥ B ∥₂) → (∥ C ∥₂ × ∥ D ∥₂) → Type ℓ}
→ ((x : ∥ A ∥₂ × ∥ B ∥₂) (y : ∥ C ∥₂ × ∥ D ∥₂) → isSet (E x y))
→ ((a : A) (b : B) (c : C) (d : D) → E (∣ a ∣₂ , ∣ b ∣₂) (∣ c ∣₂ , ∣ d ∣₂))
→ ((x : ∥ A ∥₂ × ∥ B ∥₂) (y : ∥ C ∥₂ × ∥ D ∥₂) → (E x y))
prodElim2 isset f = prodElim (λ _ → isSetΠ λ _ → isset _ _)
λ a b → prodElim (λ _ → isset _ _)
λ c d → f a b c d
setTruncOfProdIso : Iso ∥ A × B ∥₂ (∥ A ∥₂ × ∥ B ∥₂)
Iso.fun setTruncOfProdIso = rec (isSet× setTruncIsSet setTruncIsSet) λ { (a , b) → ∣ a ∣₂ , ∣ b ∣₂ }
Iso.inv setTruncOfProdIso = prodRec setTruncIsSet λ a b → ∣ a , b ∣₂
Iso.rightInv setTruncOfProdIso =
prodElim (λ _ → isOfHLevelPath 2 (isSet× setTruncIsSet setTruncIsSet) _ _) λ _ _ → refl
Iso.leftInv setTruncOfProdIso =
elim (λ _ → isOfHLevelPath 2 setTruncIsSet _ _) λ {(a , b) → refl}
IsoSetTruncateSndΣ : {A : Type ℓ} {B : A → Type ℓ'} → Iso ∥ Σ A B ∥₂ ∥ Σ A (λ x → ∥ B x ∥₂) ∥₂
Iso.fun IsoSetTruncateSndΣ = map λ a → (fst a) , ∣ snd a ∣₂
Iso.inv IsoSetTruncateSndΣ = rec setTruncIsSet (uncurry λ x → map λ b → x , b)
Iso.rightInv IsoSetTruncateSndΣ =
elim (λ _ → isOfHLevelPath 2 setTruncIsSet _ _)
(uncurry λ a → elim (λ _ → isOfHLevelPath 2 setTruncIsSet _ _)
λ _ → refl)
Iso.leftInv IsoSetTruncateSndΣ =
elim (λ _ → isOfHLevelPath 2 setTruncIsSet _ _)
λ _ → refl
PathIdTrunc₀Iso : {a b : A} → Iso (∣ a ∣₂ ≡ ∣ b ∣₂) ∥ a ≡ b ∥
Iso.fun (PathIdTrunc₀Iso {b = b}) p =
transport (λ i → rec {B = TypeOfHLevel _ 1} (isOfHLevelTypeOfHLevel 1)
(λ a → ∥ a ≡ b ∥ , squash) (p (~ i)) .fst)
∣ refl ∣
Iso.inv PathIdTrunc₀Iso = pRec (squash₂ _ _) (cong ∣_∣₂)
Iso.rightInv PathIdTrunc₀Iso _ = squash _ _
Iso.leftInv PathIdTrunc₀Iso _ = squash₂ _ _ _ _
|
constants.6502.asm | mikroman/lib-acorn-bbc-main_KICK | 0 | 94383 | <reponame>mikroman/lib-acorn-bbc-main_KICK
#importonce
//#import "macros.6502.asm"
//
// title: bbc micro constants
// author: <NAME>
// created: 29/10/2020
// last updated: 29/10/2020
//
// requires: macros
//
// modinfo:
//
.label oswrch = $ffee
.label osrdch = $ffe0
.label osbyte = $fff4
.label osword = $fff1
.label screen = $3000
.label chrset = $c000 // rom character set
.label zp = $70 // start of usable zero page
.label r0 = zp + 0 // general purpose registers
.label r1 = zp + 1
.label r2 = zp + 2
.label r3 = zp + 3
.label r4 = zp + 4
.label r5 = zp + 5
.label r6 = zp + 6
.label r7 = zp + 7
.label r8 = zp + 8
.label r9 = zp + 9
.label sl = zp + 10 // used to store the screen address only
.label sh = zp + 11
.label px = zp + 12 // used to store pixel position only
.label py = zp + 13
.label pc = zp + 14 // and pixel colour
|
programs/oeis/200/A200439.asm | jmorken/loda | 1 | 170604 | ; A200439: Decimal expansion of constant arising in clubbed binomial approximation for the lightbulb process.
; 2,7,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3
mov $1,2
lpb $0
mov $2,$0
sub $0,1
mul $0,2
add $1,1
add $3,$2
sub $3,1
trn $0,$3
trn $1,$3
mul $1,2
add $1,1
mov $3,$1
lpe
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_79_1490.asm | ljhsiun2/medusa | 9 | 95230 | <filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_79_1490.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r15
push %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0xa58d, %rsi
lea addresses_WC_ht+0xd4ad, %rdi
nop
nop
cmp %rax, %rax
mov $84, %rcx
rep movsq
nop
nop
nop
nop
inc %rdi
lea addresses_UC_ht+0x1d1d5, %rsi
lea addresses_UC_ht+0x96ed, %rdi
nop
nop
nop
nop
add $32277, %r10
mov $100, %rcx
rep movsq
nop
nop
nop
nop
xor $848, %rcx
lea addresses_D_ht+0x1620d, %r10
nop
nop
nop
nop
inc %rcx
mov (%r10), %di
nop
nop
nop
add %r10, %r10
lea addresses_WC_ht+0x111ed, %rax
nop
nop
nop
cmp %r8, %r8
movb $0x61, (%rax)
nop
add $42971, %rsi
lea addresses_UC_ht+0xc89d, %rcx
xor $25249, %r15
and $0xffffffffffffffc0, %rcx
vmovntdqa (%rcx), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %rdi
nop
nop
sub %r10, %r10
lea addresses_normal_ht+0xa7ed, %r15
nop
nop
nop
nop
cmp $28932, %r8
mov (%r15), %r10
dec %r10
lea addresses_WT_ht+0x161d5, %rsi
lea addresses_WC_ht+0x151ed, %rdi
nop
nop
xor %rdx, %rdx
mov $12, %rcx
rep movsw
nop
nop
nop
nop
nop
xor %r15, %r15
lea addresses_A_ht+0x1c06d, %rsi
lea addresses_A_ht+0x151ed, %rdi
nop
nop
nop
xor $25868, %r8
mov $70, %rcx
rep movsq
nop
dec %rdi
lea addresses_UC_ht+0xb1ed, %rsi
lea addresses_A_ht+0x13fed, %rdi
nop
nop
nop
xor $31813, %r8
mov $16, %rcx
rep movsq
nop
nop
nop
nop
cmp %rax, %rax
lea addresses_A_ht+0x1e6ed, %rcx
nop
nop
nop
nop
nop
add $8197, %rax
mov $0x6162636465666768, %rdi
movq %rdi, %xmm7
vmovups %ymm7, (%rcx)
nop
nop
nop
nop
nop
sub $20467, %rax
lea addresses_D_ht+0x111ed, %rdi
clflush (%rdi)
nop
nop
xor %rsi, %rsi
mov (%rdi), %ax
nop
cmp %rdi, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r15
push %r9
push %rax
push %rdi
// Load
lea addresses_A+0x1b4ed, %r12
nop
nop
nop
cmp %rax, %rax
vmovups (%r12), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %r10
nop
nop
sub $19816, %r10
// Store
mov $0x767d5c00000003ed, %r15
nop
nop
nop
nop
dec %r11
mov $0x5152535455565758, %rdi
movq %rdi, %xmm1
movntdq %xmm1, (%r15)
nop
nop
xor %r15, %r15
// Store
lea addresses_D+0x1d8ad, %rdi
nop
nop
nop
nop
nop
inc %r9
movb $0x51, (%rdi)
nop
nop
nop
nop
inc %rax
// Faulty Load
lea addresses_D+0x131ed, %r11
sub %r12, %r12
vmovups (%r11), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %r10
lea oracles, %rax
and $0xff, %r10
shlq $12, %r10
mov (%rax,%r10,1), %r10
pop %rdi
pop %rax
pop %r9
pop %r15
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 9, 'same': False, 'type': 'addresses_NC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 5, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'src': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 7, 'same': True, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'36': 79}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
Applications/Mail/Deselect All.applescript | dlh/AppleScripts | 2 | 1004 | <filename>Applications/Mail/Deselect All.applescript
tell application "Mail"
if not message viewers = {}
tell first item of message viewers
set selected messages to {}
set selected mailboxes to {}
end tell
end if
end tell
|
test/Fail/Issue1523a.agda | shlevy/agda | 3 | 7491 | <reponame>shlevy/agda<filename>test/Fail/Issue1523a.agda
-- Andreas, 2015-05-28 example by <NAME>
open import Common.Size
data Nat (i : Size) : Set where
zero : ∀ {j : Size< i} → Nat i
suc : ∀ {j : Size< i} → Nat j → Nat i
{-# TERMINATING #-}
-- This definition is fine, the termination checker is too strict at the moment.
fix : ∀ {C : Size → Set}
→ (∀{i} → (∀ {j : Size< i} → Nat j -> C j) → Nat i → C i)
→ ∀{i} → Nat i → C i
fix t zero = t (fix t) zero
fix t (suc n) = t (fix t) (suc n)
case : ∀ {i} {C : Set} (n : Nat i) (z : C) (s : ∀ {j : Size< i} → Nat j → C) → C
case zero z s = z
case (suc n) z s = s n
applyfix : ∀ {C : Size → Set} {i} (n : Nat i)
→ (∀{i} → (∀ {j : Size< i} → Nat j -> C j) → Nat i → C i)
→ C i
applyfix n f = fix f n
module M (i0 : Size) (bot : ∀{i} → Nat i) (A : Set) (default : A) where
loops : A
loops = applyfix (zero {i = ↑ i0}) λ {i} r _ →
case {i} bot default λ n → -- Size< i is possibly empty, should be rejected
case n default λ _ →
r zero
-- loops
-- --> fix t zero
-- --> t (fix t) zero
-- --> case bot default λ n → case n default λ _ → fix t zero
-- and we have reproduced (modulo sizes) what we started with
|
test.asm | tphan022/CS153assn2_p1 | 0 | 96822 |
_test: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
int n = 1;
void test_func(void * arg_ptr);
int main(int argc, char *argv[]){
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 e4 f0 and $0xfffffff0,%esp
6: 83 ec 20 sub $0x20,%esp
printf(1,"thread_create test begin\n\n");
9: c7 44 24 04 15 0b 00 movl $0xb15,0x4(%esp)
10: 00
11: c7 04 24 01 00 00 00 movl $0x1,(%esp)
18: e8 c0 04 00 00 call 4dd <printf>
printf(1,"before thread_create n = %d\n",n);
1d: a1 bc 0b 00 00 mov 0xbbc,%eax
22: 89 44 24 08 mov %eax,0x8(%esp)
26: c7 44 24 04 30 0b 00 movl $0xb30,0x4(%esp)
2d: 00
2e: c7 04 24 01 00 00 00 movl $0x1,(%esp)
35: e8 a3 04 00 00 call 4dd <printf>
int arg = 10;
3a: c7 44 24 18 0a 00 00 movl $0xa,0x18(%esp)
41: 00
void *tid = thread_create(test_func, (void *)&arg);
42: 8d 44 24 18 lea 0x18(%esp),%eax
46: 89 44 24 04 mov %eax,0x4(%esp)
4a: c7 04 24 a8 00 00 00 movl $0xa8,(%esp)
51: e8 b0 08 00 00 call 906 <thread_create>
56: 89 44 24 1c mov %eax,0x1c(%esp)
if(tid <= 0){
5a: 83 7c 24 1c 00 cmpl $0x0,0x1c(%esp)
5f: 75 38 jne 99 <main+0x99>
printf(1,"wrong happen");
61: c7 44 24 04 4d 0b 00 movl $0xb4d,0x4(%esp)
68: 00
69: c7 04 24 01 00 00 00 movl $0x1,(%esp)
70: e8 68 04 00 00 call 4dd <printf>
exit();
75: e8 ca 02 00 00 call 344 <exit>
}
while(wait()>= 0)
printf(1,"\nback to parent n = %d\n",n);
7a: a1 bc 0b 00 00 mov 0xbbc,%eax
7f: 89 44 24 08 mov %eax,0x8(%esp)
83: c7 44 24 04 5a 0b 00 movl $0xb5a,0x4(%esp)
8a: 00
8b: c7 04 24 01 00 00 00 movl $0x1,(%esp)
92: e8 46 04 00 00 call 4dd <printf>
97: eb 01 jmp 9a <main+0x9a>
void *tid = thread_create(test_func, (void *)&arg);
if(tid <= 0){
printf(1,"wrong happen");
exit();
}
while(wait()>= 0)
99: 90 nop
9a: e8 ad 02 00 00 call 34c <wait>
9f: 85 c0 test %eax,%eax
a1: 79 d7 jns 7a <main+0x7a>
printf(1,"\nback to parent n = %d\n",n);
exit();
a3: e8 9c 02 00 00 call 344 <exit>
000000a8 <test_func>:
}
//void test_func(void *arg_ptr){
void test_func(void *arg_ptr){
a8: 55 push %ebp
a9: 89 e5 mov %esp,%ebp
ab: 83 ec 28 sub $0x28,%esp
int * num = (int *)arg_ptr;
ae: 8b 45 08 mov 0x8(%ebp),%eax
b1: 89 45 f4 mov %eax,-0xc(%ebp)
n = *num;
b4: 8b 45 f4 mov -0xc(%ebp),%eax
b7: 8b 00 mov (%eax),%eax
b9: a3 bc 0b 00 00 mov %eax,0xbbc
printf(1,"\n n is updated as %d\n",*num);
be: 8b 45 f4 mov -0xc(%ebp),%eax
c1: 8b 00 mov (%eax),%eax
c3: 89 44 24 08 mov %eax,0x8(%esp)
c7: c7 44 24 04 72 0b 00 movl $0xb72,0x4(%esp)
ce: 00
cf: c7 04 24 01 00 00 00 movl $0x1,(%esp)
d6: e8 02 04 00 00 call 4dd <printf>
texit();
db: e8 0c 03 00 00 call 3ec <texit>
000000e0 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
e0: 55 push %ebp
e1: 89 e5 mov %esp,%ebp
e3: 57 push %edi
e4: 53 push %ebx
asm volatile("cld; rep stosb" :
e5: 8b 4d 08 mov 0x8(%ebp),%ecx
e8: 8b 55 10 mov 0x10(%ebp),%edx
eb: 8b 45 0c mov 0xc(%ebp),%eax
ee: 89 cb mov %ecx,%ebx
f0: 89 df mov %ebx,%edi
f2: 89 d1 mov %edx,%ecx
f4: fc cld
f5: f3 aa rep stos %al,%es:(%edi)
f7: 89 ca mov %ecx,%edx
f9: 89 fb mov %edi,%ebx
fb: 89 5d 08 mov %ebx,0x8(%ebp)
fe: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
101: 5b pop %ebx
102: 5f pop %edi
103: 5d pop %ebp
104: c3 ret
00000105 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
105: 55 push %ebp
106: 89 e5 mov %esp,%ebp
108: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
10b: 8b 45 08 mov 0x8(%ebp),%eax
10e: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
111: 8b 45 0c mov 0xc(%ebp),%eax
114: 0f b6 10 movzbl (%eax),%edx
117: 8b 45 08 mov 0x8(%ebp),%eax
11a: 88 10 mov %dl,(%eax)
11c: 8b 45 08 mov 0x8(%ebp),%eax
11f: 0f b6 00 movzbl (%eax),%eax
122: 84 c0 test %al,%al
124: 0f 95 c0 setne %al
127: 83 45 08 01 addl $0x1,0x8(%ebp)
12b: 83 45 0c 01 addl $0x1,0xc(%ebp)
12f: 84 c0 test %al,%al
131: 75 de jne 111 <strcpy+0xc>
;
return os;
133: 8b 45 fc mov -0x4(%ebp),%eax
}
136: c9 leave
137: c3 ret
00000138 <strcmp>:
int
strcmp(const char *p, const char *q)
{
138: 55 push %ebp
139: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
13b: eb 08 jmp 145 <strcmp+0xd>
p++, q++;
13d: 83 45 08 01 addl $0x1,0x8(%ebp)
141: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
145: 8b 45 08 mov 0x8(%ebp),%eax
148: 0f b6 00 movzbl (%eax),%eax
14b: 84 c0 test %al,%al
14d: 74 10 je 15f <strcmp+0x27>
14f: 8b 45 08 mov 0x8(%ebp),%eax
152: 0f b6 10 movzbl (%eax),%edx
155: 8b 45 0c mov 0xc(%ebp),%eax
158: 0f b6 00 movzbl (%eax),%eax
15b: 38 c2 cmp %al,%dl
15d: 74 de je 13d <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
15f: 8b 45 08 mov 0x8(%ebp),%eax
162: 0f b6 00 movzbl (%eax),%eax
165: 0f b6 d0 movzbl %al,%edx
168: 8b 45 0c mov 0xc(%ebp),%eax
16b: 0f b6 00 movzbl (%eax),%eax
16e: 0f b6 c0 movzbl %al,%eax
171: 89 d1 mov %edx,%ecx
173: 29 c1 sub %eax,%ecx
175: 89 c8 mov %ecx,%eax
}
177: 5d pop %ebp
178: c3 ret
00000179 <strlen>:
uint
strlen(char *s)
{
179: 55 push %ebp
17a: 89 e5 mov %esp,%ebp
17c: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
17f: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
186: eb 04 jmp 18c <strlen+0x13>
188: 83 45 fc 01 addl $0x1,-0x4(%ebp)
18c: 8b 45 fc mov -0x4(%ebp),%eax
18f: 03 45 08 add 0x8(%ebp),%eax
192: 0f b6 00 movzbl (%eax),%eax
195: 84 c0 test %al,%al
197: 75 ef jne 188 <strlen+0xf>
;
return n;
199: 8b 45 fc mov -0x4(%ebp),%eax
}
19c: c9 leave
19d: c3 ret
0000019e <memset>:
void*
memset(void *dst, int c, uint n)
{
19e: 55 push %ebp
19f: 89 e5 mov %esp,%ebp
1a1: 83 ec 0c sub $0xc,%esp
stosb(dst, c, n);
1a4: 8b 45 10 mov 0x10(%ebp),%eax
1a7: 89 44 24 08 mov %eax,0x8(%esp)
1ab: 8b 45 0c mov 0xc(%ebp),%eax
1ae: 89 44 24 04 mov %eax,0x4(%esp)
1b2: 8b 45 08 mov 0x8(%ebp),%eax
1b5: 89 04 24 mov %eax,(%esp)
1b8: e8 23 ff ff ff call e0 <stosb>
return dst;
1bd: 8b 45 08 mov 0x8(%ebp),%eax
}
1c0: c9 leave
1c1: c3 ret
000001c2 <strchr>:
char*
strchr(const char *s, char c)
{
1c2: 55 push %ebp
1c3: 89 e5 mov %esp,%ebp
1c5: 83 ec 04 sub $0x4,%esp
1c8: 8b 45 0c mov 0xc(%ebp),%eax
1cb: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
1ce: eb 14 jmp 1e4 <strchr+0x22>
if(*s == c)
1d0: 8b 45 08 mov 0x8(%ebp),%eax
1d3: 0f b6 00 movzbl (%eax),%eax
1d6: 3a 45 fc cmp -0x4(%ebp),%al
1d9: 75 05 jne 1e0 <strchr+0x1e>
return (char*)s;
1db: 8b 45 08 mov 0x8(%ebp),%eax
1de: eb 13 jmp 1f3 <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
1e0: 83 45 08 01 addl $0x1,0x8(%ebp)
1e4: 8b 45 08 mov 0x8(%ebp),%eax
1e7: 0f b6 00 movzbl (%eax),%eax
1ea: 84 c0 test %al,%al
1ec: 75 e2 jne 1d0 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
1ee: b8 00 00 00 00 mov $0x0,%eax
}
1f3: c9 leave
1f4: c3 ret
000001f5 <gets>:
char*
gets(char *buf, int max)
{
1f5: 55 push %ebp
1f6: 89 e5 mov %esp,%ebp
1f8: 83 ec 28 sub $0x28,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
1fb: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
202: eb 44 jmp 248 <gets+0x53>
cc = read(0, &c, 1);
204: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
20b: 00
20c: 8d 45 ef lea -0x11(%ebp),%eax
20f: 89 44 24 04 mov %eax,0x4(%esp)
213: c7 04 24 00 00 00 00 movl $0x0,(%esp)
21a: e8 3d 01 00 00 call 35c <read>
21f: 89 45 f4 mov %eax,-0xc(%ebp)
if(cc < 1)
222: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
226: 7e 2d jle 255 <gets+0x60>
break;
buf[i++] = c;
228: 8b 45 f0 mov -0x10(%ebp),%eax
22b: 03 45 08 add 0x8(%ebp),%eax
22e: 0f b6 55 ef movzbl -0x11(%ebp),%edx
232: 88 10 mov %dl,(%eax)
234: 83 45 f0 01 addl $0x1,-0x10(%ebp)
if(c == '\n' || c == '\r')
238: 0f b6 45 ef movzbl -0x11(%ebp),%eax
23c: 3c 0a cmp $0xa,%al
23e: 74 16 je 256 <gets+0x61>
240: 0f b6 45 ef movzbl -0x11(%ebp),%eax
244: 3c 0d cmp $0xd,%al
246: 74 0e je 256 <gets+0x61>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
248: 8b 45 f0 mov -0x10(%ebp),%eax
24b: 83 c0 01 add $0x1,%eax
24e: 3b 45 0c cmp 0xc(%ebp),%eax
251: 7c b1 jl 204 <gets+0xf>
253: eb 01 jmp 256 <gets+0x61>
cc = read(0, &c, 1);
if(cc < 1)
break;
255: 90 nop
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
256: 8b 45 f0 mov -0x10(%ebp),%eax
259: 03 45 08 add 0x8(%ebp),%eax
25c: c6 00 00 movb $0x0,(%eax)
return buf;
25f: 8b 45 08 mov 0x8(%ebp),%eax
}
262: c9 leave
263: c3 ret
00000264 <stat>:
int
stat(char *n, struct stat *st)
{
264: 55 push %ebp
265: 89 e5 mov %esp,%ebp
267: 83 ec 28 sub $0x28,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
26a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
271: 00
272: 8b 45 08 mov 0x8(%ebp),%eax
275: 89 04 24 mov %eax,(%esp)
278: e8 07 01 00 00 call 384 <open>
27d: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd < 0)
280: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
284: 79 07 jns 28d <stat+0x29>
return -1;
286: b8 ff ff ff ff mov $0xffffffff,%eax
28b: eb 23 jmp 2b0 <stat+0x4c>
r = fstat(fd, st);
28d: 8b 45 0c mov 0xc(%ebp),%eax
290: 89 44 24 04 mov %eax,0x4(%esp)
294: 8b 45 f0 mov -0x10(%ebp),%eax
297: 89 04 24 mov %eax,(%esp)
29a: e8 fd 00 00 00 call 39c <fstat>
29f: 89 45 f4 mov %eax,-0xc(%ebp)
close(fd);
2a2: 8b 45 f0 mov -0x10(%ebp),%eax
2a5: 89 04 24 mov %eax,(%esp)
2a8: e8 bf 00 00 00 call 36c <close>
return r;
2ad: 8b 45 f4 mov -0xc(%ebp),%eax
}
2b0: c9 leave
2b1: c3 ret
000002b2 <atoi>:
int
atoi(const char *s)
{
2b2: 55 push %ebp
2b3: 89 e5 mov %esp,%ebp
2b5: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
2b8: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
2bf: eb 24 jmp 2e5 <atoi+0x33>
n = n*10 + *s++ - '0';
2c1: 8b 55 fc mov -0x4(%ebp),%edx
2c4: 89 d0 mov %edx,%eax
2c6: c1 e0 02 shl $0x2,%eax
2c9: 01 d0 add %edx,%eax
2cb: 01 c0 add %eax,%eax
2cd: 89 c2 mov %eax,%edx
2cf: 8b 45 08 mov 0x8(%ebp),%eax
2d2: 0f b6 00 movzbl (%eax),%eax
2d5: 0f be c0 movsbl %al,%eax
2d8: 8d 04 02 lea (%edx,%eax,1),%eax
2db: 83 e8 30 sub $0x30,%eax
2de: 89 45 fc mov %eax,-0x4(%ebp)
2e1: 83 45 08 01 addl $0x1,0x8(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
2e5: 8b 45 08 mov 0x8(%ebp),%eax
2e8: 0f b6 00 movzbl (%eax),%eax
2eb: 3c 2f cmp $0x2f,%al
2ed: 7e 0a jle 2f9 <atoi+0x47>
2ef: 8b 45 08 mov 0x8(%ebp),%eax
2f2: 0f b6 00 movzbl (%eax),%eax
2f5: 3c 39 cmp $0x39,%al
2f7: 7e c8 jle 2c1 <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
2f9: 8b 45 fc mov -0x4(%ebp),%eax
}
2fc: c9 leave
2fd: c3 ret
000002fe <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
2fe: 55 push %ebp
2ff: 89 e5 mov %esp,%ebp
301: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
304: 8b 45 08 mov 0x8(%ebp),%eax
307: 89 45 f8 mov %eax,-0x8(%ebp)
src = vsrc;
30a: 8b 45 0c mov 0xc(%ebp),%eax
30d: 89 45 fc mov %eax,-0x4(%ebp)
while(n-- > 0)
310: eb 13 jmp 325 <memmove+0x27>
*dst++ = *src++;
312: 8b 45 fc mov -0x4(%ebp),%eax
315: 0f b6 10 movzbl (%eax),%edx
318: 8b 45 f8 mov -0x8(%ebp),%eax
31b: 88 10 mov %dl,(%eax)
31d: 83 45 f8 01 addl $0x1,-0x8(%ebp)
321: 83 45 fc 01 addl $0x1,-0x4(%ebp)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
325: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
329: 0f 9f c0 setg %al
32c: 83 6d 10 01 subl $0x1,0x10(%ebp)
330: 84 c0 test %al,%al
332: 75 de jne 312 <memmove+0x14>
*dst++ = *src++;
return vdst;
334: 8b 45 08 mov 0x8(%ebp),%eax
}
337: c9 leave
338: c3 ret
339: 90 nop
33a: 90 nop
33b: 90 nop
0000033c <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
33c: b8 01 00 00 00 mov $0x1,%eax
341: cd 40 int $0x40
343: c3 ret
00000344 <exit>:
SYSCALL(exit)
344: b8 02 00 00 00 mov $0x2,%eax
349: cd 40 int $0x40
34b: c3 ret
0000034c <wait>:
SYSCALL(wait)
34c: b8 03 00 00 00 mov $0x3,%eax
351: cd 40 int $0x40
353: c3 ret
00000354 <pipe>:
SYSCALL(pipe)
354: b8 04 00 00 00 mov $0x4,%eax
359: cd 40 int $0x40
35b: c3 ret
0000035c <read>:
SYSCALL(read)
35c: b8 05 00 00 00 mov $0x5,%eax
361: cd 40 int $0x40
363: c3 ret
00000364 <write>:
SYSCALL(write)
364: b8 10 00 00 00 mov $0x10,%eax
369: cd 40 int $0x40
36b: c3 ret
0000036c <close>:
SYSCALL(close)
36c: b8 15 00 00 00 mov $0x15,%eax
371: cd 40 int $0x40
373: c3 ret
00000374 <kill>:
SYSCALL(kill)
374: b8 06 00 00 00 mov $0x6,%eax
379: cd 40 int $0x40
37b: c3 ret
0000037c <exec>:
SYSCALL(exec)
37c: b8 07 00 00 00 mov $0x7,%eax
381: cd 40 int $0x40
383: c3 ret
00000384 <open>:
SYSCALL(open)
384: b8 0f 00 00 00 mov $0xf,%eax
389: cd 40 int $0x40
38b: c3 ret
0000038c <mknod>:
SYSCALL(mknod)
38c: b8 11 00 00 00 mov $0x11,%eax
391: cd 40 int $0x40
393: c3 ret
00000394 <unlink>:
SYSCALL(unlink)
394: b8 12 00 00 00 mov $0x12,%eax
399: cd 40 int $0x40
39b: c3 ret
0000039c <fstat>:
SYSCALL(fstat)
39c: b8 08 00 00 00 mov $0x8,%eax
3a1: cd 40 int $0x40
3a3: c3 ret
000003a4 <link>:
SYSCALL(link)
3a4: b8 13 00 00 00 mov $0x13,%eax
3a9: cd 40 int $0x40
3ab: c3 ret
000003ac <mkdir>:
SYSCALL(mkdir)
3ac: b8 14 00 00 00 mov $0x14,%eax
3b1: cd 40 int $0x40
3b3: c3 ret
000003b4 <chdir>:
SYSCALL(chdir)
3b4: b8 09 00 00 00 mov $0x9,%eax
3b9: cd 40 int $0x40
3bb: c3 ret
000003bc <dup>:
SYSCALL(dup)
3bc: b8 0a 00 00 00 mov $0xa,%eax
3c1: cd 40 int $0x40
3c3: c3 ret
000003c4 <getpid>:
SYSCALL(getpid)
3c4: b8 0b 00 00 00 mov $0xb,%eax
3c9: cd 40 int $0x40
3cb: c3 ret
000003cc <sbrk>:
SYSCALL(sbrk)
3cc: b8 0c 00 00 00 mov $0xc,%eax
3d1: cd 40 int $0x40
3d3: c3 ret
000003d4 <sleep>:
SYSCALL(sleep)
3d4: b8 0d 00 00 00 mov $0xd,%eax
3d9: cd 40 int $0x40
3db: c3 ret
000003dc <uptime>:
SYSCALL(uptime)
3dc: b8 0e 00 00 00 mov $0xe,%eax
3e1: cd 40 int $0x40
3e3: c3 ret
000003e4 <clone>:
SYSCALL(clone)
3e4: b8 16 00 00 00 mov $0x16,%eax
3e9: cd 40 int $0x40
3eb: c3 ret
000003ec <texit>:
SYSCALL(texit)
3ec: b8 17 00 00 00 mov $0x17,%eax
3f1: cd 40 int $0x40
3f3: c3 ret
000003f4 <tsleep>:
SYSCALL(tsleep)
3f4: b8 18 00 00 00 mov $0x18,%eax
3f9: cd 40 int $0x40
3fb: c3 ret
000003fc <twakeup>:
SYSCALL(twakeup)
3fc: b8 19 00 00 00 mov $0x19,%eax
401: cd 40 int $0x40
403: c3 ret
00000404 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
404: 55 push %ebp
405: 89 e5 mov %esp,%ebp
407: 83 ec 28 sub $0x28,%esp
40a: 8b 45 0c mov 0xc(%ebp),%eax
40d: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
410: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
417: 00
418: 8d 45 f4 lea -0xc(%ebp),%eax
41b: 89 44 24 04 mov %eax,0x4(%esp)
41f: 8b 45 08 mov 0x8(%ebp),%eax
422: 89 04 24 mov %eax,(%esp)
425: e8 3a ff ff ff call 364 <write>
}
42a: c9 leave
42b: c3 ret
0000042c <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
42c: 55 push %ebp
42d: 89 e5 mov %esp,%ebp
42f: 53 push %ebx
430: 83 ec 44 sub $0x44,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
433: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
43a: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
43e: 74 17 je 457 <printint+0x2b>
440: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
444: 79 11 jns 457 <printint+0x2b>
neg = 1;
446: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
44d: 8b 45 0c mov 0xc(%ebp),%eax
450: f7 d8 neg %eax
452: 89 45 f4 mov %eax,-0xc(%ebp)
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
455: eb 06 jmp 45d <printint+0x31>
neg = 1;
x = -xx;
} else {
x = xx;
457: 8b 45 0c mov 0xc(%ebp),%eax
45a: 89 45 f4 mov %eax,-0xc(%ebp)
}
i = 0;
45d: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
do{
buf[i++] = digits[x % base];
464: 8b 4d ec mov -0x14(%ebp),%ecx
467: 8b 5d 10 mov 0x10(%ebp),%ebx
46a: 8b 45 f4 mov -0xc(%ebp),%eax
46d: ba 00 00 00 00 mov $0x0,%edx
472: f7 f3 div %ebx
474: 89 d0 mov %edx,%eax
476: 0f b6 80 c0 0b 00 00 movzbl 0xbc0(%eax),%eax
47d: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
481: 83 45 ec 01 addl $0x1,-0x14(%ebp)
}while((x /= base) != 0);
485: 8b 45 10 mov 0x10(%ebp),%eax
488: 89 45 d4 mov %eax,-0x2c(%ebp)
48b: 8b 45 f4 mov -0xc(%ebp),%eax
48e: ba 00 00 00 00 mov $0x0,%edx
493: f7 75 d4 divl -0x2c(%ebp)
496: 89 45 f4 mov %eax,-0xc(%ebp)
499: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
49d: 75 c5 jne 464 <printint+0x38>
if(neg)
49f: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
4a3: 74 28 je 4cd <printint+0xa1>
buf[i++] = '-';
4a5: 8b 45 ec mov -0x14(%ebp),%eax
4a8: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
4ad: 83 45 ec 01 addl $0x1,-0x14(%ebp)
while(--i >= 0)
4b1: eb 1a jmp 4cd <printint+0xa1>
putc(fd, buf[i]);
4b3: 8b 45 ec mov -0x14(%ebp),%eax
4b6: 0f b6 44 05 dc movzbl -0x24(%ebp,%eax,1),%eax
4bb: 0f be c0 movsbl %al,%eax
4be: 89 44 24 04 mov %eax,0x4(%esp)
4c2: 8b 45 08 mov 0x8(%ebp),%eax
4c5: 89 04 24 mov %eax,(%esp)
4c8: e8 37 ff ff ff call 404 <putc>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
4cd: 83 6d ec 01 subl $0x1,-0x14(%ebp)
4d1: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
4d5: 79 dc jns 4b3 <printint+0x87>
putc(fd, buf[i]);
}
4d7: 83 c4 44 add $0x44,%esp
4da: 5b pop %ebx
4db: 5d pop %ebp
4dc: c3 ret
000004dd <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
4dd: 55 push %ebp
4de: 89 e5 mov %esp,%ebp
4e0: 83 ec 38 sub $0x38,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
4e3: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
ap = (uint*)(void*)&fmt + 1;
4ea: 8d 45 0c lea 0xc(%ebp),%eax
4ed: 83 c0 04 add $0x4,%eax
4f0: 89 45 f4 mov %eax,-0xc(%ebp)
for(i = 0; fmt[i]; i++){
4f3: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
4fa: e9 7e 01 00 00 jmp 67d <printf+0x1a0>
c = fmt[i] & 0xff;
4ff: 8b 55 0c mov 0xc(%ebp),%edx
502: 8b 45 ec mov -0x14(%ebp),%eax
505: 8d 04 02 lea (%edx,%eax,1),%eax
508: 0f b6 00 movzbl (%eax),%eax
50b: 0f be c0 movsbl %al,%eax
50e: 25 ff 00 00 00 and $0xff,%eax
513: 89 45 e8 mov %eax,-0x18(%ebp)
if(state == 0){
516: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
51a: 75 2c jne 548 <printf+0x6b>
if(c == '%'){
51c: 83 7d e8 25 cmpl $0x25,-0x18(%ebp)
520: 75 0c jne 52e <printf+0x51>
state = '%';
522: c7 45 f0 25 00 00 00 movl $0x25,-0x10(%ebp)
529: e9 4b 01 00 00 jmp 679 <printf+0x19c>
} else {
putc(fd, c);
52e: 8b 45 e8 mov -0x18(%ebp),%eax
531: 0f be c0 movsbl %al,%eax
534: 89 44 24 04 mov %eax,0x4(%esp)
538: 8b 45 08 mov 0x8(%ebp),%eax
53b: 89 04 24 mov %eax,(%esp)
53e: e8 c1 fe ff ff call 404 <putc>
543: e9 31 01 00 00 jmp 679 <printf+0x19c>
}
} else if(state == '%'){
548: 83 7d f0 25 cmpl $0x25,-0x10(%ebp)
54c: 0f 85 27 01 00 00 jne 679 <printf+0x19c>
if(c == 'd'){
552: 83 7d e8 64 cmpl $0x64,-0x18(%ebp)
556: 75 2d jne 585 <printf+0xa8>
printint(fd, *ap, 10, 1);
558: 8b 45 f4 mov -0xc(%ebp),%eax
55b: 8b 00 mov (%eax),%eax
55d: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp)
564: 00
565: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp)
56c: 00
56d: 89 44 24 04 mov %eax,0x4(%esp)
571: 8b 45 08 mov 0x8(%ebp),%eax
574: 89 04 24 mov %eax,(%esp)
577: e8 b0 fe ff ff call 42c <printint>
ap++;
57c: 83 45 f4 04 addl $0x4,-0xc(%ebp)
580: e9 ed 00 00 00 jmp 672 <printf+0x195>
} else if(c == 'x' || c == 'p'){
585: 83 7d e8 78 cmpl $0x78,-0x18(%ebp)
589: 74 06 je 591 <printf+0xb4>
58b: 83 7d e8 70 cmpl $0x70,-0x18(%ebp)
58f: 75 2d jne 5be <printf+0xe1>
printint(fd, *ap, 16, 0);
591: 8b 45 f4 mov -0xc(%ebp),%eax
594: 8b 00 mov (%eax),%eax
596: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
59d: 00
59e: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
5a5: 00
5a6: 89 44 24 04 mov %eax,0x4(%esp)
5aa: 8b 45 08 mov 0x8(%ebp),%eax
5ad: 89 04 24 mov %eax,(%esp)
5b0: e8 77 fe ff ff call 42c <printint>
ap++;
5b5: 83 45 f4 04 addl $0x4,-0xc(%ebp)
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
5b9: e9 b4 00 00 00 jmp 672 <printf+0x195>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
5be: 83 7d e8 73 cmpl $0x73,-0x18(%ebp)
5c2: 75 46 jne 60a <printf+0x12d>
s = (char*)*ap;
5c4: 8b 45 f4 mov -0xc(%ebp),%eax
5c7: 8b 00 mov (%eax),%eax
5c9: 89 45 e4 mov %eax,-0x1c(%ebp)
ap++;
5cc: 83 45 f4 04 addl $0x4,-0xc(%ebp)
if(s == 0)
5d0: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
5d4: 75 27 jne 5fd <printf+0x120>
s = "(null)";
5d6: c7 45 e4 88 0b 00 00 movl $0xb88,-0x1c(%ebp)
while(*s != 0){
5dd: eb 1f jmp 5fe <printf+0x121>
putc(fd, *s);
5df: 8b 45 e4 mov -0x1c(%ebp),%eax
5e2: 0f b6 00 movzbl (%eax),%eax
5e5: 0f be c0 movsbl %al,%eax
5e8: 89 44 24 04 mov %eax,0x4(%esp)
5ec: 8b 45 08 mov 0x8(%ebp),%eax
5ef: 89 04 24 mov %eax,(%esp)
5f2: e8 0d fe ff ff call 404 <putc>
s++;
5f7: 83 45 e4 01 addl $0x1,-0x1c(%ebp)
5fb: eb 01 jmp 5fe <printf+0x121>
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
5fd: 90 nop
5fe: 8b 45 e4 mov -0x1c(%ebp),%eax
601: 0f b6 00 movzbl (%eax),%eax
604: 84 c0 test %al,%al
606: 75 d7 jne 5df <printf+0x102>
608: eb 68 jmp 672 <printf+0x195>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
60a: 83 7d e8 63 cmpl $0x63,-0x18(%ebp)
60e: 75 1d jne 62d <printf+0x150>
putc(fd, *ap);
610: 8b 45 f4 mov -0xc(%ebp),%eax
613: 8b 00 mov (%eax),%eax
615: 0f be c0 movsbl %al,%eax
618: 89 44 24 04 mov %eax,0x4(%esp)
61c: 8b 45 08 mov 0x8(%ebp),%eax
61f: 89 04 24 mov %eax,(%esp)
622: e8 dd fd ff ff call 404 <putc>
ap++;
627: 83 45 f4 04 addl $0x4,-0xc(%ebp)
62b: eb 45 jmp 672 <printf+0x195>
} else if(c == '%'){
62d: 83 7d e8 25 cmpl $0x25,-0x18(%ebp)
631: 75 17 jne 64a <printf+0x16d>
putc(fd, c);
633: 8b 45 e8 mov -0x18(%ebp),%eax
636: 0f be c0 movsbl %al,%eax
639: 89 44 24 04 mov %eax,0x4(%esp)
63d: 8b 45 08 mov 0x8(%ebp),%eax
640: 89 04 24 mov %eax,(%esp)
643: e8 bc fd ff ff call 404 <putc>
648: eb 28 jmp 672 <printf+0x195>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
64a: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp)
651: 00
652: 8b 45 08 mov 0x8(%ebp),%eax
655: 89 04 24 mov %eax,(%esp)
658: e8 a7 fd ff ff call 404 <putc>
putc(fd, c);
65d: 8b 45 e8 mov -0x18(%ebp),%eax
660: 0f be c0 movsbl %al,%eax
663: 89 44 24 04 mov %eax,0x4(%esp)
667: 8b 45 08 mov 0x8(%ebp),%eax
66a: 89 04 24 mov %eax,(%esp)
66d: e8 92 fd ff ff call 404 <putc>
}
state = 0;
672: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
679: 83 45 ec 01 addl $0x1,-0x14(%ebp)
67d: 8b 55 0c mov 0xc(%ebp),%edx
680: 8b 45 ec mov -0x14(%ebp),%eax
683: 8d 04 02 lea (%edx,%eax,1),%eax
686: 0f b6 00 movzbl (%eax),%eax
689: 84 c0 test %al,%al
68b: 0f 85 6e fe ff ff jne 4ff <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
691: c9 leave
692: c3 ret
693: 90 nop
00000694 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
694: 55 push %ebp
695: 89 e5 mov %esp,%ebp
697: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
69a: 8b 45 08 mov 0x8(%ebp),%eax
69d: 83 e8 08 sub $0x8,%eax
6a0: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6a3: a1 e0 0b 00 00 mov 0xbe0,%eax
6a8: 89 45 fc mov %eax,-0x4(%ebp)
6ab: eb 24 jmp 6d1 <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6ad: 8b 45 fc mov -0x4(%ebp),%eax
6b0: 8b 00 mov (%eax),%eax
6b2: 3b 45 fc cmp -0x4(%ebp),%eax
6b5: 77 12 ja 6c9 <free+0x35>
6b7: 8b 45 f8 mov -0x8(%ebp),%eax
6ba: 3b 45 fc cmp -0x4(%ebp),%eax
6bd: 77 24 ja 6e3 <free+0x4f>
6bf: 8b 45 fc mov -0x4(%ebp),%eax
6c2: 8b 00 mov (%eax),%eax
6c4: 3b 45 f8 cmp -0x8(%ebp),%eax
6c7: 77 1a ja 6e3 <free+0x4f>
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6c9: 8b 45 fc mov -0x4(%ebp),%eax
6cc: 8b 00 mov (%eax),%eax
6ce: 89 45 fc mov %eax,-0x4(%ebp)
6d1: 8b 45 f8 mov -0x8(%ebp),%eax
6d4: 3b 45 fc cmp -0x4(%ebp),%eax
6d7: 76 d4 jbe 6ad <free+0x19>
6d9: 8b 45 fc mov -0x4(%ebp),%eax
6dc: 8b 00 mov (%eax),%eax
6de: 3b 45 f8 cmp -0x8(%ebp),%eax
6e1: 76 ca jbe 6ad <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
6e3: 8b 45 f8 mov -0x8(%ebp),%eax
6e6: 8b 40 04 mov 0x4(%eax),%eax
6e9: c1 e0 03 shl $0x3,%eax
6ec: 89 c2 mov %eax,%edx
6ee: 03 55 f8 add -0x8(%ebp),%edx
6f1: 8b 45 fc mov -0x4(%ebp),%eax
6f4: 8b 00 mov (%eax),%eax
6f6: 39 c2 cmp %eax,%edx
6f8: 75 24 jne 71e <free+0x8a>
bp->s.size += p->s.ptr->s.size;
6fa: 8b 45 f8 mov -0x8(%ebp),%eax
6fd: 8b 50 04 mov 0x4(%eax),%edx
700: 8b 45 fc mov -0x4(%ebp),%eax
703: 8b 00 mov (%eax),%eax
705: 8b 40 04 mov 0x4(%eax),%eax
708: 01 c2 add %eax,%edx
70a: 8b 45 f8 mov -0x8(%ebp),%eax
70d: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
710: 8b 45 fc mov -0x4(%ebp),%eax
713: 8b 00 mov (%eax),%eax
715: 8b 10 mov (%eax),%edx
717: 8b 45 f8 mov -0x8(%ebp),%eax
71a: 89 10 mov %edx,(%eax)
71c: eb 0a jmp 728 <free+0x94>
} else
bp->s.ptr = p->s.ptr;
71e: 8b 45 fc mov -0x4(%ebp),%eax
721: 8b 10 mov (%eax),%edx
723: 8b 45 f8 mov -0x8(%ebp),%eax
726: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
728: 8b 45 fc mov -0x4(%ebp),%eax
72b: 8b 40 04 mov 0x4(%eax),%eax
72e: c1 e0 03 shl $0x3,%eax
731: 03 45 fc add -0x4(%ebp),%eax
734: 3b 45 f8 cmp -0x8(%ebp),%eax
737: 75 20 jne 759 <free+0xc5>
p->s.size += bp->s.size;
739: 8b 45 fc mov -0x4(%ebp),%eax
73c: 8b 50 04 mov 0x4(%eax),%edx
73f: 8b 45 f8 mov -0x8(%ebp),%eax
742: 8b 40 04 mov 0x4(%eax),%eax
745: 01 c2 add %eax,%edx
747: 8b 45 fc mov -0x4(%ebp),%eax
74a: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
74d: 8b 45 f8 mov -0x8(%ebp),%eax
750: 8b 10 mov (%eax),%edx
752: 8b 45 fc mov -0x4(%ebp),%eax
755: 89 10 mov %edx,(%eax)
757: eb 08 jmp 761 <free+0xcd>
} else
p->s.ptr = bp;
759: 8b 45 fc mov -0x4(%ebp),%eax
75c: 8b 55 f8 mov -0x8(%ebp),%edx
75f: 89 10 mov %edx,(%eax)
freep = p;
761: 8b 45 fc mov -0x4(%ebp),%eax
764: a3 e0 0b 00 00 mov %eax,0xbe0
}
769: c9 leave
76a: c3 ret
0000076b <morecore>:
static Header*
morecore(uint nu)
{
76b: 55 push %ebp
76c: 89 e5 mov %esp,%ebp
76e: 83 ec 28 sub $0x28,%esp
char *p;
Header *hp;
if(nu < 4096)
771: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
778: 77 07 ja 781 <morecore+0x16>
nu = 4096;
77a: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
781: 8b 45 08 mov 0x8(%ebp),%eax
784: c1 e0 03 shl $0x3,%eax
787: 89 04 24 mov %eax,(%esp)
78a: e8 3d fc ff ff call 3cc <sbrk>
78f: 89 45 f0 mov %eax,-0x10(%ebp)
if(p == (char*)-1)
792: 83 7d f0 ff cmpl $0xffffffff,-0x10(%ebp)
796: 75 07 jne 79f <morecore+0x34>
return 0;
798: b8 00 00 00 00 mov $0x0,%eax
79d: eb 22 jmp 7c1 <morecore+0x56>
hp = (Header*)p;
79f: 8b 45 f0 mov -0x10(%ebp),%eax
7a2: 89 45 f4 mov %eax,-0xc(%ebp)
hp->s.size = nu;
7a5: 8b 45 f4 mov -0xc(%ebp),%eax
7a8: 8b 55 08 mov 0x8(%ebp),%edx
7ab: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
7ae: 8b 45 f4 mov -0xc(%ebp),%eax
7b1: 83 c0 08 add $0x8,%eax
7b4: 89 04 24 mov %eax,(%esp)
7b7: e8 d8 fe ff ff call 694 <free>
return freep;
7bc: a1 e0 0b 00 00 mov 0xbe0,%eax
}
7c1: c9 leave
7c2: c3 ret
000007c3 <malloc>:
void*
malloc(uint nbytes)
{
7c3: 55 push %ebp
7c4: 89 e5 mov %esp,%ebp
7c6: 83 ec 28 sub $0x28,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
7c9: 8b 45 08 mov 0x8(%ebp),%eax
7cc: 83 c0 07 add $0x7,%eax
7cf: c1 e8 03 shr $0x3,%eax
7d2: 83 c0 01 add $0x1,%eax
7d5: 89 45 f4 mov %eax,-0xc(%ebp)
if((prevp = freep) == 0){
7d8: a1 e0 0b 00 00 mov 0xbe0,%eax
7dd: 89 45 f0 mov %eax,-0x10(%ebp)
7e0: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
7e4: 75 23 jne 809 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
7e6: c7 45 f0 d8 0b 00 00 movl $0xbd8,-0x10(%ebp)
7ed: 8b 45 f0 mov -0x10(%ebp),%eax
7f0: a3 e0 0b 00 00 mov %eax,0xbe0
7f5: a1 e0 0b 00 00 mov 0xbe0,%eax
7fa: a3 d8 0b 00 00 mov %eax,0xbd8
base.s.size = 0;
7ff: c7 05 dc 0b 00 00 00 movl $0x0,0xbdc
806: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
809: 8b 45 f0 mov -0x10(%ebp),%eax
80c: 8b 00 mov (%eax),%eax
80e: 89 45 ec mov %eax,-0x14(%ebp)
if(p->s.size >= nunits){
811: 8b 45 ec mov -0x14(%ebp),%eax
814: 8b 40 04 mov 0x4(%eax),%eax
817: 3b 45 f4 cmp -0xc(%ebp),%eax
81a: 72 4d jb 869 <malloc+0xa6>
if(p->s.size == nunits)
81c: 8b 45 ec mov -0x14(%ebp),%eax
81f: 8b 40 04 mov 0x4(%eax),%eax
822: 3b 45 f4 cmp -0xc(%ebp),%eax
825: 75 0c jne 833 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
827: 8b 45 ec mov -0x14(%ebp),%eax
82a: 8b 10 mov (%eax),%edx
82c: 8b 45 f0 mov -0x10(%ebp),%eax
82f: 89 10 mov %edx,(%eax)
831: eb 26 jmp 859 <malloc+0x96>
else {
p->s.size -= nunits;
833: 8b 45 ec mov -0x14(%ebp),%eax
836: 8b 40 04 mov 0x4(%eax),%eax
839: 89 c2 mov %eax,%edx
83b: 2b 55 f4 sub -0xc(%ebp),%edx
83e: 8b 45 ec mov -0x14(%ebp),%eax
841: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
844: 8b 45 ec mov -0x14(%ebp),%eax
847: 8b 40 04 mov 0x4(%eax),%eax
84a: c1 e0 03 shl $0x3,%eax
84d: 01 45 ec add %eax,-0x14(%ebp)
p->s.size = nunits;
850: 8b 45 ec mov -0x14(%ebp),%eax
853: 8b 55 f4 mov -0xc(%ebp),%edx
856: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
859: 8b 45 f0 mov -0x10(%ebp),%eax
85c: a3 e0 0b 00 00 mov %eax,0xbe0
return (void*)(p + 1);
861: 8b 45 ec mov -0x14(%ebp),%eax
864: 83 c0 08 add $0x8,%eax
867: eb 38 jmp 8a1 <malloc+0xde>
}
if(p == freep)
869: a1 e0 0b 00 00 mov 0xbe0,%eax
86e: 39 45 ec cmp %eax,-0x14(%ebp)
871: 75 1b jne 88e <malloc+0xcb>
if((p = morecore(nunits)) == 0)
873: 8b 45 f4 mov -0xc(%ebp),%eax
876: 89 04 24 mov %eax,(%esp)
879: e8 ed fe ff ff call 76b <morecore>
87e: 89 45 ec mov %eax,-0x14(%ebp)
881: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
885: 75 07 jne 88e <malloc+0xcb>
return 0;
887: b8 00 00 00 00 mov $0x0,%eax
88c: eb 13 jmp 8a1 <malloc+0xde>
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
88e: 8b 45 ec mov -0x14(%ebp),%eax
891: 89 45 f0 mov %eax,-0x10(%ebp)
894: 8b 45 ec mov -0x14(%ebp),%eax
897: 8b 00 mov (%eax),%eax
899: 89 45 ec mov %eax,-0x14(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
89c: e9 70 ff ff ff jmp 811 <malloc+0x4e>
}
8a1: c9 leave
8a2: c3 ret
8a3: 90 nop
000008a4 <xchg>:
asm volatile("sti");
}
static inline uint
xchg(volatile uint *addr, uint newval)
{
8a4: 55 push %ebp
8a5: 89 e5 mov %esp,%ebp
8a7: 83 ec 10 sub $0x10,%esp
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
8aa: 8b 55 08 mov 0x8(%ebp),%edx
8ad: 8b 45 0c mov 0xc(%ebp),%eax
8b0: 8b 4d 08 mov 0x8(%ebp),%ecx
8b3: f0 87 02 lock xchg %eax,(%edx)
8b6: 89 45 fc mov %eax,-0x4(%ebp)
"+m" (*addr), "=a" (result) :
"1" (newval) :
"cc");
return result;
8b9: 8b 45 fc mov -0x4(%ebp),%eax
}
8bc: c9 leave
8bd: c3 ret
000008be <lock_init>:
#include "x86.h"
#include "proc.h"
unsigned long rands = 1;
void lock_init(lock_t *lock){
8be: 55 push %ebp
8bf: 89 e5 mov %esp,%ebp
lock->locked = 0;
8c1: 8b 45 08 mov 0x8(%ebp),%eax
8c4: c7 00 00 00 00 00 movl $0x0,(%eax)
}
8ca: 5d pop %ebp
8cb: c3 ret
000008cc <lock_acquire>:
void lock_acquire(lock_t *lock){
8cc: 55 push %ebp
8cd: 89 e5 mov %esp,%ebp
8cf: 83 ec 08 sub $0x8,%esp
while(xchg(&lock->locked,1) != 0);
8d2: 8b 45 08 mov 0x8(%ebp),%eax
8d5: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
8dc: 00
8dd: 89 04 24 mov %eax,(%esp)
8e0: e8 bf ff ff ff call 8a4 <xchg>
8e5: 85 c0 test %eax,%eax
8e7: 75 e9 jne 8d2 <lock_acquire+0x6>
}
8e9: c9 leave
8ea: c3 ret
000008eb <lock_release>:
void lock_release(lock_t *lock){
8eb: 55 push %ebp
8ec: 89 e5 mov %esp,%ebp
8ee: 83 ec 08 sub $0x8,%esp
xchg(&lock->locked,0);
8f1: 8b 45 08 mov 0x8(%ebp),%eax
8f4: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
8fb: 00
8fc: 89 04 24 mov %eax,(%esp)
8ff: e8 a0 ff ff ff call 8a4 <xchg>
}
904: c9 leave
905: c3 ret
00000906 <thread_create>:
void *thread_create(void(*start_routine)(void*), void *arg){
906: 55 push %ebp
907: 89 e5 mov %esp,%ebp
909: 83 ec 28 sub $0x28,%esp
int tid;
void * stack = malloc(2 * 4096);
90c: c7 04 24 00 20 00 00 movl $0x2000,(%esp)
913: e8 ab fe ff ff call 7c3 <malloc>
918: 89 45 f0 mov %eax,-0x10(%ebp)
void *garbage_stack = stack;
91b: 8b 45 f0 mov -0x10(%ebp),%eax
91e: 89 45 f4 mov %eax,-0xc(%ebp)
// printf(1,"start routine addr : %d\n",(uint)start_routine);
if((uint)stack % 4096){
921: 8b 45 f0 mov -0x10(%ebp),%eax
924: 25 ff 0f 00 00 and $0xfff,%eax
929: 85 c0 test %eax,%eax
92b: 74 15 je 942 <thread_create+0x3c>
stack = stack + (4096 - (uint)stack % 4096);
92d: 8b 45 f0 mov -0x10(%ebp),%eax
930: 89 c2 mov %eax,%edx
932: 81 e2 ff 0f 00 00 and $0xfff,%edx
938: b8 00 10 00 00 mov $0x1000,%eax
93d: 29 d0 sub %edx,%eax
93f: 01 45 f0 add %eax,-0x10(%ebp)
}
if (stack == 0){
942: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
946: 75 1b jne 963 <thread_create+0x5d>
printf(1,"malloc fail \n");
948: c7 44 24 04 8f 0b 00 movl $0xb8f,0x4(%esp)
94f: 00
950: c7 04 24 01 00 00 00 movl $0x1,(%esp)
957: e8 81 fb ff ff call 4dd <printf>
return 0;
95c: b8 00 00 00 00 mov $0x0,%eax
961: eb 6f jmp 9d2 <thread_create+0xcc>
}
tid = clone((uint)stack,PSIZE,(uint)start_routine,(int)arg);
963: 8b 4d 0c mov 0xc(%ebp),%ecx
966: 8b 55 08 mov 0x8(%ebp),%edx
969: 8b 45 f0 mov -0x10(%ebp),%eax
96c: 89 4c 24 0c mov %ecx,0xc(%esp)
970: 89 54 24 08 mov %edx,0x8(%esp)
974: c7 44 24 04 00 10 00 movl $0x1000,0x4(%esp)
97b: 00
97c: 89 04 24 mov %eax,(%esp)
97f: e8 60 fa ff ff call 3e4 <clone>
984: 89 45 ec mov %eax,-0x14(%ebp)
if(tid < 0){
987: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
98b: 79 1b jns 9a8 <thread_create+0xa2>
printf(1,"clone fails\n");
98d: c7 44 24 04 9d 0b 00 movl $0xb9d,0x4(%esp)
994: 00
995: c7 04 24 01 00 00 00 movl $0x1,(%esp)
99c: e8 3c fb ff ff call 4dd <printf>
return 0;
9a1: b8 00 00 00 00 mov $0x0,%eax
9a6: eb 2a jmp 9d2 <thread_create+0xcc>
}
if(tid > 0){
9a8: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
9ac: 7e 05 jle 9b3 <thread_create+0xad>
//store threads on thread table
return garbage_stack;
9ae: 8b 45 f4 mov -0xc(%ebp),%eax
9b1: eb 1f jmp 9d2 <thread_create+0xcc>
}
if(tid == 0){
9b3: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
9b7: 75 14 jne 9cd <thread_create+0xc7>
printf(1,"tid = 0 return \n");
9b9: c7 44 24 04 aa 0b 00 movl $0xbaa,0x4(%esp)
9c0: 00
9c1: c7 04 24 01 00 00 00 movl $0x1,(%esp)
9c8: e8 10 fb ff ff call 4dd <printf>
}
// wait();
// free(garbage_stack);
return 0;
9cd: b8 00 00 00 00 mov $0x0,%eax
}
9d2: c9 leave
9d3: c3 ret
000009d4 <random>:
// generate 0 -> max random number exclude max.
int random(int max){
9d4: 55 push %ebp
9d5: 89 e5 mov %esp,%ebp
rands = rands * 1664525 + 1013904233;
9d7: a1 d4 0b 00 00 mov 0xbd4,%eax
9dc: 69 c0 0d 66 19 00 imul $0x19660d,%eax,%eax
9e2: 05 69 f3 6e 3c add $0x3c6ef369,%eax
9e7: a3 d4 0b 00 00 mov %eax,0xbd4
return (int)(rands % max);
9ec: a1 d4 0b 00 00 mov 0xbd4,%eax
9f1: 8b 4d 08 mov 0x8(%ebp),%ecx
9f4: ba 00 00 00 00 mov $0x0,%edx
9f9: f7 f1 div %ecx
9fb: 89 d0 mov %edx,%eax
}
9fd: 5d pop %ebp
9fe: c3 ret
9ff: 90 nop
00000a00 <init_q>:
#include "queue.h"
#include "types.h"
#include "user.h"
void init_q(struct queue *q){
a00: 55 push %ebp
a01: 89 e5 mov %esp,%ebp
q->size = 0;
a03: 8b 45 08 mov 0x8(%ebp),%eax
a06: c7 00 00 00 00 00 movl $0x0,(%eax)
q->head = 0;
a0c: 8b 45 08 mov 0x8(%ebp),%eax
a0f: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
q->tail = 0;
a16: 8b 45 08 mov 0x8(%ebp),%eax
a19: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
a20: 5d pop %ebp
a21: c3 ret
00000a22 <add_q>:
void add_q(struct queue *q, int v){
a22: 55 push %ebp
a23: 89 e5 mov %esp,%ebp
a25: 83 ec 28 sub $0x28,%esp
struct node * n = malloc(sizeof(struct node));
a28: c7 04 24 08 00 00 00 movl $0x8,(%esp)
a2f: e8 8f fd ff ff call 7c3 <malloc>
a34: 89 45 f4 mov %eax,-0xc(%ebp)
n->next = 0;
a37: 8b 45 f4 mov -0xc(%ebp),%eax
a3a: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
n->value = v;
a41: 8b 45 f4 mov -0xc(%ebp),%eax
a44: 8b 55 0c mov 0xc(%ebp),%edx
a47: 89 10 mov %edx,(%eax)
if(q->head == 0){
a49: 8b 45 08 mov 0x8(%ebp),%eax
a4c: 8b 40 04 mov 0x4(%eax),%eax
a4f: 85 c0 test %eax,%eax
a51: 75 0b jne a5e <add_q+0x3c>
q->head = n;
a53: 8b 45 08 mov 0x8(%ebp),%eax
a56: 8b 55 f4 mov -0xc(%ebp),%edx
a59: 89 50 04 mov %edx,0x4(%eax)
a5c: eb 0c jmp a6a <add_q+0x48>
}else{
q->tail->next = n;
a5e: 8b 45 08 mov 0x8(%ebp),%eax
a61: 8b 40 08 mov 0x8(%eax),%eax
a64: 8b 55 f4 mov -0xc(%ebp),%edx
a67: 89 50 04 mov %edx,0x4(%eax)
}
q->tail = n;
a6a: 8b 45 08 mov 0x8(%ebp),%eax
a6d: 8b 55 f4 mov -0xc(%ebp),%edx
a70: 89 50 08 mov %edx,0x8(%eax)
q->size++;
a73: 8b 45 08 mov 0x8(%ebp),%eax
a76: 8b 00 mov (%eax),%eax
a78: 8d 50 01 lea 0x1(%eax),%edx
a7b: 8b 45 08 mov 0x8(%ebp),%eax
a7e: 89 10 mov %edx,(%eax)
}
a80: c9 leave
a81: c3 ret
00000a82 <empty_q>:
int empty_q(struct queue *q){
a82: 55 push %ebp
a83: 89 e5 mov %esp,%ebp
if(q->size == 0)
a85: 8b 45 08 mov 0x8(%ebp),%eax
a88: 8b 00 mov (%eax),%eax
a8a: 85 c0 test %eax,%eax
a8c: 75 07 jne a95 <empty_q+0x13>
return 1;
a8e: b8 01 00 00 00 mov $0x1,%eax
a93: eb 05 jmp a9a <empty_q+0x18>
else
return 0;
a95: b8 00 00 00 00 mov $0x0,%eax
}
a9a: 5d pop %ebp
a9b: c3 ret
00000a9c <pop_q>:
int pop_q(struct queue *q){
a9c: 55 push %ebp
a9d: 89 e5 mov %esp,%ebp
a9f: 83 ec 28 sub $0x28,%esp
int val;
struct node *destroy;
if(!empty_q(q)){
aa2: 8b 45 08 mov 0x8(%ebp),%eax
aa5: 89 04 24 mov %eax,(%esp)
aa8: e8 d5 ff ff ff call a82 <empty_q>
aad: 85 c0 test %eax,%eax
aaf: 75 5d jne b0e <pop_q+0x72>
val = q->head->value;
ab1: 8b 45 08 mov 0x8(%ebp),%eax
ab4: 8b 40 04 mov 0x4(%eax),%eax
ab7: 8b 00 mov (%eax),%eax
ab9: 89 45 f0 mov %eax,-0x10(%ebp)
destroy = q->head;
abc: 8b 45 08 mov 0x8(%ebp),%eax
abf: 8b 40 04 mov 0x4(%eax),%eax
ac2: 89 45 f4 mov %eax,-0xc(%ebp)
q->head = q->head->next;
ac5: 8b 45 08 mov 0x8(%ebp),%eax
ac8: 8b 40 04 mov 0x4(%eax),%eax
acb: 8b 50 04 mov 0x4(%eax),%edx
ace: 8b 45 08 mov 0x8(%ebp),%eax
ad1: 89 50 04 mov %edx,0x4(%eax)
free(destroy);
ad4: 8b 45 f4 mov -0xc(%ebp),%eax
ad7: 89 04 24 mov %eax,(%esp)
ada: e8 b5 fb ff ff call 694 <free>
q->size--;
adf: 8b 45 08 mov 0x8(%ebp),%eax
ae2: 8b 00 mov (%eax),%eax
ae4: 8d 50 ff lea -0x1(%eax),%edx
ae7: 8b 45 08 mov 0x8(%ebp),%eax
aea: 89 10 mov %edx,(%eax)
if(q->size == 0){
aec: 8b 45 08 mov 0x8(%ebp),%eax
aef: 8b 00 mov (%eax),%eax
af1: 85 c0 test %eax,%eax
af3: 75 14 jne b09 <pop_q+0x6d>
q->head = 0;
af5: 8b 45 08 mov 0x8(%ebp),%eax
af8: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
q->tail = 0;
aff: 8b 45 08 mov 0x8(%ebp),%eax
b02: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
return val;
b09: 8b 45 f0 mov -0x10(%ebp),%eax
b0c: eb 05 jmp b13 <pop_q+0x77>
}
return -1;
b0e: b8 ff ff ff ff mov $0xffffffff,%eax
}
b13: c9 leave
b14: c3 ret
|
user/usertests.asm | MyBeLoVedL/xv6 | 0 | 3913 | <gh_stars>0
user/_usertests: file format elf64-littleriscv
Disassembly of section .text:
0000000000000000 <copyinstr1>:
0: 1141 addi sp,sp,-16
2: e406 sd ra,8(sp)
4: e022 sd s0,0(sp)
6: 0800 addi s0,sp,16
8: 20100593 li a1,513
c: 4505 li a0,1
e: 057e slli a0,a0,0x1f
10: 00005097 auipc ra,0x5
14: 4fc080e7 jalr 1276(ra) # 550c <open>
<<<<<<< HEAD
=======
if (fd >= 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
18: 02055063 bgez a0,38 <copyinstr1+0x38>
1c: 20100593 li a1,513
20: 557d li a0,-1
22: 00005097 auipc ra,0x5
26: 4ea080e7 jalr 1258(ra) # 550c <open>
<<<<<<< HEAD
=======
uint64 addr = addrs[ai];
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2a: 55fd li a1,-1
2c: 00055863 bgez a0,3c <copyinstr1+0x3c>
30: 60a2 ld ra,8(sp)
32: 6402 ld s0,0(sp)
34: 0141 addi sp,sp,16
36: 8082 ret
38: 4585 li a1,1
3a: 05fe slli a1,a1,0x1f
3c: 862a mv a2,a0
3e: 00006517 auipc a0,0x6
<<<<<<< HEAD
42: d4250513 addi a0,a0,-702 # 5d80 <l_free+0x318>
46: 00006097 auipc ra,0x6
4a: 800080e7 jalr -2048(ra) # 5846 <printf>
=======
42: d4250513 addi a0,a0,-702 # 5d80 <l_free+0x31a>
46: 00005097 auipc ra,0x5
4a: 7fe080e7 jalr 2046(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4e: 4505 li a0,1
50: 00005097 auipc ra,0x5
54: 47c080e7 jalr 1148(ra) # 54cc <exit>
0000000000000058 <bsstest>:
58: 00009797 auipc a5,0x9
5c: 2a878793 addi a5,a5,680 # 9300 <uninit>
60: 0000c697 auipc a3,0xc
64: 9b068693 addi a3,a3,-1616 # ba10 <buf>
68: 0007c703 lbu a4,0(a5)
6c: e709 bnez a4,76 <bsstest+0x1e>
6e: 0785 addi a5,a5,1
70: fed79ce3 bne a5,a3,68 <bsstest+0x10>
74: 8082 ret
76: 1141 addi sp,sp,-16
78: e406 sd ra,8(sp)
7a: e022 sd s0,0(sp)
7c: 0800 addi s0,sp,16
7e: 85aa mv a1,a0
80: 00006517 auipc a0,0x6
<<<<<<< HEAD
84: d2050513 addi a0,a0,-736 # 5da0 <l_free+0x338>
88: 00005097 auipc ra,0x5
8c: 7be080e7 jalr 1982(ra) # 5846 <printf>
=======
84: d2050513 addi a0,a0,-736 # 5da0 <l_free+0x33a>
88: 00005097 auipc ra,0x5
8c: 7bc080e7 jalr 1980(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
90: 4505 li a0,1
92: 00005097 auipc ra,0x5
96: 43a080e7 jalr 1082(ra) # 54cc <exit>
000000000000009a <opentest>:
9a: 1101 addi sp,sp,-32
9c: ec06 sd ra,24(sp)
9e: e822 sd s0,16(sp)
a0: e426 sd s1,8(sp)
a2: 1000 addi s0,sp,32
a4: 84aa mv s1,a0
a6: 4581 li a1,0
a8: 00006517 auipc a0,0x6
<<<<<<< HEAD
ac: d1050513 addi a0,a0,-752 # 5db8 <l_free+0x350>
b0: 00005097 auipc ra,0x5
b4: 45c080e7 jalr 1116(ra) # 550c <open>
=======
ac: d1050513 addi a0,a0,-752 # 5db8 <l_free+0x352>
b0: 00005097 auipc ra,0x5
b4: 45c080e7 jalr 1116(ra) # 550c <open>
if (fd < 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
b8: 02054663 bltz a0,e4 <opentest+0x4a>
bc: 00005097 auipc ra,0x5
c0: 438080e7 jalr 1080(ra) # 54f4 <close>
<<<<<<< HEAD
c4: 4581 li a1,0
c6: 00006517 auipc a0,0x6
ca: d1250513 addi a0,a0,-750 # 5dd8 <l_free+0x370>
ce: 00005097 auipc ra,0x5
d2: 43e080e7 jalr 1086(ra) # 550c <open>
=======
fd = open("doesnotexist", 0);
c4: 4581 li a1,0
c6: 00006517 auipc a0,0x6
ca: d1250513 addi a0,a0,-750 # 5dd8 <l_free+0x372>
ce: 00005097 auipc ra,0x5
d2: 43e080e7 jalr 1086(ra) # 550c <open>
if (fd >= 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
d6: 02055563 bgez a0,100 <opentest+0x66>
da: 60e2 ld ra,24(sp)
dc: 6442 ld s0,16(sp)
de: 64a2 ld s1,8(sp)
e0: 6105 addi sp,sp,32
e2: 8082 ret
e4: 85a6 mv a1,s1
e6: 00006517 auipc a0,0x6
<<<<<<< HEAD
ea: cda50513 addi a0,a0,-806 # 5dc0 <l_free+0x358>
ee: 00005097 auipc ra,0x5
f2: 758080e7 jalr 1880(ra) # 5846 <printf>
f6: 4505 li a0,1
f8: 00005097 auipc ra,0x5
fc: 3d4080e7 jalr 980(ra) # 54cc <exit>
100: 85a6 mv a1,s1
102: 00006517 auipc a0,0x6
106: ce650513 addi a0,a0,-794 # 5de8 <l_free+0x380>
10a: 00005097 auipc ra,0x5
10e: 73c080e7 jalr 1852(ra) # 5846 <printf>
=======
ea: cda50513 addi a0,a0,-806 # 5dc0 <l_free+0x35a>
ee: 00005097 auipc ra,0x5
f2: 756080e7 jalr 1878(ra) # 5844 <printf>
exit(1);
f6: 4505 li a0,1
f8: 00005097 auipc ra,0x5
fc: 3d4080e7 jalr 980(ra) # 54cc <exit>
printf("%s: open doesnotexist succeeded!\n", s);
100: 85a6 mv a1,s1
102: 00006517 auipc a0,0x6
106: ce650513 addi a0,a0,-794 # 5de8 <l_free+0x382>
10a: 00005097 auipc ra,0x5
10e: 73a080e7 jalr 1850(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
112: 4505 li a0,1
114: 00005097 auipc ra,0x5
118: 3b8080e7 jalr 952(ra) # 54cc <exit>
000000000000011c <truncate2>:
11c: 7179 addi sp,sp,-48
11e: f406 sd ra,40(sp)
120: f022 sd s0,32(sp)
122: ec26 sd s1,24(sp)
124: e84a sd s2,16(sp)
126: e44e sd s3,8(sp)
128: 1800 addi s0,sp,48
12a: 89aa mv s3,a0
12c: 00006517 auipc a0,0x6
<<<<<<< HEAD
130: ce450513 addi a0,a0,-796 # 5e10 <l_free+0x3a8>
134: 00005097 auipc ra,0x5
138: 3e8080e7 jalr 1000(ra) # 551c <unlink>
13c: 60100593 li a1,1537
140: 00006517 auipc a0,0x6
144: cd050513 addi a0,a0,-816 # 5e10 <l_free+0x3a8>
=======
130: ce450513 addi a0,a0,-796 # 5e10 <l_free+0x3aa>
134: 00005097 auipc ra,0x5
138: 3e8080e7 jalr 1000(ra) # 551c <unlink>
int fd1 = open("truncfile", O_CREATE | O_TRUNC | O_WRONLY);
13c: 60100593 li a1,1537
140: 00006517 auipc a0,0x6
144: cd050513 addi a0,a0,-816 # 5e10 <l_free+0x3aa>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
148: 00005097 auipc ra,0x5
14c: 3c4080e7 jalr 964(ra) # 550c <open>
150: 84aa mv s1,a0
152: 4611 li a2,4
154: 00006597 auipc a1,0x6
<<<<<<< HEAD
158: ccc58593 addi a1,a1,-820 # 5e20 <l_free+0x3b8>
15c: 00005097 auipc ra,0x5
160: 390080e7 jalr 912(ra) # 54ec <write>
164: 40100593 li a1,1025
168: 00006517 auipc a0,0x6
16c: ca850513 addi a0,a0,-856 # 5e10 <l_free+0x3a8>
=======
158: ccc58593 addi a1,a1,-820 # 5e20 <l_free+0x3ba>
15c: 00005097 auipc ra,0x5
160: 390080e7 jalr 912(ra) # 54ec <write>
int fd2 = open("truncfile", O_TRUNC | O_WRONLY);
164: 40100593 li a1,1025
168: 00006517 auipc a0,0x6
16c: ca850513 addi a0,a0,-856 # 5e10 <l_free+0x3aa>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
170: 00005097 auipc ra,0x5
174: 39c080e7 jalr 924(ra) # 550c <open>
178: 892a mv s2,a0
17a: 4605 li a2,1
17c: 00006597 auipc a1,0x6
<<<<<<< HEAD
180: cac58593 addi a1,a1,-852 # 5e28 <l_free+0x3c0>
184: 8526 mv a0,s1
186: 00005097 auipc ra,0x5
18a: 366080e7 jalr 870(ra) # 54ec <write>
=======
180: cac58593 addi a1,a1,-852 # 5e28 <l_free+0x3c2>
184: 8526 mv a0,s1
186: 00005097 auipc ra,0x5
18a: 366080e7 jalr 870(ra) # 54ec <write>
if (n != -1) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
18e: 57fd li a5,-1
190: 02f51b63 bne a0,a5,1c6 <truncate2+0xaa>
194: 00006517 auipc a0,0x6
<<<<<<< HEAD
198: c7c50513 addi a0,a0,-900 # 5e10 <l_free+0x3a8>
19c: 00005097 auipc ra,0x5
1a0: 380080e7 jalr 896(ra) # 551c <unlink>
1a4: 8526 mv a0,s1
1a6: 00005097 auipc ra,0x5
1aa: 34e080e7 jalr 846(ra) # 54f4 <close>
1ae: 854a mv a0,s2
1b0: 00005097 auipc ra,0x5
1b4: 344080e7 jalr 836(ra) # 54f4 <close>
=======
198: c7c50513 addi a0,a0,-900 # 5e10 <l_free+0x3aa>
19c: 00005097 auipc ra,0x5
1a0: 380080e7 jalr 896(ra) # 551c <unlink>
close(fd1);
1a4: 8526 mv a0,s1
1a6: 00005097 auipc ra,0x5
1aa: 34e080e7 jalr 846(ra) # 54f4 <close>
close(fd2);
1ae: 854a mv a0,s2
1b0: 00005097 auipc ra,0x5
1b4: 344080e7 jalr 836(ra) # 54f4 <close>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1b8: 70a2 ld ra,40(sp)
1ba: 7402 ld s0,32(sp)
1bc: 64e2 ld s1,24(sp)
1be: 6942 ld s2,16(sp)
1c0: 69a2 ld s3,8(sp)
1c2: 6145 addi sp,sp,48
1c4: 8082 ret
1c6: 862a mv a2,a0
1c8: 85ce mv a1,s3
1ca: 00006517 auipc a0,0x6
<<<<<<< HEAD
1ce: c6650513 addi a0,a0,-922 # 5e30 <l_free+0x3c8>
1d2: 00005097 auipc ra,0x5
1d6: 674080e7 jalr 1652(ra) # 5846 <printf>
=======
1ce: c6650513 addi a0,a0,-922 # 5e30 <l_free+0x3ca>
1d2: 00005097 auipc ra,0x5
1d6: 672080e7 jalr 1650(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1da: 4505 li a0,1
1dc: 00005097 auipc ra,0x5
1e0: 2f0080e7 jalr 752(ra) # 54cc <exit>
00000000000001e4 <createtest>:
1e4: 7179 addi sp,sp,-48
1e6: f406 sd ra,40(sp)
1e8: f022 sd s0,32(sp)
1ea: ec26 sd s1,24(sp)
1ec: e84a sd s2,16(sp)
1ee: e44e sd s3,8(sp)
1f0: 1800 addi s0,sp,48
1f2: 00008797 auipc a5,0x8
1f6: fe678793 addi a5,a5,-26 # 81d8 <name>
1fa: 06100713 li a4,97
1fe: 00e78023 sb a4,0(a5)
202: 00078123 sb zero,2(a5)
206: 03000493 li s1,48
20a: 893e mv s2,a5
20c: 06400993 li s3,100
210: 009900a3 sb s1,1(s2)
214: 20200593 li a1,514
218: 854a mv a0,s2
21a: 00005097 auipc ra,0x5
21e: 2f2080e7 jalr 754(ra) # 550c <open>
<<<<<<< HEAD
222: 00005097 auipc ra,0x5
226: 2d2080e7 jalr 722(ra) # 54f4 <close>
=======
close(fd);
222: 00005097 auipc ra,0x5
226: 2d2080e7 jalr 722(ra) # 54f4 <close>
for (i = 0; i < N; i++) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
22a: 2485 addiw s1,s1,1
22c: 0ff4f493 zext.b s1,s1
230: ff3490e3 bne s1,s3,210 <createtest+0x2c>
234: 00008797 auipc a5,0x8
238: fa478793 addi a5,a5,-92 # 81d8 <name>
23c: 06100713 li a4,97
240: 00e78023 sb a4,0(a5)
244: 00078123 sb zero,2(a5)
248: 03000493 li s1,48
24c: 893e mv s2,a5
24e: 06400993 li s3,100
252: 009900a3 sb s1,1(s2)
256: 854a mv a0,s2
258: 00005097 auipc ra,0x5
25c: 2c4080e7 jalr 708(ra) # 551c <unlink>
<<<<<<< HEAD
=======
for (i = 0; i < N; i++) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
260: 2485 addiw s1,s1,1
262: 0ff4f493 zext.b s1,s1
266: ff3496e3 bne s1,s3,252 <createtest+0x6e>
26a: 70a2 ld ra,40(sp)
26c: 7402 ld s0,32(sp)
26e: 64e2 ld s1,24(sp)
270: 6942 ld s2,16(sp)
272: 69a2 ld s3,8(sp)
274: 6145 addi sp,sp,48
276: 8082 ret
0000000000000278 <bigwrite>:
278: 715d addi sp,sp,-80
27a: e486 sd ra,72(sp)
27c: e0a2 sd s0,64(sp)
27e: fc26 sd s1,56(sp)
280: f84a sd s2,48(sp)
282: f44e sd s3,40(sp)
284: f052 sd s4,32(sp)
286: ec56 sd s5,24(sp)
288: e85a sd s6,16(sp)
28a: e45e sd s7,8(sp)
28c: 0880 addi s0,sp,80
28e: 8baa mv s7,a0
290: 00006517 auipc a0,0x6
<<<<<<< HEAD
294: 9b050513 addi a0,a0,-1616 # 5c40 <l_free+0x1d8>
298: 00005097 auipc ra,0x5
29c: 284080e7 jalr 644(ra) # 551c <unlink>
=======
294: 9b050513 addi a0,a0,-1616 # 5c40 <l_free+0x1da>
298: 00005097 auipc ra,0x5
29c: 284080e7 jalr 644(ra) # 551c <unlink>
for (sz = 499; sz < (MAXOPBLOCKS + 2) * BSIZE; sz += 471) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2a0: 1f300493 li s1,499
2a4: 00006a97 auipc s5,0x6
<<<<<<< HEAD
2a8: 99ca8a93 addi s5,s5,-1636 # 5c40 <l_free+0x1d8>
=======
2a8: 99ca8a93 addi s5,s5,-1636 # 5c40 <l_free+0x1da>
int cc = write(fd, buf, sz);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2ac: 0000ba17 auipc s4,0xb
2b0: 764a0a13 addi s4,s4,1892 # ba10 <buf>
2b4: 6b0d lui s6,0x3
2b6: 1c9b0b13 addi s6,s6,457 # 31c9 <subdir+0x5b7>
<<<<<<< HEAD
=======
fd = open("bigwrite", O_CREATE | O_RDWR);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2ba: 20200593 li a1,514
2be: 8556 mv a0,s5
2c0: 00005097 auipc ra,0x5
2c4: 24c080e7 jalr 588(ra) # 550c <open>
2c8: 892a mv s2,a0
2ca: 04054d63 bltz a0,324 <bigwrite+0xac>
2ce: 8626 mv a2,s1
2d0: 85d2 mv a1,s4
2d2: 00005097 auipc ra,0x5
2d6: 21a080e7 jalr 538(ra) # 54ec <write>
2da: 89aa mv s3,a0
2dc: 06a49463 bne s1,a0,344 <bigwrite+0xcc>
2e0: 8626 mv a2,s1
2e2: 85d2 mv a1,s4
2e4: 854a mv a0,s2
2e6: 00005097 auipc ra,0x5
2ea: 206080e7 jalr 518(ra) # 54ec <write>
<<<<<<< HEAD
=======
if (cc != sz) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2ee: 04951963 bne a0,s1,340 <bigwrite+0xc8>
2f2: 854a mv a0,s2
2f4: 00005097 auipc ra,0x5
2f8: 200080e7 jalr 512(ra) # 54f4 <close>
<<<<<<< HEAD
2fc: 8556 mv a0,s5
2fe: 00005097 auipc ra,0x5
302: 21e080e7 jalr 542(ra) # 551c <unlink>
=======
unlink("bigwrite");
2fc: 8556 mv a0,s5
2fe: 00005097 auipc ra,0x5
302: 21e080e7 jalr 542(ra) # 551c <unlink>
for (sz = 499; sz < (MAXOPBLOCKS + 2) * BSIZE; sz += 471) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
306: 1d74849b addiw s1,s1,471
30a: fb6498e3 bne s1,s6,2ba <bigwrite+0x42>
30e: 60a6 ld ra,72(sp)
310: 6406 ld s0,64(sp)
312: 74e2 ld s1,56(sp)
314: 7942 ld s2,48(sp)
316: 79a2 ld s3,40(sp)
318: 7a02 ld s4,32(sp)
31a: 6ae2 ld s5,24(sp)
31c: 6b42 ld s6,16(sp)
31e: 6ba2 ld s7,8(sp)
320: 6161 addi sp,sp,80
322: 8082 ret
324: 85de mv a1,s7
326: 00006517 auipc a0,0x6
<<<<<<< HEAD
32a: b3250513 addi a0,a0,-1230 # 5e58 <l_free+0x3f0>
32e: 00005097 auipc ra,0x5
332: 518080e7 jalr 1304(ra) # 5846 <printf>
=======
32a: b3250513 addi a0,a0,-1230 # 5e58 <l_free+0x3f2>
32e: 00005097 auipc ra,0x5
332: 516080e7 jalr 1302(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
336: 4505 li a0,1
338: 00005097 auipc ra,0x5
33c: 194080e7 jalr 404(ra) # 54cc <exit>
340: 84ce mv s1,s3
342: 89aa mv s3,a0
344: 86ce mv a3,s3
346: 8626 mv a2,s1
348: 85de mv a1,s7
34a: 00006517 auipc a0,0x6
<<<<<<< HEAD
34e: b2e50513 addi a0,a0,-1234 # 5e78 <l_free+0x410>
352: 00005097 auipc ra,0x5
356: 4f4080e7 jalr 1268(ra) # 5846 <printf>
=======
34e: b2e50513 addi a0,a0,-1234 # 5e78 <l_free+0x412>
352: 00005097 auipc ra,0x5
356: 4f2080e7 jalr 1266(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
35a: 4505 li a0,1
35c: 00005097 auipc ra,0x5
360: 170080e7 jalr 368(ra) # 54cc <exit>
0000000000000364 <badwrite>:
364: 7179 addi sp,sp,-48
366: f406 sd ra,40(sp)
368: f022 sd s0,32(sp)
36a: ec26 sd s1,24(sp)
36c: e84a sd s2,16(sp)
36e: e44e sd s3,8(sp)
370: e052 sd s4,0(sp)
372: 1800 addi s0,sp,48
374: 00006517 auipc a0,0x6
<<<<<<< HEAD
378: b1c50513 addi a0,a0,-1252 # 5e90 <l_free+0x428>
=======
378: b1c50513 addi a0,a0,-1252 # 5e90 <l_free+0x42a>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
37c: 00005097 auipc ra,0x5
380: 1a0080e7 jalr 416(ra) # 551c <unlink>
384: 25800913 li s2,600
388: 00006997 auipc s3,0x6
<<<<<<< HEAD
38c: b0898993 addi s3,s3,-1272 # 5e90 <l_free+0x428>
=======
38c: b0898993 addi s3,s3,-1272 # 5e90 <l_free+0x42a>
if (fd < 0) {
printf("open junk failed\n");
exit(1);
}
write(fd, (char *)0xffffffffffL, 1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
390: 5a7d li s4,-1
392: 018a5a13 srli s4,s4,0x18
396: 20100593 li a1,513
39a: 854e mv a0,s3
39c: 00005097 auipc ra,0x5
3a0: 170080e7 jalr 368(ra) # 550c <open>
3a4: 84aa mv s1,a0
3a6: 06054b63 bltz a0,41c <badwrite+0xb8>
3aa: 4605 li a2,1
3ac: 85d2 mv a1,s4
3ae: 00005097 auipc ra,0x5
3b2: 13e080e7 jalr 318(ra) # 54ec <write>
<<<<<<< HEAD
3b6: 8526 mv a0,s1
3b8: 00005097 auipc ra,0x5
3bc: 13c080e7 jalr 316(ra) # 54f4 <close>
3c0: 854e mv a0,s3
3c2: 00005097 auipc ra,0x5
3c6: 15a080e7 jalr 346(ra) # 551c <unlink>
=======
close(fd);
3b6: 8526 mv a0,s1
3b8: 00005097 auipc ra,0x5
3bc: 13c080e7 jalr 316(ra) # 54f4 <close>
unlink("junk");
3c0: 854e mv a0,s3
3c2: 00005097 auipc ra,0x5
3c6: 15a080e7 jalr 346(ra) # 551c <unlink>
for (int i = 0; i < assumed_free; i++) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3ca: 397d addiw s2,s2,-1
3cc: fc0915e3 bnez s2,396 <badwrite+0x32>
3d0: 20100593 li a1,513
3d4: 00006517 auipc a0,0x6
<<<<<<< HEAD
3d8: abc50513 addi a0,a0,-1348 # 5e90 <l_free+0x428>
=======
3d8: abc50513 addi a0,a0,-1348 # 5e90 <l_free+0x42a>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3dc: 00005097 auipc ra,0x5
3e0: 130080e7 jalr 304(ra) # 550c <open>
3e4: 84aa mv s1,a0
3e6: 04054863 bltz a0,436 <badwrite+0xd2>
3ea: 4605 li a2,1
3ec: 00006597 auipc a1,0x6
<<<<<<< HEAD
3f0: a3c58593 addi a1,a1,-1476 # 5e28 <l_free+0x3c0>
=======
3f0: a3c58593 addi a1,a1,-1476 # 5e28 <l_free+0x3c2>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3f4: 00005097 auipc ra,0x5
3f8: 0f8080e7 jalr 248(ra) # 54ec <write>
3fc: 4785 li a5,1
3fe: 04f50963 beq a0,a5,450 <badwrite+0xec>
402: 00006517 auipc a0,0x6
<<<<<<< HEAD
406: aae50513 addi a0,a0,-1362 # 5eb0 <l_free+0x448>
40a: 00005097 auipc ra,0x5
40e: 43c080e7 jalr 1084(ra) # 5846 <printf>
412: 4505 li a0,1
414: 00005097 auipc ra,0x5
418: 0b8080e7 jalr 184(ra) # 54cc <exit>
41c: 00006517 auipc a0,0x6
420: a7c50513 addi a0,a0,-1412 # 5e98 <l_free+0x430>
424: 00005097 auipc ra,0x5
428: 422080e7 jalr 1058(ra) # 5846 <printf>
42c: 4505 li a0,1
42e: 00005097 auipc ra,0x5
432: 09e080e7 jalr 158(ra) # 54cc <exit>
436: 00006517 auipc a0,0x6
43a: a6250513 addi a0,a0,-1438 # 5e98 <l_free+0x430>
43e: 00005097 auipc ra,0x5
442: 408080e7 jalr 1032(ra) # 5846 <printf>
446: 4505 li a0,1
448: 00005097 auipc ra,0x5
44c: 084080e7 jalr 132(ra) # 54cc <exit>
450: 8526 mv a0,s1
452: 00005097 auipc ra,0x5
456: 0a2080e7 jalr 162(ra) # 54f4 <close>
45a: 00006517 auipc a0,0x6
45e: a3650513 addi a0,a0,-1482 # 5e90 <l_free+0x428>
462: 00005097 auipc ra,0x5
466: 0ba080e7 jalr 186(ra) # 551c <unlink>
=======
406: aae50513 addi a0,a0,-1362 # 5eb0 <l_free+0x44a>
40a: 00005097 auipc ra,0x5
40e: 43a080e7 jalr 1082(ra) # 5844 <printf>
exit(1);
412: 4505 li a0,1
414: 00005097 auipc ra,0x5
418: 0b8080e7 jalr 184(ra) # 54cc <exit>
printf("open junk failed\n");
41c: 00006517 auipc a0,0x6
420: a7c50513 addi a0,a0,-1412 # 5e98 <l_free+0x432>
424: 00005097 auipc ra,0x5
428: 420080e7 jalr 1056(ra) # 5844 <printf>
exit(1);
42c: 4505 li a0,1
42e: 00005097 auipc ra,0x5
432: 09e080e7 jalr 158(ra) # 54cc <exit>
printf("open junk failed\n");
436: 00006517 auipc a0,0x6
43a: a6250513 addi a0,a0,-1438 # 5e98 <l_free+0x432>
43e: 00005097 auipc ra,0x5
442: 406080e7 jalr 1030(ra) # 5844 <printf>
exit(1);
446: 4505 li a0,1
448: 00005097 auipc ra,0x5
44c: 084080e7 jalr 132(ra) # 54cc <exit>
}
close(fd);
450: 8526 mv a0,s1
452: 00005097 auipc ra,0x5
456: 0a2080e7 jalr 162(ra) # 54f4 <close>
unlink("junk");
45a: 00006517 auipc a0,0x6
45e: a3650513 addi a0,a0,-1482 # 5e90 <l_free+0x42a>
462: 00005097 auipc ra,0x5
466: 0ba080e7 jalr 186(ra) # 551c <unlink>
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
46a: 4501 li a0,0
46c: 00005097 auipc ra,0x5
470: 060080e7 jalr 96(ra) # 54cc <exit>
0000000000000474 <copyin>:
474: 715d addi sp,sp,-80
476: e486 sd ra,72(sp)
478: e0a2 sd s0,64(sp)
47a: fc26 sd s1,56(sp)
47c: f84a sd s2,48(sp)
47e: f44e sd s3,40(sp)
480: f052 sd s4,32(sp)
482: 0880 addi s0,sp,80
484: 4785 li a5,1
486: 07fe slli a5,a5,0x1f
488: fcf43023 sd a5,-64(s0)
48c: 57fd li a5,-1
48e: fcf43423 sd a5,-56(s0)
492: fc040913 addi s2,s0,-64
496: 00006a17 auipc s4,0x6
<<<<<<< HEAD
49a: a2aa0a13 addi s4,s4,-1494 # 5ec0 <l_free+0x458>
=======
49a: a2aa0a13 addi s4,s4,-1494 # 5ec0 <l_free+0x45a>
uint64 addr = addrs[ai];
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
49e: 00093983 ld s3,0(s2)
4a2: 20100593 li a1,513
4a6: 8552 mv a0,s4
4a8: 00005097 auipc ra,0x5
4ac: 064080e7 jalr 100(ra) # 550c <open>
4b0: 84aa mv s1,a0
4b2: 08054863 bltz a0,542 <copyin+0xce>
4b6: 6609 lui a2,0x2
4b8: 85ce mv a1,s3
4ba: 00005097 auipc ra,0x5
4be: 032080e7 jalr 50(ra) # 54ec <write>
<<<<<<< HEAD
=======
if (n >= 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4c2: 08055d63 bgez a0,55c <copyin+0xe8>
4c6: 8526 mv a0,s1
4c8: 00005097 auipc ra,0x5
4cc: 02c080e7 jalr 44(ra) # 54f4 <close>
<<<<<<< HEAD
4d0: 8552 mv a0,s4
4d2: 00005097 auipc ra,0x5
4d6: 04a080e7 jalr 74(ra) # 551c <unlink>
=======
unlink("copyin1");
4d0: 8552 mv a0,s4
4d2: 00005097 auipc ra,0x5
4d6: 04a080e7 jalr 74(ra) # 551c <unlink>
n = write(1, (char *)addr, 8192);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4da: 6609 lui a2,0x2
4dc: 85ce mv a1,s3
4de: 4505 li a0,1
4e0: 00005097 auipc ra,0x5
4e4: 00c080e7 jalr 12(ra) # 54ec <write>
<<<<<<< HEAD
=======
if (n > 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4e8: 08a04963 bgtz a0,57a <copyin+0x106>
4ec: fb840513 addi a0,s0,-72
4f0: 00005097 auipc ra,0x5
4f4: fec080e7 jalr -20(ra) # 54dc <pipe>
4f8: 0a054063 bltz a0,598 <copyin+0x124>
4fc: 6609 lui a2,0x2
4fe: 85ce mv a1,s3
500: fbc42503 lw a0,-68(s0)
504: 00005097 auipc ra,0x5
508: fe8080e7 jalr -24(ra) # 54ec <write>
<<<<<<< HEAD
=======
if (n > 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
50c: 0aa04363 bgtz a0,5b2 <copyin+0x13e>
510: fb842503 lw a0,-72(s0)
514: 00005097 auipc ra,0x5
518: fe0080e7 jalr -32(ra) # 54f4 <close>
<<<<<<< HEAD
51c: fbc42503 lw a0,-68(s0)
520: 00005097 auipc ra,0x5
524: fd4080e7 jalr -44(ra) # 54f4 <close>
=======
close(fds[1]);
51c: fbc42503 lw a0,-68(s0)
520: 00005097 auipc ra,0x5
524: fd4080e7 jalr -44(ra) # 54f4 <close>
for (int ai = 0; ai < 2; ai++) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
528: 0921 addi s2,s2,8
52a: fd040793 addi a5,s0,-48
52e: f6f918e3 bne s2,a5,49e <copyin+0x2a>
532: 60a6 ld ra,72(sp)
534: 6406 ld s0,64(sp)
536: 74e2 ld s1,56(sp)
538: 7942 ld s2,48(sp)
53a: 79a2 ld s3,40(sp)
53c: 7a02 ld s4,32(sp)
53e: 6161 addi sp,sp,80
540: 8082 ret
542: 00006517 auipc a0,0x6
<<<<<<< HEAD
546: 98650513 addi a0,a0,-1658 # 5ec8 <l_free+0x460>
54a: 00005097 auipc ra,0x5
54e: 2fc080e7 jalr 764(ra) # 5846 <printf>
552: 4505 li a0,1
554: 00005097 auipc ra,0x5
558: f78080e7 jalr -136(ra) # 54cc <exit>
55c: 862a mv a2,a0
55e: 85ce mv a1,s3
560: 00006517 auipc a0,0x6
564: 98050513 addi a0,a0,-1664 # 5ee0 <l_free+0x478>
568: 00005097 auipc ra,0x5
56c: 2de080e7 jalr 734(ra) # 5846 <printf>
570: 4505 li a0,1
572: 00005097 auipc ra,0x5
576: f5a080e7 jalr -166(ra) # 54cc <exit>
57a: 862a mv a2,a0
57c: 85ce mv a1,s3
57e: 00006517 auipc a0,0x6
582: 99250513 addi a0,a0,-1646 # 5f10 <l_free+0x4a8>
586: 00005097 auipc ra,0x5
58a: 2c0080e7 jalr 704(ra) # 5846 <printf>
58e: 4505 li a0,1
590: 00005097 auipc ra,0x5
594: f3c080e7 jalr -196(ra) # 54cc <exit>
598: 00006517 auipc a0,0x6
59c: 9a850513 addi a0,a0,-1624 # 5f40 <l_free+0x4d8>
5a0: 00005097 auipc ra,0x5
5a4: 2a6080e7 jalr 678(ra) # 5846 <printf>
5a8: 4505 li a0,1
5aa: 00005097 auipc ra,0x5
5ae: f22080e7 jalr -222(ra) # 54cc <exit>
5b2: 862a mv a2,a0
5b4: 85ce mv a1,s3
5b6: 00006517 auipc a0,0x6
5ba: 99a50513 addi a0,a0,-1638 # 5f50 <l_free+0x4e8>
5be: 00005097 auipc ra,0x5
5c2: 288080e7 jalr 648(ra) # 5846 <printf>
=======
546: 98650513 addi a0,a0,-1658 # 5ec8 <l_free+0x462>
54a: 00005097 auipc ra,0x5
54e: 2fa080e7 jalr 762(ra) # 5844 <printf>
exit(1);
552: 4505 li a0,1
554: 00005097 auipc ra,0x5
558: f78080e7 jalr -136(ra) # 54cc <exit>
printf("write(fd, %p, 8192) returned %d, not -1\n", addr, n);
55c: 862a mv a2,a0
55e: 85ce mv a1,s3
560: 00006517 auipc a0,0x6
564: 98050513 addi a0,a0,-1664 # 5ee0 <l_free+0x47a>
568: 00005097 auipc ra,0x5
56c: 2dc080e7 jalr 732(ra) # 5844 <printf>
exit(1);
570: 4505 li a0,1
572: 00005097 auipc ra,0x5
576: f5a080e7 jalr -166(ra) # 54cc <exit>
printf("write(1, %p, 8192) returned %d, not -1 or 0\n", addr, n);
57a: 862a mv a2,a0
57c: 85ce mv a1,s3
57e: 00006517 auipc a0,0x6
582: 99250513 addi a0,a0,-1646 # 5f10 <l_free+0x4aa>
586: 00005097 auipc ra,0x5
58a: 2be080e7 jalr 702(ra) # 5844 <printf>
exit(1);
58e: 4505 li a0,1
590: 00005097 auipc ra,0x5
594: f3c080e7 jalr -196(ra) # 54cc <exit>
printf("pipe() failed\n");
598: 00006517 auipc a0,0x6
59c: 9a850513 addi a0,a0,-1624 # 5f40 <l_free+0x4da>
5a0: 00005097 auipc ra,0x5
5a4: 2a4080e7 jalr 676(ra) # 5844 <printf>
exit(1);
5a8: 4505 li a0,1
5aa: 00005097 auipc ra,0x5
5ae: f22080e7 jalr -222(ra) # 54cc <exit>
printf("write(pipe, %p, 8192) returned %d, not -1 or 0\n", addr, n);
5b2: 862a mv a2,a0
5b4: 85ce mv a1,s3
5b6: 00006517 auipc a0,0x6
5ba: 99a50513 addi a0,a0,-1638 # 5f50 <l_free+0x4ea>
5be: 00005097 auipc ra,0x5
5c2: 286080e7 jalr 646(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5c6: 4505 li a0,1
5c8: 00005097 auipc ra,0x5
5cc: f04080e7 jalr -252(ra) # 54cc <exit>
00000000000005d0 <copyout>:
5d0: 711d addi sp,sp,-96
5d2: ec86 sd ra,88(sp)
5d4: e8a2 sd s0,80(sp)
5d6: e4a6 sd s1,72(sp)
5d8: e0ca sd s2,64(sp)
5da: fc4e sd s3,56(sp)
5dc: f852 sd s4,48(sp)
5de: f456 sd s5,40(sp)
5e0: 1080 addi s0,sp,96
5e2: 4785 li a5,1
5e4: 07fe slli a5,a5,0x1f
5e6: faf43823 sd a5,-80(s0)
5ea: 57fd li a5,-1
5ec: faf43c23 sd a5,-72(s0)
5f0: fb040913 addi s2,s0,-80
5f4: 00006a17 auipc s4,0x6
<<<<<<< HEAD
5f8: 98ca0a13 addi s4,s4,-1652 # 5f80 <l_free+0x518>
5fc: 00006a97 auipc s5,0x6
600: 82ca8a93 addi s5,s5,-2004 # 5e28 <l_free+0x3c0>
=======
5f8: 98ca0a13 addi s4,s4,-1652 # 5f80 <l_free+0x51a>
n = write(fds[1], "x", 1);
5fc: 00006a97 auipc s5,0x6
600: 82ca8a93 addi s5,s5,-2004 # 5e28 <l_free+0x3c2>
uint64 addr = addrs[ai];
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
604: 00093983 ld s3,0(s2)
608: 4581 li a1,0
60a: 8552 mv a0,s4
60c: 00005097 auipc ra,0x5
610: f00080e7 jalr -256(ra) # 550c <open>
614: 84aa mv s1,a0
616: 08054663 bltz a0,6a2 <copyout+0xd2>
61a: 6609 lui a2,0x2
61c: 85ce mv a1,s3
61e: 00005097 auipc ra,0x5
622: ec6080e7 jalr -314(ra) # 54e4 <read>
<<<<<<< HEAD
=======
if (n > 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
626: 08a04b63 bgtz a0,6bc <copyout+0xec>
62a: 8526 mv a0,s1
62c: 00005097 auipc ra,0x5
630: ec8080e7 jalr -312(ra) # 54f4 <close>
<<<<<<< HEAD
=======
if (pipe(fds) < 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
634: fa840513 addi a0,s0,-88
638: 00005097 auipc ra,0x5
63c: ea4080e7 jalr -348(ra) # 54dc <pipe>
640: 08054d63 bltz a0,6da <copyout+0x10a>
644: 4605 li a2,1
646: 85d6 mv a1,s5
648: fac42503 lw a0,-84(s0)
64c: 00005097 auipc ra,0x5
650: ea0080e7 jalr -352(ra) # 54ec <write>
<<<<<<< HEAD
=======
if (n != 1) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
654: 4785 li a5,1
656: 08f51f63 bne a0,a5,6f4 <copyout+0x124>
65a: 6609 lui a2,0x2
65c: 85ce mv a1,s3
65e: fa842503 lw a0,-88(s0)
662: 00005097 auipc ra,0x5
666: e82080e7 jalr -382(ra) # 54e4 <read>
<<<<<<< HEAD
=======
if (n > 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
66a: 0aa04263 bgtz a0,70e <copyout+0x13e>
66e: fa842503 lw a0,-88(s0)
672: 00005097 auipc ra,0x5
676: e82080e7 jalr -382(ra) # 54f4 <close>
<<<<<<< HEAD
67a: fac42503 lw a0,-84(s0)
67e: 00005097 auipc ra,0x5
682: e76080e7 jalr -394(ra) # 54f4 <close>
=======
close(fds[1]);
67a: fac42503 lw a0,-84(s0)
67e: 00005097 auipc ra,0x5
682: e76080e7 jalr -394(ra) # 54f4 <close>
for (int ai = 0; ai < 2; ai++) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
686: 0921 addi s2,s2,8
688: fc040793 addi a5,s0,-64
68c: f6f91ce3 bne s2,a5,604 <copyout+0x34>
690: 60e6 ld ra,88(sp)
692: 6446 ld s0,80(sp)
694: 64a6 ld s1,72(sp)
696: 6906 ld s2,64(sp)
698: 79e2 ld s3,56(sp)
69a: 7a42 ld s4,48(sp)
69c: 7aa2 ld s5,40(sp)
69e: 6125 addi sp,sp,96
6a0: 8082 ret
6a2: 00006517 auipc a0,0x6
<<<<<<< HEAD
6a6: 8e650513 addi a0,a0,-1818 # 5f88 <l_free+0x520>
6aa: 00005097 auipc ra,0x5
6ae: 19c080e7 jalr 412(ra) # 5846 <printf>
6b2: 4505 li a0,1
6b4: 00005097 auipc ra,0x5
6b8: e18080e7 jalr -488(ra) # 54cc <exit>
6bc: 862a mv a2,a0
6be: 85ce mv a1,s3
6c0: 00006517 auipc a0,0x6
6c4: 8e050513 addi a0,a0,-1824 # 5fa0 <l_free+0x538>
6c8: 00005097 auipc ra,0x5
6cc: 17e080e7 jalr 382(ra) # 5846 <printf>
6d0: 4505 li a0,1
6d2: 00005097 auipc ra,0x5
6d6: dfa080e7 jalr -518(ra) # 54cc <exit>
6da: 00006517 auipc a0,0x6
6de: 86650513 addi a0,a0,-1946 # 5f40 <l_free+0x4d8>
6e2: 00005097 auipc ra,0x5
6e6: 164080e7 jalr 356(ra) # 5846 <printf>
6ea: 4505 li a0,1
6ec: 00005097 auipc ra,0x5
6f0: de0080e7 jalr -544(ra) # 54cc <exit>
6f4: 00006517 auipc a0,0x6
6f8: 8dc50513 addi a0,a0,-1828 # 5fd0 <l_free+0x568>
6fc: 00005097 auipc ra,0x5
700: 14a080e7 jalr 330(ra) # 5846 <printf>
704: 4505 li a0,1
706: 00005097 auipc ra,0x5
70a: dc6080e7 jalr -570(ra) # 54cc <exit>
70e: 862a mv a2,a0
710: 85ce mv a1,s3
712: 00006517 auipc a0,0x6
716: 8d650513 addi a0,a0,-1834 # 5fe8 <l_free+0x580>
71a: 00005097 auipc ra,0x5
71e: 12c080e7 jalr 300(ra) # 5846 <printf>
=======
6a6: 8e650513 addi a0,a0,-1818 # 5f88 <l_free+0x522>
6aa: 00005097 auipc ra,0x5
6ae: 19a080e7 jalr 410(ra) # 5844 <printf>
exit(1);
6b2: 4505 li a0,1
6b4: 00005097 auipc ra,0x5
6b8: e18080e7 jalr -488(ra) # 54cc <exit>
printf("read(fd, %p, 8192) returned %d, not -1 or 0\n", addr, n);
6bc: 862a mv a2,a0
6be: 85ce mv a1,s3
6c0: 00006517 auipc a0,0x6
6c4: 8e050513 addi a0,a0,-1824 # 5fa0 <l_free+0x53a>
6c8: 00005097 auipc ra,0x5
6cc: 17c080e7 jalr 380(ra) # 5844 <printf>
exit(1);
6d0: 4505 li a0,1
6d2: 00005097 auipc ra,0x5
6d6: dfa080e7 jalr -518(ra) # 54cc <exit>
printf("pipe() failed\n");
6da: 00006517 auipc a0,0x6
6de: 86650513 addi a0,a0,-1946 # 5f40 <l_free+0x4da>
6e2: 00005097 auipc ra,0x5
6e6: 162080e7 jalr 354(ra) # 5844 <printf>
exit(1);
6ea: 4505 li a0,1
6ec: 00005097 auipc ra,0x5
6f0: de0080e7 jalr -544(ra) # 54cc <exit>
printf("pipe write failed\n");
6f4: 00006517 auipc a0,0x6
6f8: 8dc50513 addi a0,a0,-1828 # 5fd0 <l_free+0x56a>
6fc: 00005097 auipc ra,0x5
700: 148080e7 jalr 328(ra) # 5844 <printf>
exit(1);
704: 4505 li a0,1
706: 00005097 auipc ra,0x5
70a: dc6080e7 jalr -570(ra) # 54cc <exit>
printf("read(pipe, %p, 8192) returned %d, not -1 or 0\n", addr, n);
70e: 862a mv a2,a0
710: 85ce mv a1,s3
712: 00006517 auipc a0,0x6
716: 8d650513 addi a0,a0,-1834 # 5fe8 <l_free+0x582>
71a: 00005097 auipc ra,0x5
71e: 12a080e7 jalr 298(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
722: 4505 li a0,1
724: 00005097 auipc ra,0x5
728: da8080e7 jalr -600(ra) # 54cc <exit>
000000000000072c <truncate1>:
72c: 711d addi sp,sp,-96
72e: ec86 sd ra,88(sp)
730: e8a2 sd s0,80(sp)
732: e4a6 sd s1,72(sp)
734: e0ca sd s2,64(sp)
736: fc4e sd s3,56(sp)
738: f852 sd s4,48(sp)
73a: f456 sd s5,40(sp)
73c: 1080 addi s0,sp,96
73e: 8aaa mv s5,a0
740: 00005517 auipc a0,0x5
<<<<<<< HEAD
744: 6d050513 addi a0,a0,1744 # 5e10 <l_free+0x3a8>
748: 00005097 auipc ra,0x5
74c: dd4080e7 jalr -556(ra) # 551c <unlink>
750: 60100593 li a1,1537
754: 00005517 auipc a0,0x5
758: 6bc50513 addi a0,a0,1724 # 5e10 <l_free+0x3a8>
=======
744: 6d050513 addi a0,a0,1744 # 5e10 <l_free+0x3aa>
748: 00005097 auipc ra,0x5
74c: dd4080e7 jalr -556(ra) # 551c <unlink>
int fd1 = open("truncfile", O_CREATE | O_WRONLY | O_TRUNC);
750: 60100593 li a1,1537
754: 00005517 auipc a0,0x5
758: 6bc50513 addi a0,a0,1724 # 5e10 <l_free+0x3aa>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
75c: 00005097 auipc ra,0x5
760: db0080e7 jalr -592(ra) # 550c <open>
764: 84aa mv s1,a0
766: 4611 li a2,4
768: 00005597 auipc a1,0x5
<<<<<<< HEAD
76c: 6b858593 addi a1,a1,1720 # 5e20 <l_free+0x3b8>
770: 00005097 auipc ra,0x5
774: d7c080e7 jalr -644(ra) # 54ec <write>
778: 8526 mv a0,s1
77a: 00005097 auipc ra,0x5
77e: d7a080e7 jalr -646(ra) # 54f4 <close>
782: 4581 li a1,0
784: 00005517 auipc a0,0x5
788: 68c50513 addi a0,a0,1676 # 5e10 <l_free+0x3a8>
=======
76c: 6b858593 addi a1,a1,1720 # 5e20 <l_free+0x3ba>
770: 00005097 auipc ra,0x5
774: d7c080e7 jalr -644(ra) # 54ec <write>
close(fd1);
778: 8526 mv a0,s1
77a: 00005097 auipc ra,0x5
77e: d7a080e7 jalr -646(ra) # 54f4 <close>
int fd2 = open("truncfile", O_RDONLY);
782: 4581 li a1,0
784: 00005517 auipc a0,0x5
788: 68c50513 addi a0,a0,1676 # 5e10 <l_free+0x3aa>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
78c: 00005097 auipc ra,0x5
790: d80080e7 jalr -640(ra) # 550c <open>
794: 84aa mv s1,a0
796: 02000613 li a2,32
79a: fa040593 addi a1,s0,-96
79e: 00005097 auipc ra,0x5
7a2: d46080e7 jalr -698(ra) # 54e4 <read>
<<<<<<< HEAD
=======
if (n != 4) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
7a6: 4791 li a5,4
7a8: 0cf51e63 bne a0,a5,884 <truncate1+0x158>
7ac: 40100593 li a1,1025
7b0: 00005517 auipc a0,0x5
<<<<<<< HEAD
7b4: 66050513 addi a0,a0,1632 # 5e10 <l_free+0x3a8>
=======
7b4: 66050513 addi a0,a0,1632 # 5e10 <l_free+0x3aa>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
7b8: 00005097 auipc ra,0x5
7bc: d54080e7 jalr -684(ra) # 550c <open>
7c0: 89aa mv s3,a0
7c2: 4581 li a1,0
7c4: 00005517 auipc a0,0x5
<<<<<<< HEAD
7c8: 64c50513 addi a0,a0,1612 # 5e10 <l_free+0x3a8>
=======
7c8: 64c50513 addi a0,a0,1612 # 5e10 <l_free+0x3aa>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
7cc: 00005097 auipc ra,0x5
7d0: d40080e7 jalr -704(ra) # 550c <open>
7d4: 892a mv s2,a0
7d6: 02000613 li a2,32
7da: fa040593 addi a1,s0,-96
7de: 00005097 auipc ra,0x5
7e2: d06080e7 jalr -762(ra) # 54e4 <read>
7e6: 8a2a mv s4,a0
7e8: ed4d bnez a0,8a2 <truncate1+0x176>
7ea: 02000613 li a2,32
7ee: fa040593 addi a1,s0,-96
7f2: 8526 mv a0,s1
7f4: 00005097 auipc ra,0x5
7f8: cf0080e7 jalr -784(ra) # 54e4 <read>
7fc: 8a2a mv s4,a0
7fe: e971 bnez a0,8d2 <truncate1+0x1a6>
800: 4619 li a2,6
802: 00006597 auipc a1,0x6
<<<<<<< HEAD
806: 87658593 addi a1,a1,-1930 # 6078 <l_free+0x610>
80a: 854e mv a0,s3
80c: 00005097 auipc ra,0x5
810: ce0080e7 jalr -800(ra) # 54ec <write>
=======
806: 87658593 addi a1,a1,-1930 # 6078 <l_free+0x612>
80a: 854e mv a0,s3
80c: 00005097 auipc ra,0x5
810: ce0080e7 jalr -800(ra) # 54ec <write>
n = read(fd3, buf, sizeof(buf));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
814: 02000613 li a2,32
818: fa040593 addi a1,s0,-96
81c: 854a mv a0,s2
81e: 00005097 auipc ra,0x5
822: cc6080e7 jalr -826(ra) # 54e4 <read>
<<<<<<< HEAD
=======
if (n != 6) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
826: 4799 li a5,6
828: 0cf51d63 bne a0,a5,902 <truncate1+0x1d6>
82c: 02000613 li a2,32
830: fa040593 addi a1,s0,-96
834: 8526 mv a0,s1
836: 00005097 auipc ra,0x5
83a: cae080e7 jalr -850(ra) # 54e4 <read>
<<<<<<< HEAD
=======
if (n != 2) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
83e: 4789 li a5,2
840: 0ef51063 bne a0,a5,920 <truncate1+0x1f4>
844: 00005517 auipc a0,0x5
<<<<<<< HEAD
848: 5cc50513 addi a0,a0,1484 # 5e10 <l_free+0x3a8>
84c: 00005097 auipc ra,0x5
850: cd0080e7 jalr -816(ra) # 551c <unlink>
854: 854e mv a0,s3
856: 00005097 auipc ra,0x5
85a: c9e080e7 jalr -866(ra) # 54f4 <close>
85e: 8526 mv a0,s1
860: 00005097 auipc ra,0x5
864: c94080e7 jalr -876(ra) # 54f4 <close>
868: 854a mv a0,s2
86a: 00005097 auipc ra,0x5
86e: c8a080e7 jalr -886(ra) # 54f4 <close>
=======
848: 5cc50513 addi a0,a0,1484 # 5e10 <l_free+0x3aa>
84c: 00005097 auipc ra,0x5
850: cd0080e7 jalr -816(ra) # 551c <unlink>
close(fd1);
854: 854e mv a0,s3
856: 00005097 auipc ra,0x5
85a: c9e080e7 jalr -866(ra) # 54f4 <close>
close(fd2);
85e: 8526 mv a0,s1
860: 00005097 auipc ra,0x5
864: c94080e7 jalr -876(ra) # 54f4 <close>
close(fd3);
868: 854a mv a0,s2
86a: 00005097 auipc ra,0x5
86e: c8a080e7 jalr -886(ra) # 54f4 <close>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
872: 60e6 ld ra,88(sp)
874: 6446 ld s0,80(sp)
876: 64a6 ld s1,72(sp)
878: 6906 ld s2,64(sp)
87a: 79e2 ld s3,56(sp)
87c: 7a42 ld s4,48(sp)
87e: 7aa2 ld s5,40(sp)
880: 6125 addi sp,sp,96
882: 8082 ret
884: 862a mv a2,a0
886: 85d6 mv a1,s5
888: 00005517 auipc a0,0x5
<<<<<<< HEAD
88c: 79050513 addi a0,a0,1936 # 6018 <l_free+0x5b0>
890: 00005097 auipc ra,0x5
894: fb6080e7 jalr -74(ra) # 5846 <printf>
898: 4505 li a0,1
89a: 00005097 auipc ra,0x5
89e: c32080e7 jalr -974(ra) # 54cc <exit>
8a2: 85ca mv a1,s2
8a4: 00005517 auipc a0,0x5
8a8: 79450513 addi a0,a0,1940 # 6038 <l_free+0x5d0>
8ac: 00005097 auipc ra,0x5
8b0: f9a080e7 jalr -102(ra) # 5846 <printf>
8b4: 8652 mv a2,s4
8b6: 85d6 mv a1,s5
8b8: 00005517 auipc a0,0x5
8bc: 79050513 addi a0,a0,1936 # 6048 <l_free+0x5e0>
8c0: 00005097 auipc ra,0x5
8c4: f86080e7 jalr -122(ra) # 5846 <printf>
8c8: 4505 li a0,1
8ca: 00005097 auipc ra,0x5
8ce: c02080e7 jalr -1022(ra) # 54cc <exit>
8d2: 85a6 mv a1,s1
8d4: 00005517 auipc a0,0x5
8d8: 79450513 addi a0,a0,1940 # 6068 <l_free+0x600>
8dc: 00005097 auipc ra,0x5
8e0: f6a080e7 jalr -150(ra) # 5846 <printf>
8e4: 8652 mv a2,s4
8e6: 85d6 mv a1,s5
8e8: 00005517 auipc a0,0x5
8ec: 76050513 addi a0,a0,1888 # 6048 <l_free+0x5e0>
8f0: 00005097 auipc ra,0x5
8f4: f56080e7 jalr -170(ra) # 5846 <printf>
8f8: 4505 li a0,1
8fa: 00005097 auipc ra,0x5
8fe: bd2080e7 jalr -1070(ra) # 54cc <exit>
902: 862a mv a2,a0
904: 85d6 mv a1,s5
906: 00005517 auipc a0,0x5
90a: 77a50513 addi a0,a0,1914 # 6080 <l_free+0x618>
90e: 00005097 auipc ra,0x5
912: f38080e7 jalr -200(ra) # 5846 <printf>
916: 4505 li a0,1
918: 00005097 auipc ra,0x5
91c: bb4080e7 jalr -1100(ra) # 54cc <exit>
920: 862a mv a2,a0
922: 85d6 mv a1,s5
924: 00005517 auipc a0,0x5
928: 77c50513 addi a0,a0,1916 # 60a0 <l_free+0x638>
92c: 00005097 auipc ra,0x5
930: f1a080e7 jalr -230(ra) # 5846 <printf>
=======
88c: 79050513 addi a0,a0,1936 # 6018 <l_free+0x5b2>
890: 00005097 auipc ra,0x5
894: fb4080e7 jalr -76(ra) # 5844 <printf>
exit(1);
898: 4505 li a0,1
89a: 00005097 auipc ra,0x5
89e: c32080e7 jalr -974(ra) # 54cc <exit>
printf("aaa fd3=%d\n", fd3);
8a2: 85ca mv a1,s2
8a4: 00005517 auipc a0,0x5
8a8: 79450513 addi a0,a0,1940 # 6038 <l_free+0x5d2>
8ac: 00005097 auipc ra,0x5
8b0: f98080e7 jalr -104(ra) # 5844 <printf>
printf("%s: read %d bytes, wanted 0\n", s, n);
8b4: 8652 mv a2,s4
8b6: 85d6 mv a1,s5
8b8: 00005517 auipc a0,0x5
8bc: 79050513 addi a0,a0,1936 # 6048 <l_free+0x5e2>
8c0: 00005097 auipc ra,0x5
8c4: f84080e7 jalr -124(ra) # 5844 <printf>
exit(1);
8c8: 4505 li a0,1
8ca: 00005097 auipc ra,0x5
8ce: c02080e7 jalr -1022(ra) # 54cc <exit>
printf("bbb fd2=%d\n", fd2);
8d2: 85a6 mv a1,s1
8d4: 00005517 auipc a0,0x5
8d8: 79450513 addi a0,a0,1940 # 6068 <l_free+0x602>
8dc: 00005097 auipc ra,0x5
8e0: f68080e7 jalr -152(ra) # 5844 <printf>
printf("%s: read %d bytes, wanted 0\n", s, n);
8e4: 8652 mv a2,s4
8e6: 85d6 mv a1,s5
8e8: 00005517 auipc a0,0x5
8ec: 76050513 addi a0,a0,1888 # 6048 <l_free+0x5e2>
8f0: 00005097 auipc ra,0x5
8f4: f54080e7 jalr -172(ra) # 5844 <printf>
exit(1);
8f8: 4505 li a0,1
8fa: 00005097 auipc ra,0x5
8fe: bd2080e7 jalr -1070(ra) # 54cc <exit>
printf("%s: read %d bytes, wanted 6\n", s, n);
902: 862a mv a2,a0
904: 85d6 mv a1,s5
906: 00005517 auipc a0,0x5
90a: 77a50513 addi a0,a0,1914 # 6080 <l_free+0x61a>
90e: 00005097 auipc ra,0x5
912: f36080e7 jalr -202(ra) # 5844 <printf>
exit(1);
916: 4505 li a0,1
918: 00005097 auipc ra,0x5
91c: bb4080e7 jalr -1100(ra) # 54cc <exit>
printf("%s: read %d bytes, wanted 2\n", s, n);
920: 862a mv a2,a0
922: 85d6 mv a1,s5
924: 00005517 auipc a0,0x5
928: 77c50513 addi a0,a0,1916 # 60a0 <l_free+0x63a>
92c: 00005097 auipc ra,0x5
930: f18080e7 jalr -232(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
934: 4505 li a0,1
936: 00005097 auipc ra,0x5
93a: b96080e7 jalr -1130(ra) # 54cc <exit>
000000000000093e <writetest>:
93e: 7139 addi sp,sp,-64
940: fc06 sd ra,56(sp)
942: f822 sd s0,48(sp)
944: f426 sd s1,40(sp)
946: f04a sd s2,32(sp)
948: ec4e sd s3,24(sp)
94a: e852 sd s4,16(sp)
94c: e456 sd s5,8(sp)
94e: e05a sd s6,0(sp)
950: 0080 addi s0,sp,64
952: 8b2a mv s6,a0
954: 20200593 li a1,514
958: 00005517 auipc a0,0x5
<<<<<<< HEAD
95c: 76850513 addi a0,a0,1896 # 60c0 <l_free+0x658>
960: 00005097 auipc ra,0x5
964: bac080e7 jalr -1108(ra) # 550c <open>
=======
95c: 76850513 addi a0,a0,1896 # 60c0 <l_free+0x65a>
960: 00005097 auipc ra,0x5
964: bac080e7 jalr -1108(ra) # 550c <open>
if (fd < 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
968: 0a054d63 bltz a0,a22 <writetest+0xe4>
96c: 892a mv s2,a0
96e: 4481 li s1,0
970: 00005997 auipc s3,0x5
<<<<<<< HEAD
974: 77898993 addi s3,s3,1912 # 60e8 <l_free+0x680>
978: 00005a97 auipc s5,0x5
97c: 7a8a8a93 addi s5,s5,1960 # 6120 <l_free+0x6b8>
=======
974: 77898993 addi s3,s3,1912 # 60e8 <l_free+0x682>
if (write(fd, "bbbbbbbbbb", SZ) != SZ) {
978: 00005a97 auipc s5,0x5
97c: 7a8a8a93 addi s5,s5,1960 # 6120 <l_free+0x6ba>
for (i = 0; i < N; i++) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
980: 06400a13 li s4,100
984: 4629 li a2,10
986: 85ce mv a1,s3
988: 854a mv a0,s2
98a: 00005097 auipc ra,0x5
98e: b62080e7 jalr -1182(ra) # 54ec <write>
992: 47a9 li a5,10
994: 0af51563 bne a0,a5,a3e <writetest+0x100>
998: 4629 li a2,10
99a: 85d6 mv a1,s5
99c: 854a mv a0,s2
99e: 00005097 auipc ra,0x5
9a2: b4e080e7 jalr -1202(ra) # 54ec <write>
9a6: 47a9 li a5,10
9a8: 0af51963 bne a0,a5,a5a <writetest+0x11c>
9ac: 2485 addiw s1,s1,1
9ae: fd449be3 bne s1,s4,984 <writetest+0x46>
9b2: 854a mv a0,s2
9b4: 00005097 auipc ra,0x5
9b8: b40080e7 jalr -1216(ra) # 54f4 <close>
<<<<<<< HEAD
9bc: 4581 li a1,0
9be: 00005517 auipc a0,0x5
9c2: 70250513 addi a0,a0,1794 # 60c0 <l_free+0x658>
=======
fd = open("small", O_RDONLY);
9bc: 4581 li a1,0
9be: 00005517 auipc a0,0x5
9c2: 70250513 addi a0,a0,1794 # 60c0 <l_free+0x65a>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
9c6: 00005097 auipc ra,0x5
9ca: b46080e7 jalr -1210(ra) # 550c <open>
9ce: 84aa mv s1,a0
9d0: 0a054363 bltz a0,a76 <writetest+0x138>
9d4: 7d000613 li a2,2000
9d8: 0000b597 auipc a1,0xb
9dc: 03858593 addi a1,a1,56 # ba10 <buf>
9e0: 00005097 auipc ra,0x5
9e4: b04080e7 jalr -1276(ra) # 54e4 <read>
<<<<<<< HEAD
=======
if (i != N * SZ * 2) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
9e8: 7d000793 li a5,2000
9ec: 0af51363 bne a0,a5,a92 <writetest+0x154>
9f0: 8526 mv a0,s1
9f2: 00005097 auipc ra,0x5
9f6: b02080e7 jalr -1278(ra) # 54f4 <close>
<<<<<<< HEAD
9fa: 00005517 auipc a0,0x5
9fe: 6c650513 addi a0,a0,1734 # 60c0 <l_free+0x658>
=======
if (unlink("small") < 0) {
9fa: 00005517 auipc a0,0x5
9fe: 6c650513 addi a0,a0,1734 # 60c0 <l_free+0x65a>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
a02: 00005097 auipc ra,0x5
a06: b1a080e7 jalr -1254(ra) # 551c <unlink>
a0a: 0a054263 bltz a0,aae <writetest+0x170>
a0e: 70e2 ld ra,56(sp)
a10: 7442 ld s0,48(sp)
a12: 74a2 ld s1,40(sp)
a14: 7902 ld s2,32(sp)
a16: 69e2 ld s3,24(sp)
a18: 6a42 ld s4,16(sp)
a1a: 6aa2 ld s5,8(sp)
a1c: 6b02 ld s6,0(sp)
a1e: 6121 addi sp,sp,64
a20: 8082 ret
a22: 85da mv a1,s6
a24: 00005517 auipc a0,0x5
<<<<<<< HEAD
a28: 6a450513 addi a0,a0,1700 # 60c8 <l_free+0x660>
a2c: 00005097 auipc ra,0x5
a30: e1a080e7 jalr -486(ra) # 5846 <printf>
a34: 4505 li a0,1
a36: 00005097 auipc ra,0x5
a3a: a96080e7 jalr -1386(ra) # 54cc <exit>
a3e: 85a6 mv a1,s1
a40: 00005517 auipc a0,0x5
a44: 6b850513 addi a0,a0,1720 # 60f8 <l_free+0x690>
a48: 00005097 auipc ra,0x5
a4c: dfe080e7 jalr -514(ra) # 5846 <printf>
a50: 4505 li a0,1
a52: 00005097 auipc ra,0x5
a56: a7a080e7 jalr -1414(ra) # 54cc <exit>
a5a: 85a6 mv a1,s1
a5c: 00005517 auipc a0,0x5
a60: 6d450513 addi a0,a0,1748 # 6130 <l_free+0x6c8>
a64: 00005097 auipc ra,0x5
a68: de2080e7 jalr -542(ra) # 5846 <printf>
a6c: 4505 li a0,1
a6e: 00005097 auipc ra,0x5
a72: a5e080e7 jalr -1442(ra) # 54cc <exit>
a76: 85da mv a1,s6
a78: 00005517 auipc a0,0x5
a7c: 6e050513 addi a0,a0,1760 # 6158 <l_free+0x6f0>
a80: 00005097 auipc ra,0x5
a84: dc6080e7 jalr -570(ra) # 5846 <printf>
a88: 4505 li a0,1
a8a: 00005097 auipc ra,0x5
a8e: a42080e7 jalr -1470(ra) # 54cc <exit>
a92: 85da mv a1,s6
a94: 00005517 auipc a0,0x5
a98: 6e450513 addi a0,a0,1764 # 6178 <l_free+0x710>
a9c: 00005097 auipc ra,0x5
aa0: daa080e7 jalr -598(ra) # 5846 <printf>
aa4: 4505 li a0,1
aa6: 00005097 auipc ra,0x5
aaa: a26080e7 jalr -1498(ra) # 54cc <exit>
aae: 85da mv a1,s6
ab0: 00005517 auipc a0,0x5
ab4: 6e050513 addi a0,a0,1760 # 6190 <l_free+0x728>
ab8: 00005097 auipc ra,0x5
abc: d8e080e7 jalr -626(ra) # 5846 <printf>
=======
a28: 6a450513 addi a0,a0,1700 # 60c8 <l_free+0x662>
a2c: 00005097 auipc ra,0x5
a30: e18080e7 jalr -488(ra) # 5844 <printf>
exit(1);
a34: 4505 li a0,1
a36: 00005097 auipc ra,0x5
a3a: a96080e7 jalr -1386(ra) # 54cc <exit>
printf("%s: error: write aa %d new file failed\n", i);
a3e: 85a6 mv a1,s1
a40: 00005517 auipc a0,0x5
a44: 6b850513 addi a0,a0,1720 # 60f8 <l_free+0x692>
a48: 00005097 auipc ra,0x5
a4c: dfc080e7 jalr -516(ra) # 5844 <printf>
exit(1);
a50: 4505 li a0,1
a52: 00005097 auipc ra,0x5
a56: a7a080e7 jalr -1414(ra) # 54cc <exit>
printf("%s: error: write bb %d new file failed\n", i);
a5a: 85a6 mv a1,s1
a5c: 00005517 auipc a0,0x5
a60: 6d450513 addi a0,a0,1748 # 6130 <l_free+0x6ca>
a64: 00005097 auipc ra,0x5
a68: de0080e7 jalr -544(ra) # 5844 <printf>
exit(1);
a6c: 4505 li a0,1
a6e: 00005097 auipc ra,0x5
a72: a5e080e7 jalr -1442(ra) # 54cc <exit>
printf("%s: error: open small failed!\n", s);
a76: 85da mv a1,s6
a78: 00005517 auipc a0,0x5
a7c: 6e050513 addi a0,a0,1760 # 6158 <l_free+0x6f2>
a80: 00005097 auipc ra,0x5
a84: dc4080e7 jalr -572(ra) # 5844 <printf>
exit(1);
a88: 4505 li a0,1
a8a: 00005097 auipc ra,0x5
a8e: a42080e7 jalr -1470(ra) # 54cc <exit>
printf("%s: read failed\n", s);
a92: 85da mv a1,s6
a94: 00005517 auipc a0,0x5
a98: 6e450513 addi a0,a0,1764 # 6178 <l_free+0x712>
a9c: 00005097 auipc ra,0x5
aa0: da8080e7 jalr -600(ra) # 5844 <printf>
exit(1);
aa4: 4505 li a0,1
aa6: 00005097 auipc ra,0x5
aaa: a26080e7 jalr -1498(ra) # 54cc <exit>
printf("%s: unlink small failed\n", s);
aae: 85da mv a1,s6
ab0: 00005517 auipc a0,0x5
ab4: 6e050513 addi a0,a0,1760 # 6190 <l_free+0x72a>
ab8: 00005097 auipc ra,0x5
abc: d8c080e7 jalr -628(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
ac0: 4505 li a0,1
ac2: 00005097 auipc ra,0x5
ac6: a0a080e7 jalr -1526(ra) # 54cc <exit>
0000000000000aca <unlinkread>:
<<<<<<< HEAD
=======
void unlinkread(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
aca: 7179 addi sp,sp,-48
acc: f406 sd ra,40(sp)
ace: f022 sd s0,32(sp)
ad0: ec26 sd s1,24(sp)
ad2: e84a sd s2,16(sp)
ad4: e44e sd s3,8(sp)
ad6: 1800 addi s0,sp,48
ad8: 89aa mv s3,a0
<<<<<<< HEAD
ada: 20200593 li a1,514
ade: 00005517 auipc a0,0x5
ae2: 0fa50513 addi a0,a0,250 # 5bd8 <l_free+0x170>
ae6: 00005097 auipc ra,0x5
aea: a26080e7 jalr -1498(ra) # 550c <open>
aee: 0e054563 bltz a0,bd8 <unlinkread+0x10e>
af2: 84aa mv s1,a0
af4: 4615 li a2,5
af6: 00005597 auipc a1,0x5
afa: 6da58593 addi a1,a1,1754 # 61d0 <l_free+0x768>
afe: 00005097 auipc ra,0x5
b02: 9ee080e7 jalr -1554(ra) # 54ec <write>
b06: 8526 mv a0,s1
b08: 00005097 auipc ra,0x5
b0c: 9ec080e7 jalr -1556(ra) # 54f4 <close>
b10: 4589 li a1,2
b12: 00005517 auipc a0,0x5
b16: 0c650513 addi a0,a0,198 # 5bd8 <l_free+0x170>
b1a: 00005097 auipc ra,0x5
b1e: 9f2080e7 jalr -1550(ra) # 550c <open>
b22: 84aa mv s1,a0
b24: 0c054863 bltz a0,bf4 <unlinkread+0x12a>
b28: 00005517 auipc a0,0x5
b2c: 0b050513 addi a0,a0,176 # 5bd8 <l_free+0x170>
b30: 00005097 auipc ra,0x5
b34: 9ec080e7 jalr -1556(ra) # 551c <unlink>
b38: ed61 bnez a0,c10 <unlinkread+0x146>
b3a: 20200593 li a1,514
b3e: 00005517 auipc a0,0x5
b42: 09a50513 addi a0,a0,154 # 5bd8 <l_free+0x170>
b46: 00005097 auipc ra,0x5
b4a: 9c6080e7 jalr -1594(ra) # 550c <open>
b4e: 892a mv s2,a0
b50: 460d li a2,3
b52: 00005597 auipc a1,0x5
b56: 6c658593 addi a1,a1,1734 # 6218 <l_free+0x7b0>
b5a: 00005097 auipc ra,0x5
b5e: 992080e7 jalr -1646(ra) # 54ec <write>
b62: 854a mv a0,s2
b64: 00005097 auipc ra,0x5
b68: 990080e7 jalr -1648(ra) # 54f4 <close>
b6c: 660d lui a2,0x3
b6e: 0000b597 auipc a1,0xb
b72: ea258593 addi a1,a1,-350 # ba10 <buf>
=======
fd = open("unlinkread", O_CREATE | O_RDWR);
ada: 20200593 li a1,514
ade: 00005517 auipc a0,0x5
ae2: 0fa50513 addi a0,a0,250 # 5bd8 <l_free+0x172>
ae6: 00005097 auipc ra,0x5
aea: a26080e7 jalr -1498(ra) # 550c <open>
if (fd < 0) {
aee: 0e054563 bltz a0,bd8 <unlinkread+0x10e>
af2: 84aa mv s1,a0
write(fd, "hello", SZ);
af4: 4615 li a2,5
af6: 00005597 auipc a1,0x5
afa: 6da58593 addi a1,a1,1754 # 61d0 <l_free+0x76a>
afe: 00005097 auipc ra,0x5
b02: 9ee080e7 jalr -1554(ra) # 54ec <write>
close(fd);
b06: 8526 mv a0,s1
b08: 00005097 auipc ra,0x5
b0c: 9ec080e7 jalr -1556(ra) # 54f4 <close>
fd = open("unlinkread", O_RDWR);
b10: 4589 li a1,2
b12: 00005517 auipc a0,0x5
b16: 0c650513 addi a0,a0,198 # 5bd8 <l_free+0x172>
b1a: 00005097 auipc ra,0x5
b1e: 9f2080e7 jalr -1550(ra) # 550c <open>
b22: 84aa mv s1,a0
if (fd < 0) {
b24: 0c054863 bltz a0,bf4 <unlinkread+0x12a>
if (unlink("unlinkread") != 0) {
b28: 00005517 auipc a0,0x5
b2c: 0b050513 addi a0,a0,176 # 5bd8 <l_free+0x172>
b30: 00005097 auipc ra,0x5
b34: 9ec080e7 jalr -1556(ra) # 551c <unlink>
b38: ed61 bnez a0,c10 <unlinkread+0x146>
fd1 = open("unlinkread", O_CREATE | O_RDWR);
b3a: 20200593 li a1,514
b3e: 00005517 auipc a0,0x5
b42: 09a50513 addi a0,a0,154 # 5bd8 <l_free+0x172>
b46: 00005097 auipc ra,0x5
b4a: 9c6080e7 jalr -1594(ra) # 550c <open>
b4e: 892a mv s2,a0
write(fd1, "yyy", 3);
b50: 460d li a2,3
b52: 00005597 auipc a1,0x5
b56: 6c658593 addi a1,a1,1734 # 6218 <l_free+0x7b2>
b5a: 00005097 auipc ra,0x5
b5e: 992080e7 jalr -1646(ra) # 54ec <write>
close(fd1);
b62: 854a mv a0,s2
b64: 00005097 auipc ra,0x5
b68: 990080e7 jalr -1648(ra) # 54f4 <close>
if (read(fd, buf, sizeof(buf)) != SZ) {
b6c: 660d lui a2,0x3
b6e: 0000b597 auipc a1,0xb
b72: e4a58593 addi a1,a1,-438 # b9b8 <buf>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
b76: 8526 mv a0,s1
b78: 00005097 auipc ra,0x5
b7c: 96c080e7 jalr -1684(ra) # 54e4 <read>
b80: 4795 li a5,5
b82: 0af51563 bne a0,a5,c2c <unlinkread+0x162>
<<<<<<< HEAD
b86: 0000b717 auipc a4,0xb
b8a: e8a74703 lbu a4,-374(a4) # ba10 <buf>
b8e: 06800793 li a5,104
b92: 0af71b63 bne a4,a5,c48 <unlinkread+0x17e>
b96: 4629 li a2,10
b98: 0000b597 auipc a1,0xb
b9c: e7858593 addi a1,a1,-392 # ba10 <buf>
=======
if (buf[0] != 'h') {
b86: 0000b717 auipc a4,0xb
b8a: e3274703 lbu a4,-462(a4) # b9b8 <buf>
b8e: 06800793 li a5,104
b92: 0af71b63 bne a4,a5,c48 <unlinkread+0x17e>
if (write(fd, buf, 10) != 10) {
b96: 4629 li a2,10
b98: 0000b597 auipc a1,0xb
b9c: e2058593 addi a1,a1,-480 # b9b8 <buf>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
ba0: 8526 mv a0,s1
ba2: 00005097 auipc ra,0x5
ba6: 94a080e7 jalr -1718(ra) # 54ec <write>
baa: 47a9 li a5,10
bac: 0af51c63 bne a0,a5,c64 <unlinkread+0x19a>
<<<<<<< HEAD
bb0: 8526 mv a0,s1
bb2: 00005097 auipc ra,0x5
bb6: 942080e7 jalr -1726(ra) # 54f4 <close>
bba: 00005517 auipc a0,0x5
bbe: 01e50513 addi a0,a0,30 # 5bd8 <l_free+0x170>
bc2: 00005097 auipc ra,0x5
bc6: 95a080e7 jalr -1702(ra) # 551c <unlink>
=======
close(fd);
bb0: 8526 mv a0,s1
bb2: 00005097 auipc ra,0x5
bb6: 942080e7 jalr -1726(ra) # 54f4 <close>
unlink("unlinkread");
bba: 00005517 auipc a0,0x5
bbe: 01e50513 addi a0,a0,30 # 5bd8 <l_free+0x172>
bc2: 00005097 auipc ra,0x5
bc6: 95a080e7 jalr -1702(ra) # 551c <unlink>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
bca: 70a2 ld ra,40(sp)
bcc: 7402 ld s0,32(sp)
bce: 64e2 ld s1,24(sp)
bd0: 6942 ld s2,16(sp)
bd2: 69a2 ld s3,8(sp)
bd4: 6145 addi sp,sp,48
bd6: 8082 ret
<<<<<<< HEAD
bd8: 85ce mv a1,s3
bda: 00005517 auipc a0,0x5
bde: 5d650513 addi a0,a0,1494 # 61b0 <l_free+0x748>
be2: 00005097 auipc ra,0x5
be6: c64080e7 jalr -924(ra) # 5846 <printf>
bea: 4505 li a0,1
bec: 00005097 auipc ra,0x5
bf0: 8e0080e7 jalr -1824(ra) # 54cc <exit>
bf4: 85ce mv a1,s3
bf6: 00005517 auipc a0,0x5
bfa: 5e250513 addi a0,a0,1506 # 61d8 <l_free+0x770>
bfe: 00005097 auipc ra,0x5
c02: c48080e7 jalr -952(ra) # 5846 <printf>
c06: 4505 li a0,1
c08: 00005097 auipc ra,0x5
c0c: 8c4080e7 jalr -1852(ra) # 54cc <exit>
c10: 85ce mv a1,s3
c12: 00005517 auipc a0,0x5
c16: 5e650513 addi a0,a0,1510 # 61f8 <l_free+0x790>
c1a: 00005097 auipc ra,0x5
c1e: c2c080e7 jalr -980(ra) # 5846 <printf>
c22: 4505 li a0,1
c24: 00005097 auipc ra,0x5
c28: 8a8080e7 jalr -1880(ra) # 54cc <exit>
c2c: 85ce mv a1,s3
c2e: 00005517 auipc a0,0x5
c32: 5f250513 addi a0,a0,1522 # 6220 <l_free+0x7b8>
c36: 00005097 auipc ra,0x5
c3a: c10080e7 jalr -1008(ra) # 5846 <printf>
c3e: 4505 li a0,1
c40: 00005097 auipc ra,0x5
c44: 88c080e7 jalr -1908(ra) # 54cc <exit>
c48: 85ce mv a1,s3
c4a: 00005517 auipc a0,0x5
c4e: 5f650513 addi a0,a0,1526 # 6240 <l_free+0x7d8>
c52: 00005097 auipc ra,0x5
c56: bf4080e7 jalr -1036(ra) # 5846 <printf>
c5a: 4505 li a0,1
c5c: 00005097 auipc ra,0x5
c60: 870080e7 jalr -1936(ra) # 54cc <exit>
c64: 85ce mv a1,s3
c66: 00005517 auipc a0,0x5
c6a: 5fa50513 addi a0,a0,1530 # 6260 <l_free+0x7f8>
c6e: 00005097 auipc ra,0x5
c72: bd8080e7 jalr -1064(ra) # 5846 <printf>
=======
printf("%s: create unlinkread failed\n", s);
bd8: 85ce mv a1,s3
bda: 00005517 auipc a0,0x5
bde: 5d650513 addi a0,a0,1494 # 61b0 <l_free+0x74a>
be2: 00005097 auipc ra,0x5
be6: c62080e7 jalr -926(ra) # 5844 <printf>
exit(1);
bea: 4505 li a0,1
bec: 00005097 auipc ra,0x5
bf0: 8e0080e7 jalr -1824(ra) # 54cc <exit>
printf("%s: open unlinkread failed\n", s);
bf4: 85ce mv a1,s3
bf6: 00005517 auipc a0,0x5
bfa: 5e250513 addi a0,a0,1506 # 61d8 <l_free+0x772>
bfe: 00005097 auipc ra,0x5
c02: c46080e7 jalr -954(ra) # 5844 <printf>
exit(1);
c06: 4505 li a0,1
c08: 00005097 auipc ra,0x5
c0c: 8c4080e7 jalr -1852(ra) # 54cc <exit>
printf("%s: unlink unlinkread failed\n", s);
c10: 85ce mv a1,s3
c12: 00005517 auipc a0,0x5
c16: 5e650513 addi a0,a0,1510 # 61f8 <l_free+0x792>
c1a: 00005097 auipc ra,0x5
c1e: c2a080e7 jalr -982(ra) # 5844 <printf>
exit(1);
c22: 4505 li a0,1
c24: 00005097 auipc ra,0x5
c28: 8a8080e7 jalr -1880(ra) # 54cc <exit>
printf("%s: unlinkread read failed", s);
c2c: 85ce mv a1,s3
c2e: 00005517 auipc a0,0x5
c32: 5f250513 addi a0,a0,1522 # 6220 <l_free+0x7ba>
c36: 00005097 auipc ra,0x5
c3a: c0e080e7 jalr -1010(ra) # 5844 <printf>
exit(1);
c3e: 4505 li a0,1
c40: 00005097 auipc ra,0x5
c44: 88c080e7 jalr -1908(ra) # 54cc <exit>
printf("%s: unlinkread wrong data\n", s);
c48: 85ce mv a1,s3
c4a: 00005517 auipc a0,0x5
c4e: 5f650513 addi a0,a0,1526 # 6240 <l_free+0x7da>
c52: 00005097 auipc ra,0x5
c56: bf2080e7 jalr -1038(ra) # 5844 <printf>
exit(1);
c5a: 4505 li a0,1
c5c: 00005097 auipc ra,0x5
c60: 870080e7 jalr -1936(ra) # 54cc <exit>
printf("%s: unlinkread write failed\n", s);
c64: 85ce mv a1,s3
c66: 00005517 auipc a0,0x5
c6a: 5fa50513 addi a0,a0,1530 # 6260 <l_free+0x7fa>
c6e: 00005097 auipc ra,0x5
c72: bd6080e7 jalr -1066(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
c76: 4505 li a0,1
c78: 00005097 auipc ra,0x5
c7c: 854080e7 jalr -1964(ra) # 54cc <exit>
0000000000000c80 <linktest>:
<<<<<<< HEAD
=======
void linktest(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
c80: 1101 addi sp,sp,-32
c82: ec06 sd ra,24(sp)
c84: e822 sd s0,16(sp)
c86: e426 sd s1,8(sp)
c88: e04a sd s2,0(sp)
c8a: 1000 addi s0,sp,32
c8c: 892a mv s2,a0
<<<<<<< HEAD
c8e: 00005517 auipc a0,0x5
c92: 5f250513 addi a0,a0,1522 # 6280 <l_free+0x818>
c96: 00005097 auipc ra,0x5
c9a: 886080e7 jalr -1914(ra) # 551c <unlink>
c9e: 00005517 auipc a0,0x5
ca2: 5ea50513 addi a0,a0,1514 # 6288 <l_free+0x820>
ca6: 00005097 auipc ra,0x5
caa: 876080e7 jalr -1930(ra) # 551c <unlink>
cae: 20200593 li a1,514
cb2: 00005517 auipc a0,0x5
cb6: 5ce50513 addi a0,a0,1486 # 6280 <l_free+0x818>
cba: 00005097 auipc ra,0x5
cbe: 852080e7 jalr -1966(ra) # 550c <open>
cc2: 10054763 bltz a0,dd0 <linktest+0x150>
cc6: 84aa mv s1,a0
cc8: 4615 li a2,5
cca: 00005597 auipc a1,0x5
cce: 50658593 addi a1,a1,1286 # 61d0 <l_free+0x768>
=======
unlink("lf1");
c8e: 00005517 auipc a0,0x5
c92: 5f250513 addi a0,a0,1522 # 6280 <l_free+0x81a>
c96: 00005097 auipc ra,0x5
c9a: 886080e7 jalr -1914(ra) # 551c <unlink>
unlink("lf2");
c9e: 00005517 auipc a0,0x5
ca2: 5ea50513 addi a0,a0,1514 # 6288 <l_free+0x822>
ca6: 00005097 auipc ra,0x5
caa: 876080e7 jalr -1930(ra) # 551c <unlink>
fd = open("lf1", O_CREATE | O_RDWR);
cae: 20200593 li a1,514
cb2: 00005517 auipc a0,0x5
cb6: 5ce50513 addi a0,a0,1486 # 6280 <l_free+0x81a>
cba: 00005097 auipc ra,0x5
cbe: 852080e7 jalr -1966(ra) # 550c <open>
if (fd < 0) {
cc2: 10054763 bltz a0,dd0 <linktest+0x150>
cc6: 84aa mv s1,a0
if (write(fd, "hello", SZ) != SZ) {
cc8: 4615 li a2,5
cca: 00005597 auipc a1,0x5
cce: 50658593 addi a1,a1,1286 # 61d0 <l_free+0x76a>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
cd2: 00005097 auipc ra,0x5
cd6: 81a080e7 jalr -2022(ra) # 54ec <write>
cda: 4795 li a5,5
cdc: 10f51863 bne a0,a5,dec <linktest+0x16c>
<<<<<<< HEAD
ce0: 8526 mv a0,s1
ce2: 00005097 auipc ra,0x5
ce6: 812080e7 jalr -2030(ra) # 54f4 <close>
cea: 00005597 auipc a1,0x5
cee: 59e58593 addi a1,a1,1438 # 6288 <l_free+0x820>
cf2: 00005517 auipc a0,0x5
cf6: 58e50513 addi a0,a0,1422 # 6280 <l_free+0x818>
cfa: 00005097 auipc ra,0x5
cfe: 832080e7 jalr -1998(ra) # 552c <link>
d02: 10054363 bltz a0,e08 <linktest+0x188>
d06: 00005517 auipc a0,0x5
d0a: 57a50513 addi a0,a0,1402 # 6280 <l_free+0x818>
d0e: 00005097 auipc ra,0x5
d12: 80e080e7 jalr -2034(ra) # 551c <unlink>
d16: 4581 li a1,0
d18: 00005517 auipc a0,0x5
d1c: 56850513 addi a0,a0,1384 # 6280 <l_free+0x818>
d20: 00004097 auipc ra,0x4
d24: 7ec080e7 jalr 2028(ra) # 550c <open>
d28: 0e055e63 bgez a0,e24 <linktest+0x1a4>
d2c: 4581 li a1,0
d2e: 00005517 auipc a0,0x5
d32: 55a50513 addi a0,a0,1370 # 6288 <l_free+0x820>
d36: 00004097 auipc ra,0x4
d3a: 7d6080e7 jalr 2006(ra) # 550c <open>
d3e: 84aa mv s1,a0
d40: 10054063 bltz a0,e40 <linktest+0x1c0>
d44: 660d lui a2,0x3
d46: 0000b597 auipc a1,0xb
d4a: cca58593 addi a1,a1,-822 # ba10 <buf>
=======
close(fd);
ce0: 8526 mv a0,s1
ce2: 00005097 auipc ra,0x5
ce6: 812080e7 jalr -2030(ra) # 54f4 <close>
if (link("lf1", "lf2") < 0) {
cea: 00005597 auipc a1,0x5
cee: 59e58593 addi a1,a1,1438 # 6288 <l_free+0x822>
cf2: 00005517 auipc a0,0x5
cf6: 58e50513 addi a0,a0,1422 # 6280 <l_free+0x81a>
cfa: 00005097 auipc ra,0x5
cfe: 832080e7 jalr -1998(ra) # 552c <link>
d02: 10054363 bltz a0,e08 <linktest+0x188>
unlink("lf1");
d06: 00005517 auipc a0,0x5
d0a: 57a50513 addi a0,a0,1402 # 6280 <l_free+0x81a>
d0e: 00005097 auipc ra,0x5
d12: 80e080e7 jalr -2034(ra) # 551c <unlink>
if (open("lf1", 0) >= 0) {
d16: 4581 li a1,0
d18: 00005517 auipc a0,0x5
d1c: 56850513 addi a0,a0,1384 # 6280 <l_free+0x81a>
d20: 00004097 auipc ra,0x4
d24: 7ec080e7 jalr 2028(ra) # 550c <open>
d28: 0e055e63 bgez a0,e24 <linktest+0x1a4>
fd = open("lf2", 0);
d2c: 4581 li a1,0
d2e: 00005517 auipc a0,0x5
d32: 55a50513 addi a0,a0,1370 # 6288 <l_free+0x822>
d36: 00004097 auipc ra,0x4
d3a: 7d6080e7 jalr 2006(ra) # 550c <open>
d3e: 84aa mv s1,a0
if (fd < 0) {
d40: 10054063 bltz a0,e40 <linktest+0x1c0>
if (read(fd, buf, sizeof(buf)) != SZ) {
d44: 660d lui a2,0x3
d46: 0000b597 auipc a1,0xb
d4a: c7258593 addi a1,a1,-910 # b9b8 <buf>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
d4e: 00004097 auipc ra,0x4
d52: 796080e7 jalr 1942(ra) # 54e4 <read>
d56: 4795 li a5,5
d58: 10f51263 bne a0,a5,e5c <linktest+0x1dc>
<<<<<<< HEAD
d5c: 8526 mv a0,s1
d5e: 00004097 auipc ra,0x4
d62: 796080e7 jalr 1942(ra) # 54f4 <close>
d66: 00005597 auipc a1,0x5
d6a: 52258593 addi a1,a1,1314 # 6288 <l_free+0x820>
=======
close(fd);
d5c: 8526 mv a0,s1
d5e: 00004097 auipc ra,0x4
d62: 796080e7 jalr 1942(ra) # 54f4 <close>
if (link("lf2", "lf2") >= 0) {
d66: 00005597 auipc a1,0x5
d6a: 52258593 addi a1,a1,1314 # 6288 <l_free+0x822>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
d6e: 852e mv a0,a1
d70: 00004097 auipc ra,0x4
d74: 7bc080e7 jalr 1980(ra) # 552c <link>
d78: 10055063 bgez a0,e78 <linktest+0x1f8>
<<<<<<< HEAD
d7c: 00005517 auipc a0,0x5
d80: 50c50513 addi a0,a0,1292 # 6288 <l_free+0x820>
d84: 00004097 auipc ra,0x4
d88: 798080e7 jalr 1944(ra) # 551c <unlink>
d8c: 00005597 auipc a1,0x5
d90: 4f458593 addi a1,a1,1268 # 6280 <l_free+0x818>
d94: 00005517 auipc a0,0x5
d98: 4f450513 addi a0,a0,1268 # 6288 <l_free+0x820>
d9c: 00004097 auipc ra,0x4
da0: 790080e7 jalr 1936(ra) # 552c <link>
da4: 0e055863 bgez a0,e94 <linktest+0x214>
da8: 00005597 auipc a1,0x5
dac: 4d858593 addi a1,a1,1240 # 6280 <l_free+0x818>
db0: 00005517 auipc a0,0x5
db4: 5e050513 addi a0,a0,1504 # 6390 <l_free+0x928>
db8: 00004097 auipc ra,0x4
dbc: 774080e7 jalr 1908(ra) # 552c <link>
dc0: 0e055863 bgez a0,eb0 <linktest+0x230>
=======
unlink("lf2");
d7c: 00005517 auipc a0,0x5
d80: 50c50513 addi a0,a0,1292 # 6288 <l_free+0x822>
d84: 00004097 auipc ra,0x4
d88: 798080e7 jalr 1944(ra) # 551c <unlink>
if (link("lf2", "lf1") >= 0) {
d8c: 00005597 auipc a1,0x5
d90: 4f458593 addi a1,a1,1268 # 6280 <l_free+0x81a>
d94: 00005517 auipc a0,0x5
d98: 4f450513 addi a0,a0,1268 # 6288 <l_free+0x822>
d9c: 00004097 auipc ra,0x4
da0: 790080e7 jalr 1936(ra) # 552c <link>
da4: 0e055863 bgez a0,e94 <linktest+0x214>
if (link(".", "lf1") >= 0) {
da8: 00005597 auipc a1,0x5
dac: 4d858593 addi a1,a1,1240 # 6280 <l_free+0x81a>
db0: 00005517 auipc a0,0x5
db4: 5e050513 addi a0,a0,1504 # 6390 <l_free+0x92a>
db8: 00004097 auipc ra,0x4
dbc: 774080e7 jalr 1908(ra) # 552c <link>
dc0: 0e055863 bgez a0,eb0 <linktest+0x230>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
dc4: 60e2 ld ra,24(sp)
dc6: 6442 ld s0,16(sp)
dc8: 64a2 ld s1,8(sp)
dca: 6902 ld s2,0(sp)
dcc: 6105 addi sp,sp,32
dce: 8082 ret
<<<<<<< HEAD
dd0: 85ca mv a1,s2
dd2: 00005517 auipc a0,0x5
dd6: 4be50513 addi a0,a0,1214 # 6290 <l_free+0x828>
dda: 00005097 auipc ra,0x5
dde: a6c080e7 jalr -1428(ra) # 5846 <printf>
de2: 4505 li a0,1
de4: 00004097 auipc ra,0x4
de8: 6e8080e7 jalr 1768(ra) # 54cc <exit>
dec: 85ca mv a1,s2
dee: 00005517 auipc a0,0x5
df2: 4ba50513 addi a0,a0,1210 # 62a8 <l_free+0x840>
df6: 00005097 auipc ra,0x5
dfa: a50080e7 jalr -1456(ra) # 5846 <printf>
dfe: 4505 li a0,1
e00: 00004097 auipc ra,0x4
e04: 6cc080e7 jalr 1740(ra) # 54cc <exit>
e08: 85ca mv a1,s2
e0a: 00005517 auipc a0,0x5
e0e: 4b650513 addi a0,a0,1206 # 62c0 <l_free+0x858>
e12: 00005097 auipc ra,0x5
e16: a34080e7 jalr -1484(ra) # 5846 <printf>
e1a: 4505 li a0,1
e1c: 00004097 auipc ra,0x4
e20: 6b0080e7 jalr 1712(ra) # 54cc <exit>
e24: 85ca mv a1,s2
e26: 00005517 auipc a0,0x5
e2a: 4ba50513 addi a0,a0,1210 # 62e0 <l_free+0x878>
e2e: 00005097 auipc ra,0x5
e32: a18080e7 jalr -1512(ra) # 5846 <printf>
e36: 4505 li a0,1
e38: 00004097 auipc ra,0x4
e3c: 694080e7 jalr 1684(ra) # 54cc <exit>
e40: 85ca mv a1,s2
e42: 00005517 auipc a0,0x5
e46: 4ce50513 addi a0,a0,1230 # 6310 <l_free+0x8a8>
e4a: 00005097 auipc ra,0x5
e4e: 9fc080e7 jalr -1540(ra) # 5846 <printf>
e52: 4505 li a0,1
e54: 00004097 auipc ra,0x4
e58: 678080e7 jalr 1656(ra) # 54cc <exit>
e5c: 85ca mv a1,s2
e5e: 00005517 auipc a0,0x5
e62: 4ca50513 addi a0,a0,1226 # 6328 <l_free+0x8c0>
e66: 00005097 auipc ra,0x5
e6a: 9e0080e7 jalr -1568(ra) # 5846 <printf>
e6e: 4505 li a0,1
e70: 00004097 auipc ra,0x4
e74: 65c080e7 jalr 1628(ra) # 54cc <exit>
e78: 85ca mv a1,s2
e7a: 00005517 auipc a0,0x5
e7e: 4c650513 addi a0,a0,1222 # 6340 <l_free+0x8d8>
e82: 00005097 auipc ra,0x5
e86: 9c4080e7 jalr -1596(ra) # 5846 <printf>
e8a: 4505 li a0,1
e8c: 00004097 auipc ra,0x4
e90: 640080e7 jalr 1600(ra) # 54cc <exit>
e94: 85ca mv a1,s2
e96: 00005517 auipc a0,0x5
e9a: 4d250513 addi a0,a0,1234 # 6368 <l_free+0x900>
e9e: 00005097 auipc ra,0x5
ea2: 9a8080e7 jalr -1624(ra) # 5846 <printf>
ea6: 4505 li a0,1
ea8: 00004097 auipc ra,0x4
eac: 624080e7 jalr 1572(ra) # 54cc <exit>
eb0: 85ca mv a1,s2
eb2: 00005517 auipc a0,0x5
eb6: 4e650513 addi a0,a0,1254 # 6398 <l_free+0x930>
eba: 00005097 auipc ra,0x5
ebe: 98c080e7 jalr -1652(ra) # 5846 <printf>
=======
printf("%s: create lf1 failed\n", s);
dd0: 85ca mv a1,s2
dd2: 00005517 auipc a0,0x5
dd6: 4be50513 addi a0,a0,1214 # 6290 <l_free+0x82a>
dda: 00005097 auipc ra,0x5
dde: a6a080e7 jalr -1430(ra) # 5844 <printf>
exit(1);
de2: 4505 li a0,1
de4: 00004097 auipc ra,0x4
de8: 6e8080e7 jalr 1768(ra) # 54cc <exit>
printf("%s: write lf1 failed\n", s);
dec: 85ca mv a1,s2
dee: 00005517 auipc a0,0x5
df2: 4ba50513 addi a0,a0,1210 # 62a8 <l_free+0x842>
df6: 00005097 auipc ra,0x5
dfa: a4e080e7 jalr -1458(ra) # 5844 <printf>
exit(1);
dfe: 4505 li a0,1
e00: 00004097 auipc ra,0x4
e04: 6cc080e7 jalr 1740(ra) # 54cc <exit>
printf("%s: link lf1 lf2 failed\n", s);
e08: 85ca mv a1,s2
e0a: 00005517 auipc a0,0x5
e0e: 4b650513 addi a0,a0,1206 # 62c0 <l_free+0x85a>
e12: 00005097 auipc ra,0x5
e16: a32080e7 jalr -1486(ra) # 5844 <printf>
exit(1);
e1a: 4505 li a0,1
e1c: 00004097 auipc ra,0x4
e20: 6b0080e7 jalr 1712(ra) # 54cc <exit>
printf("%s: unlinked lf1 but it is still there!\n", s);
e24: 85ca mv a1,s2
e26: 00005517 auipc a0,0x5
e2a: 4ba50513 addi a0,a0,1210 # 62e0 <l_free+0x87a>
e2e: 00005097 auipc ra,0x5
e32: a16080e7 jalr -1514(ra) # 5844 <printf>
exit(1);
e36: 4505 li a0,1
e38: 00004097 auipc ra,0x4
e3c: 694080e7 jalr 1684(ra) # 54cc <exit>
printf("%s: open lf2 failed\n", s);
e40: 85ca mv a1,s2
e42: 00005517 auipc a0,0x5
e46: 4ce50513 addi a0,a0,1230 # 6310 <l_free+0x8aa>
e4a: 00005097 auipc ra,0x5
e4e: 9fa080e7 jalr -1542(ra) # 5844 <printf>
exit(1);
e52: 4505 li a0,1
e54: 00004097 auipc ra,0x4
e58: 678080e7 jalr 1656(ra) # 54cc <exit>
printf("%s: read lf2 failed\n", s);
e5c: 85ca mv a1,s2
e5e: 00005517 auipc a0,0x5
e62: 4ca50513 addi a0,a0,1226 # 6328 <l_free+0x8c2>
e66: 00005097 auipc ra,0x5
e6a: 9de080e7 jalr -1570(ra) # 5844 <printf>
exit(1);
e6e: 4505 li a0,1
e70: 00004097 auipc ra,0x4
e74: 65c080e7 jalr 1628(ra) # 54cc <exit>
printf("%s: link lf2 lf2 succeeded! oops\n", s);
e78: 85ca mv a1,s2
e7a: 00005517 auipc a0,0x5
e7e: 4c650513 addi a0,a0,1222 # 6340 <l_free+0x8da>
e82: 00005097 auipc ra,0x5
e86: 9c2080e7 jalr -1598(ra) # 5844 <printf>
exit(1);
e8a: 4505 li a0,1
e8c: 00004097 auipc ra,0x4
e90: 640080e7 jalr 1600(ra) # 54cc <exit>
printf("%s: link non-existant succeeded! oops\n", s);
e94: 85ca mv a1,s2
e96: 00005517 auipc a0,0x5
e9a: 4d250513 addi a0,a0,1234 # 6368 <l_free+0x902>
e9e: 00005097 auipc ra,0x5
ea2: 9a6080e7 jalr -1626(ra) # 5844 <printf>
exit(1);
ea6: 4505 li a0,1
ea8: 00004097 auipc ra,0x4
eac: 624080e7 jalr 1572(ra) # 54cc <exit>
printf("%s: link . lf1 succeeded! oops\n", s);
eb0: 85ca mv a1,s2
eb2: 00005517 auipc a0,0x5
eb6: 4e650513 addi a0,a0,1254 # 6398 <l_free+0x932>
eba: 00005097 auipc ra,0x5
ebe: 98a080e7 jalr -1654(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
ec2: 4505 li a0,1
ec4: 00004097 auipc ra,0x4
ec8: 608080e7 jalr 1544(ra) # 54cc <exit>
0000000000000ecc <bigdir>:
<<<<<<< HEAD
=======
void bigdir(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
ecc: 715d addi sp,sp,-80
ece: e486 sd ra,72(sp)
ed0: e0a2 sd s0,64(sp)
ed2: fc26 sd s1,56(sp)
ed4: f84a sd s2,48(sp)
ed6: f44e sd s3,40(sp)
ed8: f052 sd s4,32(sp)
eda: ec56 sd s5,24(sp)
edc: e85a sd s6,16(sp)
ede: 0880 addi s0,sp,80
ee0: 89aa mv s3,a0
<<<<<<< HEAD
ee2: 00005517 auipc a0,0x5
ee6: 4d650513 addi a0,a0,1238 # 63b8 <l_free+0x950>
eea: 00004097 auipc ra,0x4
eee: 632080e7 jalr 1586(ra) # 551c <unlink>
ef2: 20000593 li a1,512
ef6: 00005517 auipc a0,0x5
efa: 4c250513 addi a0,a0,1218 # 63b8 <l_free+0x950>
efe: 00004097 auipc ra,0x4
f02: 60e080e7 jalr 1550(ra) # 550c <open>
f06: 0c054963 bltz a0,fd8 <bigdir+0x10c>
f0a: 00004097 auipc ra,0x4
f0e: 5ea080e7 jalr 1514(ra) # 54f4 <close>
f12: 4901 li s2,0
f14: 07800a93 li s5,120
f18: 00005a17 auipc s4,0x5
f1c: 4a0a0a13 addi s4,s4,1184 # 63b8 <l_free+0x950>
f20: 1f400b13 li s6,500
f24: fb540823 sb s5,-80(s0)
=======
unlink("bd");
ee2: 00005517 auipc a0,0x5
ee6: 4d650513 addi a0,a0,1238 # 63b8 <l_free+0x952>
eea: 00004097 auipc ra,0x4
eee: 632080e7 jalr 1586(ra) # 551c <unlink>
fd = open("bd", O_CREATE);
ef2: 20000593 li a1,512
ef6: 00005517 auipc a0,0x5
efa: 4c250513 addi a0,a0,1218 # 63b8 <l_free+0x952>
efe: 00004097 auipc ra,0x4
f02: 60e080e7 jalr 1550(ra) # 550c <open>
if (fd < 0) {
f06: 0c054963 bltz a0,fd8 <bigdir+0x10c>
close(fd);
f0a: 00004097 auipc ra,0x4
f0e: 5ea080e7 jalr 1514(ra) # 54f4 <close>
for (i = 0; i < N; i++) {
f12: 4901 li s2,0
name[0] = 'x';
f14: 07800a93 li s5,120
if (link("bd", name) != 0) {
f18: 00005a17 auipc s4,0x5
f1c: 4a0a0a13 addi s4,s4,1184 # 63b8 <l_free+0x952>
for (i = 0; i < N; i++) {
f20: 1f400b13 li s6,500
name[0] = 'x';
f24: fb540823 sb s5,-80(s0)
name[1] = '0' + (i / 64);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
f28: 41f9579b sraiw a5,s2,0x1f
f2c: 01a7d71b srliw a4,a5,0x1a
f30: 012707bb addw a5,a4,s2
f34: 4067d69b sraiw a3,a5,0x6
f38: 0306869b addiw a3,a3,48
f3c: fad408a3 sb a3,-79(s0)
<<<<<<< HEAD
=======
name[2] = '0' + (i % 64);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
f40: 03f7f793 andi a5,a5,63
f44: 9f99 subw a5,a5,a4
f46: 0307879b addiw a5,a5,48
f4a: faf40923 sb a5,-78(s0)
<<<<<<< HEAD
f4e: fa0409a3 sb zero,-77(s0)
=======
name[3] = '\0';
f4e: fa0409a3 sb zero,-77(s0)
if (link("bd", name) != 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
f52: fb040593 addi a1,s0,-80
f56: 8552 mv a0,s4
f58: 00004097 auipc ra,0x4
f5c: 5d4080e7 jalr 1492(ra) # 552c <link>
f60: 84aa mv s1,a0
f62: e949 bnez a0,ff4 <bigdir+0x128>
<<<<<<< HEAD
f64: 2905 addiw s2,s2,1
f66: fb691fe3 bne s2,s6,f24 <bigdir+0x58>
f6a: 00005517 auipc a0,0x5
f6e: 44e50513 addi a0,a0,1102 # 63b8 <l_free+0x950>
f72: 00004097 auipc ra,0x4
f76: 5aa080e7 jalr 1450(ra) # 551c <unlink>
f7a: 07800913 li s2,120
f7e: 1f400a13 li s4,500
f82: fb240823 sb s2,-80(s0)
=======
for (i = 0; i < N; i++) {
f64: 2905 addiw s2,s2,1
f66: fb691fe3 bne s2,s6,f24 <bigdir+0x58>
unlink("bd");
f6a: 00005517 auipc a0,0x5
f6e: 44e50513 addi a0,a0,1102 # 63b8 <l_free+0x952>
f72: 00004097 auipc ra,0x4
f76: 5aa080e7 jalr 1450(ra) # 551c <unlink>
name[0] = 'x';
f7a: 07800913 li s2,120
for (i = 0; i < N; i++) {
f7e: 1f400a13 li s4,500
name[0] = 'x';
f82: fb240823 sb s2,-80(s0)
name[1] = '0' + (i / 64);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
f86: 41f4d79b sraiw a5,s1,0x1f
f8a: 01a7d71b srliw a4,a5,0x1a
f8e: 009707bb addw a5,a4,s1
f92: 4067d69b sraiw a3,a5,0x6
f96: 0306869b addiw a3,a3,48
f9a: fad408a3 sb a3,-79(s0)
<<<<<<< HEAD
=======
name[2] = '0' + (i % 64);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
f9e: 03f7f793 andi a5,a5,63
fa2: 9f99 subw a5,a5,a4
fa4: 0307879b addiw a5,a5,48
fa8: faf40923 sb a5,-78(s0)
<<<<<<< HEAD
fac: fa0409a3 sb zero,-77(s0)
=======
name[3] = '\0';
fac: fa0409a3 sb zero,-77(s0)
if (unlink(name) != 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
fb0: fb040513 addi a0,s0,-80
fb4: 00004097 auipc ra,0x4
fb8: 568080e7 jalr 1384(ra) # 551c <unlink>
fbc: ed21 bnez a0,1014 <bigdir+0x148>
<<<<<<< HEAD
fbe: 2485 addiw s1,s1,1
fc0: fd4491e3 bne s1,s4,f82 <bigdir+0xb6>
=======
for (i = 0; i < N; i++) {
fbe: 2485 addiw s1,s1,1
fc0: fd4491e3 bne s1,s4,f82 <bigdir+0xb6>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
fc4: 60a6 ld ra,72(sp)
fc6: 6406 ld s0,64(sp)
fc8: 74e2 ld s1,56(sp)
fca: 7942 ld s2,48(sp)
fcc: 79a2 ld s3,40(sp)
fce: 7a02 ld s4,32(sp)
fd0: 6ae2 ld s5,24(sp)
fd2: 6b42 ld s6,16(sp)
fd4: 6161 addi sp,sp,80
fd6: 8082 ret
<<<<<<< HEAD
fd8: 85ce mv a1,s3
fda: 00005517 auipc a0,0x5
fde: 3e650513 addi a0,a0,998 # 63c0 <l_free+0x958>
fe2: 00005097 auipc ra,0x5
fe6: 864080e7 jalr -1948(ra) # 5846 <printf>
fea: 4505 li a0,1
fec: 00004097 auipc ra,0x4
ff0: 4e0080e7 jalr 1248(ra) # 54cc <exit>
ff4: fb040613 addi a2,s0,-80
ff8: 85ce mv a1,s3
ffa: 00005517 auipc a0,0x5
ffe: 3e650513 addi a0,a0,998 # 63e0 <l_free+0x978>
1002: 00005097 auipc ra,0x5
1006: 844080e7 jalr -1980(ra) # 5846 <printf>
100a: 4505 li a0,1
100c: 00004097 auipc ra,0x4
1010: 4c0080e7 jalr 1216(ra) # 54cc <exit>
1014: 85ce mv a1,s3
1016: 00005517 auipc a0,0x5
101a: 3ea50513 addi a0,a0,1002 # 6400 <l_free+0x998>
101e: 00005097 auipc ra,0x5
1022: 828080e7 jalr -2008(ra) # 5846 <printf>
=======
printf("%s: bigdir create failed\n", s);
fd8: 85ce mv a1,s3
fda: 00005517 auipc a0,0x5
fde: 3e650513 addi a0,a0,998 # 63c0 <l_free+0x95a>
fe2: 00005097 auipc ra,0x5
fe6: 862080e7 jalr -1950(ra) # 5844 <printf>
exit(1);
fea: 4505 li a0,1
fec: 00004097 auipc ra,0x4
ff0: 4e0080e7 jalr 1248(ra) # 54cc <exit>
printf("%s: bigdir link(bd, %s) failed\n", s, name);
ff4: fb040613 addi a2,s0,-80
ff8: 85ce mv a1,s3
ffa: 00005517 auipc a0,0x5
ffe: 3e650513 addi a0,a0,998 # 63e0 <l_free+0x97a>
1002: 00005097 auipc ra,0x5
1006: 842080e7 jalr -1982(ra) # 5844 <printf>
exit(1);
100a: 4505 li a0,1
100c: 00004097 auipc ra,0x4
1010: 4c0080e7 jalr 1216(ra) # 54cc <exit>
printf("%s: bigdir unlink failed", s);
1014: 85ce mv a1,s3
1016: 00005517 auipc a0,0x5
101a: 3ea50513 addi a0,a0,1002 # 6400 <l_free+0x99a>
101e: 00005097 auipc ra,0x5
1022: 826080e7 jalr -2010(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1026: 4505 li a0,1
1028: 00004097 auipc ra,0x4
102c: 4a4080e7 jalr 1188(ra) # 54cc <exit>
0000000000001030 <validatetest>:
<<<<<<< HEAD
=======
void validatetest(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1030: 7139 addi sp,sp,-64
1032: fc06 sd ra,56(sp)
1034: f822 sd s0,48(sp)
1036: f426 sd s1,40(sp)
1038: f04a sd s2,32(sp)
103a: ec4e sd s3,24(sp)
103c: e852 sd s4,16(sp)
103e: e456 sd s5,8(sp)
1040: e05a sd s6,0(sp)
1042: 0080 addi s0,sp,64
1044: 8b2a mv s6,a0
<<<<<<< HEAD
1046: 4481 li s1,0
1048: 00005997 auipc s3,0x5
104c: 3d898993 addi s3,s3,984 # 6420 <l_free+0x9b8>
1050: 597d li s2,-1
1052: 6a85 lui s5,0x1
1054: 00114a37 lui s4,0x114
=======
for (p = 0; p <= (uint)hi; p += PGSIZE) {
1046: 4481 li s1,0
if (link("nosuchfile", (char *)p) != -1) {
1048: 00005997 auipc s3,0x5
104c: 3d898993 addi s3,s3,984 # 6420 <l_free+0x9ba>
1050: 597d li s2,-1
for (p = 0; p <= (uint)hi; p += PGSIZE) {
1052: 6a85 lui s5,0x1
1054: 00114a37 lui s4,0x114
if (link("nosuchfile", (char *)p) != -1) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1058: 85a6 mv a1,s1
105a: 854e mv a0,s3
105c: 00004097 auipc ra,0x4
1060: 4d0080e7 jalr 1232(ra) # 552c <link>
1064: 01251f63 bne a0,s2,1082 <validatetest+0x52>
<<<<<<< HEAD
1068: 94d6 add s1,s1,s5
106a: ff4497e3 bne s1,s4,1058 <validatetest+0x28>
=======
for (p = 0; p <= (uint)hi; p += PGSIZE) {
1068: 94d6 add s1,s1,s5
106a: ff4497e3 bne s1,s4,1058 <validatetest+0x28>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
106e: 70e2 ld ra,56(sp)
1070: 7442 ld s0,48(sp)
1072: 74a2 ld s1,40(sp)
1074: 7902 ld s2,32(sp)
1076: 69e2 ld s3,24(sp)
1078: 6a42 ld s4,16(sp)
107a: 6aa2 ld s5,8(sp)
107c: 6b02 ld s6,0(sp)
107e: 6121 addi sp,sp,64
1080: 8082 ret
<<<<<<< HEAD
1082: 85da mv a1,s6
1084: 00005517 auipc a0,0x5
1088: 3ac50513 addi a0,a0,940 # 6430 <l_free+0x9c8>
108c: 00004097 auipc ra,0x4
1090: 7ba080e7 jalr 1978(ra) # 5846 <printf>
=======
printf("%s: link should not succeed\n", s);
1082: 85da mv a1,s6
1084: 00005517 auipc a0,0x5
1088: 3ac50513 addi a0,a0,940 # 6430 <l_free+0x9ca>
108c: 00004097 auipc ra,0x4
1090: 7b8080e7 jalr 1976(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1094: 4505 li a0,1
1096: 00004097 auipc ra,0x4
109a: 436080e7 jalr 1078(ra) # 54cc <exit>
000000000000109e <pgbug>:
<<<<<<< HEAD
=======
void pgbug(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
109e: 7179 addi sp,sp,-48
10a0: f406 sd ra,40(sp)
10a2: f022 sd s0,32(sp)
10a4: ec26 sd s1,24(sp)
10a6: 1800 addi s0,sp,48
<<<<<<< HEAD
10a8: fc043c23 sd zero,-40(s0)
10ac: 00007497 auipc s1,0x7
10b0: 11c4b483 ld s1,284(s1) # 81c8 <__SDATA_BEGIN__>
=======
argv[0] = 0;
10a8: fc043c23 sd zero,-40(s0)
exec((char *)0xeaeb0b5b00002f5e, argv);
10ac: 00007497 auipc s1,0x7
10b0: 0c44b483 ld s1,196(s1) # 8170 <__SDATA_BEGIN__>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
10b4: fd840593 addi a1,s0,-40
10b8: 8526 mv a0,s1
10ba: 00004097 auipc ra,0x4
10be: 44a080e7 jalr 1098(ra) # 5504 <exec>
<<<<<<< HEAD
10c2: 8526 mv a0,s1
10c4: 00004097 auipc ra,0x4
10c8: 418080e7 jalr 1048(ra) # 54dc <pipe>
=======
pipe((int *)0xeaeb0b5b00002f5e);
10c2: 8526 mv a0,s1
10c4: 00004097 auipc ra,0x4
10c8: 418080e7 jalr 1048(ra) # 54dc <pipe>
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
10cc: 4501 li a0,0
10ce: 00004097 auipc ra,0x4
10d2: 3fe080e7 jalr 1022(ra) # 54cc <exit>
00000000000010d6 <badarg>:
<<<<<<< HEAD
=======
}
// regression test. test whether exec() leaks memory if one of the
// arguments is invalid. the test passes if the kernel doesn't panic.
void badarg(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
10d6: 7139 addi sp,sp,-64
10d8: fc06 sd ra,56(sp)
10da: f822 sd s0,48(sp)
10dc: f426 sd s1,40(sp)
10de: f04a sd s2,32(sp)
10e0: ec4e sd s3,24(sp)
10e2: 0080 addi s0,sp,64
10e4: 64b1 lui s1,0xc
<<<<<<< HEAD
10e6: 35048493 addi s1,s1,848 # c350 <buf+0x940>
10ea: 597d li s2,-1
10ec: 02095913 srli s2,s2,0x20
10f0: 00005997 auipc s3,0x5
10f4: cc898993 addi s3,s3,-824 # 5db8 <l_free+0x350>
10f8: fd243023 sd s2,-64(s0)
10fc: fc043423 sd zero,-56(s0)
=======
10e6: 35048493 addi s1,s1,848 # c350 <buf+0x998>
for (int i = 0; i < 50000; i++) {
char *argv[2];
argv[0] = (char *)0xffffffff;
10ea: 597d li s2,-1
10ec: 02095913 srli s2,s2,0x20
argv[1] = 0;
exec("echo", argv);
10f0: 00005997 auipc s3,0x5
10f4: cc898993 addi s3,s3,-824 # 5db8 <l_free+0x352>
argv[0] = (char *)0xffffffff;
10f8: fd243023 sd s2,-64(s0)
argv[1] = 0;
10fc: fc043423 sd zero,-56(s0)
exec("echo", argv);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1100: fc040593 addi a1,s0,-64
1104: 854e mv a0,s3
1106: 00004097 auipc ra,0x4
110a: 3fe080e7 jalr 1022(ra) # 5504 <exec>
<<<<<<< HEAD
110e: 34fd addiw s1,s1,-1
1110: f4e5 bnez s1,10f8 <badarg+0x22>
=======
for (int i = 0; i < 50000; i++) {
110e: 34fd addiw s1,s1,-1
1110: f4e5 bnez s1,10f8 <badarg+0x22>
}
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1112: 4501 li a0,0
1114: 00004097 auipc ra,0x4
1118: 3b8080e7 jalr 952(ra) # 54cc <exit>
000000000000111c <copyinstr2>:
<<<<<<< HEAD
=======
void copyinstr2(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
111c: 7155 addi sp,sp,-208
111e: e586 sd ra,200(sp)
1120: e1a2 sd s0,192(sp)
1122: 0980 addi s0,sp,208
<<<<<<< HEAD
1124: f6840793 addi a5,s0,-152
1128: fe840693 addi a3,s0,-24
112c: 07800713 li a4,120
1130: 00e78023 sb a4,0(a5)
1134: 0785 addi a5,a5,1
1136: fed79de3 bne a5,a3,1130 <copyinstr2+0x14>
113a: fe040423 sb zero,-24(s0)
113e: f6840513 addi a0,s0,-152
1142: 00004097 auipc ra,0x4
1146: 3da080e7 jalr 986(ra) # 551c <unlink>
114a: 57fd li a5,-1
114c: 0ef51063 bne a0,a5,122c <copyinstr2+0x110>
=======
for (int i = 0; i < MAXPATH; i++)
1124: f6840793 addi a5,s0,-152
1128: fe840693 addi a3,s0,-24
b[i] = 'x';
112c: 07800713 li a4,120
1130: 00e78023 sb a4,0(a5)
for (int i = 0; i < MAXPATH; i++)
1134: 0785 addi a5,a5,1
1136: fed79de3 bne a5,a3,1130 <copyinstr2+0x14>
b[MAXPATH] = '\0';
113a: fe040423 sb zero,-24(s0)
int ret = unlink(b);
113e: f6840513 addi a0,s0,-152
1142: 00004097 auipc ra,0x4
1146: 3da080e7 jalr 986(ra) # 551c <unlink>
if (ret != -1) {
114a: 57fd li a5,-1
114c: 0ef51063 bne a0,a5,122c <copyinstr2+0x110>
int fd = open(b, O_CREATE | O_WRONLY);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1150: 20100593 li a1,513
1154: f6840513 addi a0,s0,-152
1158: 00004097 auipc ra,0x4
115c: 3b4080e7 jalr 948(ra) # 550c <open>
<<<<<<< HEAD
1160: 57fd li a5,-1
1162: 0ef51563 bne a0,a5,124c <copyinstr2+0x130>
=======
if (fd != -1) {
1160: 57fd li a5,-1
1162: 0ef51563 bne a0,a5,124c <copyinstr2+0x130>
ret = link(b, b);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1166: f6840593 addi a1,s0,-152
116a: 852e mv a0,a1
116c: 00004097 auipc ra,0x4
1170: 3c0080e7 jalr 960(ra) # 552c <link>
<<<<<<< HEAD
1174: 57fd li a5,-1
1176: 0ef51b63 bne a0,a5,126c <copyinstr2+0x150>
117a: 00006797 auipc a5,0x6
117e: 37e78793 addi a5,a5,894 # 74f8 <l_free+0x1a90>
1182: f4f43c23 sd a5,-168(s0)
1186: f6043023 sd zero,-160(s0)
=======
if (ret != -1) {
1174: 57fd li a5,-1
1176: 0ef51b63 bne a0,a5,126c <copyinstr2+0x150>
char *args[] = {"xx", 0};
117a: 00006797 auipc a5,0x6
117e: 37e78793 addi a5,a5,894 # 74f8 <l_free+0x1a92>
1182: f4f43c23 sd a5,-168(s0)
1186: f6043023 sd zero,-160(s0)
ret = exec(b, args);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
118a: f5840593 addi a1,s0,-168
118e: f6840513 addi a0,s0,-152
1192: 00004097 auipc ra,0x4
1196: 372080e7 jalr 882(ra) # 5504 <exec>
<<<<<<< HEAD
119a: 57fd li a5,-1
119c: 0ef51963 bne a0,a5,128e <copyinstr2+0x172>
11a0: 00004097 auipc ra,0x4
11a4: 324080e7 jalr 804(ra) # 54c4 <fork>
11a8: 10054363 bltz a0,12ae <copyinstr2+0x192>
11ac: 12051463 bnez a0,12d4 <copyinstr2+0x1b8>
11b0: 00007797 auipc a5,0x7
11b4: 14878793 addi a5,a5,328 # 82f8 <big.0>
11b8: 00008697 auipc a3,0x8
11bc: 14068693 addi a3,a3,320 # 92f8 <__global_pointer$+0x930>
11c0: 07800713 li a4,120
11c4: 00e78023 sb a4,0(a5)
11c8: 0785 addi a5,a5,1
11ca: fed79de3 bne a5,a3,11c4 <copyinstr2+0xa8>
11ce: 00008797 auipc a5,0x8
11d2: 12078523 sb zero,298(a5) # 92f8 <__global_pointer$+0x930>
11d6: 00007797 auipc a5,0x7
11da: bca78793 addi a5,a5,-1078 # 7da0 <l_free+0x2338>
=======
if (ret != -1) {
119a: 57fd li a5,-1
119c: 0ef51963 bne a0,a5,128e <copyinstr2+0x172>
int pid = fork();
11a0: 00004097 auipc ra,0x4
11a4: 324080e7 jalr 804(ra) # 54c4 <fork>
if (pid < 0) {
11a8: 10054363 bltz a0,12ae <copyinstr2+0x192>
if (pid == 0) {
11ac: 12051463 bnez a0,12d4 <copyinstr2+0x1b8>
11b0: 00007797 auipc a5,0x7
11b4: 0f078793 addi a5,a5,240 # 82a0 <big.0>
11b8: 00008697 auipc a3,0x8
11bc: 0e868693 addi a3,a3,232 # 92a0 <__global_pointer$+0x930>
big[i] = 'x';
11c0: 07800713 li a4,120
11c4: 00e78023 sb a4,0(a5)
for (int i = 0; i < PGSIZE; i++)
11c8: 0785 addi a5,a5,1
11ca: fed79de3 bne a5,a3,11c4 <copyinstr2+0xa8>
big[PGSIZE] = '\0';
11ce: 00008797 auipc a5,0x8
11d2: 0c078923 sb zero,210(a5) # 92a0 <__global_pointer$+0x930>
char *args2[] = {big, big, big, 0};
11d6: 00007797 auipc a5,0x7
11da: bca78793 addi a5,a5,-1078 # 7da0 <l_free+0x233a>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
11de: 6390 ld a2,0(a5)
11e0: 6794 ld a3,8(a5)
11e2: 6b98 ld a4,16(a5)
11e4: 6f9c ld a5,24(a5)
11e6: f2c43823 sd a2,-208(s0)
11ea: f2d43c23 sd a3,-200(s0)
11ee: f4e43023 sd a4,-192(s0)
11f2: f4f43423 sd a5,-184(s0)
<<<<<<< HEAD
11f6: f3040593 addi a1,s0,-208
11fa: 00005517 auipc a0,0x5
11fe: bbe50513 addi a0,a0,-1090 # 5db8 <l_free+0x350>
1202: 00004097 auipc ra,0x4
1206: 302080e7 jalr 770(ra) # 5504 <exec>
120a: 57fd li a5,-1
120c: 0af50e63 beq a0,a5,12c8 <copyinstr2+0x1ac>
1210: 55fd li a1,-1
1212: 00005517 auipc a0,0x5
1216: 2c650513 addi a0,a0,710 # 64d8 <l_free+0xa70>
121a: 00004097 auipc ra,0x4
121e: 62c080e7 jalr 1580(ra) # 5846 <printf>
1222: 4505 li a0,1
1224: 00004097 auipc ra,0x4
1228: 2a8080e7 jalr 680(ra) # 54cc <exit>
122c: 862a mv a2,a0
122e: f6840593 addi a1,s0,-152
1232: 00005517 auipc a0,0x5
1236: 21e50513 addi a0,a0,542 # 6450 <l_free+0x9e8>
123a: 00004097 auipc ra,0x4
123e: 60c080e7 jalr 1548(ra) # 5846 <printf>
1242: 4505 li a0,1
1244: 00004097 auipc ra,0x4
1248: 288080e7 jalr 648(ra) # 54cc <exit>
124c: 862a mv a2,a0
124e: f6840593 addi a1,s0,-152
1252: 00005517 auipc a0,0x5
1256: 21e50513 addi a0,a0,542 # 6470 <l_free+0xa08>
125a: 00004097 auipc ra,0x4
125e: 5ec080e7 jalr 1516(ra) # 5846 <printf>
1262: 4505 li a0,1
1264: 00004097 auipc ra,0x4
1268: 268080e7 jalr 616(ra) # 54cc <exit>
=======
ret = exec("echo", args2);
11f6: f3040593 addi a1,s0,-208
11fa: 00005517 auipc a0,0x5
11fe: bbe50513 addi a0,a0,-1090 # 5db8 <l_free+0x352>
1202: 00004097 auipc ra,0x4
1206: 302080e7 jalr 770(ra) # 5504 <exec>
if (ret != -1) {
120a: 57fd li a5,-1
120c: 0af50e63 beq a0,a5,12c8 <copyinstr2+0x1ac>
printf("exec(echo, BIG) returned %d, not -1\n", fd);
1210: 55fd li a1,-1
1212: 00005517 auipc a0,0x5
1216: 2c650513 addi a0,a0,710 # 64d8 <l_free+0xa72>
121a: 00004097 auipc ra,0x4
121e: 62a080e7 jalr 1578(ra) # 5844 <printf>
exit(1);
1222: 4505 li a0,1
1224: 00004097 auipc ra,0x4
1228: 2a8080e7 jalr 680(ra) # 54cc <exit>
printf("unlink(%s) returned %d, not -1\n", b, ret);
122c: 862a mv a2,a0
122e: f6840593 addi a1,s0,-152
1232: 00005517 auipc a0,0x5
1236: 21e50513 addi a0,a0,542 # 6450 <l_free+0x9ea>
123a: 00004097 auipc ra,0x4
123e: 60a080e7 jalr 1546(ra) # 5844 <printf>
exit(1);
1242: 4505 li a0,1
1244: 00004097 auipc ra,0x4
1248: 288080e7 jalr 648(ra) # 54cc <exit>
printf("open(%s) returned %d, not -1\n", b, fd);
124c: 862a mv a2,a0
124e: f6840593 addi a1,s0,-152
1252: 00005517 auipc a0,0x5
1256: 21e50513 addi a0,a0,542 # 6470 <l_free+0xa0a>
125a: 00004097 auipc ra,0x4
125e: 5ea080e7 jalr 1514(ra) # 5844 <printf>
exit(1);
1262: 4505 li a0,1
1264: 00004097 auipc ra,0x4
1268: 268080e7 jalr 616(ra) # 54cc <exit>
printf("link(%s, %s) returned %d, not -1\n", b, b, ret);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
126c: 86aa mv a3,a0
126e: f6840613 addi a2,s0,-152
1272: 85b2 mv a1,a2
1274: 00005517 auipc a0,0x5
<<<<<<< HEAD
1278: 21c50513 addi a0,a0,540 # 6490 <l_free+0xa28>
127c: 00004097 auipc ra,0x4
1280: 5ca080e7 jalr 1482(ra) # 5846 <printf>
1284: 4505 li a0,1
1286: 00004097 auipc ra,0x4
128a: 246080e7 jalr 582(ra) # 54cc <exit>
128e: 567d li a2,-1
1290: f6840593 addi a1,s0,-152
1294: 00005517 auipc a0,0x5
1298: 22450513 addi a0,a0,548 # 64b8 <l_free+0xa50>
129c: 00004097 auipc ra,0x4
12a0: 5aa080e7 jalr 1450(ra) # 5846 <printf>
12a4: 4505 li a0,1
12a6: 00004097 auipc ra,0x4
12aa: 226080e7 jalr 550(ra) # 54cc <exit>
12ae: 00005517 auipc a0,0x5
12b2: 67250513 addi a0,a0,1650 # 6920 <l_free+0xeb8>
12b6: 00004097 auipc ra,0x4
12ba: 590080e7 jalr 1424(ra) # 5846 <printf>
12be: 4505 li a0,1
12c0: 00004097 auipc ra,0x4
12c4: 20c080e7 jalr 524(ra) # 54cc <exit>
12c8: 2eb00513 li a0,747
12cc: 00004097 auipc ra,0x4
12d0: 200080e7 jalr 512(ra) # 54cc <exit>
12d4: f4042a23 sw zero,-172(s0)
12d8: f5440513 addi a0,s0,-172
12dc: 00004097 auipc ra,0x4
12e0: 1f8080e7 jalr 504(ra) # 54d4 <wait>
12e4: f5442703 lw a4,-172(s0)
12e8: 2eb00793 li a5,747
12ec: 00f71663 bne a4,a5,12f8 <copyinstr2+0x1dc>
=======
1278: 21c50513 addi a0,a0,540 # 6490 <l_free+0xa2a>
127c: 00004097 auipc ra,0x4
1280: 5c8080e7 jalr 1480(ra) # 5844 <printf>
exit(1);
1284: 4505 li a0,1
1286: 00004097 auipc ra,0x4
128a: 246080e7 jalr 582(ra) # 54cc <exit>
printf("exec(%s) returned %d, not -1\n", b, fd);
128e: 567d li a2,-1
1290: f6840593 addi a1,s0,-152
1294: 00005517 auipc a0,0x5
1298: 22450513 addi a0,a0,548 # 64b8 <l_free+0xa52>
129c: 00004097 auipc ra,0x4
12a0: 5a8080e7 jalr 1448(ra) # 5844 <printf>
exit(1);
12a4: 4505 li a0,1
12a6: 00004097 auipc ra,0x4
12aa: 226080e7 jalr 550(ra) # 54cc <exit>
printf("fork failed\n");
12ae: 00005517 auipc a0,0x5
12b2: 67250513 addi a0,a0,1650 # 6920 <l_free+0xeba>
12b6: 00004097 auipc ra,0x4
12ba: 58e080e7 jalr 1422(ra) # 5844 <printf>
exit(1);
12be: 4505 li a0,1
12c0: 00004097 auipc ra,0x4
12c4: 20c080e7 jalr 524(ra) # 54cc <exit>
exit(747); // OK
12c8: 2eb00513 li a0,747
12cc: 00004097 auipc ra,0x4
12d0: 200080e7 jalr 512(ra) # 54cc <exit>
int st = 0;
12d4: f4042a23 sw zero,-172(s0)
wait(&st);
12d8: f5440513 addi a0,s0,-172
12dc: 00004097 auipc ra,0x4
12e0: 1f8080e7 jalr 504(ra) # 54d4 <wait>
if (st != 747) {
12e4: f5442703 lw a4,-172(s0)
12e8: 2eb00793 li a5,747
12ec: 00f71663 bne a4,a5,12f8 <copyinstr2+0x1dc>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
12f0: 60ae ld ra,200(sp)
12f2: 640e ld s0,192(sp)
12f4: 6169 addi sp,sp,208
12f6: 8082 ret
<<<<<<< HEAD
12f8: 00005517 auipc a0,0x5
12fc: 20850513 addi a0,a0,520 # 6500 <l_free+0xa98>
1300: 00004097 auipc ra,0x4
1304: 546080e7 jalr 1350(ra) # 5846 <printf>
=======
printf("exec(echo, BIG) succeeded, should have failed\n");
12f8: 00005517 auipc a0,0x5
12fc: 20850513 addi a0,a0,520 # 6500 <l_free+0xa9a>
1300: 00004097 auipc ra,0x4
1304: 544080e7 jalr 1348(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1308: 4505 li a0,1
130a: 00004097 auipc ra,0x4
130e: 1c2080e7 jalr 450(ra) # 54cc <exit>
0000000000001312 <truncate3>:
<<<<<<< HEAD
=======
void truncate3(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1312: 7159 addi sp,sp,-112
1314: f486 sd ra,104(sp)
1316: f0a2 sd s0,96(sp)
1318: eca6 sd s1,88(sp)
131a: e8ca sd s2,80(sp)
131c: e4ce sd s3,72(sp)
131e: e0d2 sd s4,64(sp)
1320: fc56 sd s5,56(sp)
1322: 1880 addi s0,sp,112
1324: 892a mv s2,a0
<<<<<<< HEAD
1326: 60100593 li a1,1537
132a: 00005517 auipc a0,0x5
132e: ae650513 addi a0,a0,-1306 # 5e10 <l_free+0x3a8>
=======
close(open("truncfile", O_CREATE | O_TRUNC | O_WRONLY));
1326: 60100593 li a1,1537
132a: 00005517 auipc a0,0x5
132e: ae650513 addi a0,a0,-1306 # 5e10 <l_free+0x3aa>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1332: 00004097 auipc ra,0x4
1336: 1da080e7 jalr 474(ra) # 550c <open>
133a: 00004097 auipc ra,0x4
133e: 1ba080e7 jalr 442(ra) # 54f4 <close>
<<<<<<< HEAD
1342: 00004097 auipc ra,0x4
1346: 182080e7 jalr 386(ra) # 54c4 <fork>
134a: 08054063 bltz a0,13ca <truncate3+0xb8>
134e: e969 bnez a0,1420 <truncate3+0x10e>
1350: 06400993 li s3,100
1354: 00005a17 auipc s4,0x5
1358: abca0a13 addi s4,s4,-1348 # 5e10 <l_free+0x3a8>
135c: 00005a97 auipc s5,0x5
1360: 204a8a93 addi s5,s5,516 # 6560 <l_free+0xaf8>
=======
pid = fork();
1342: 00004097 auipc ra,0x4
1346: 182080e7 jalr 386(ra) # 54c4 <fork>
if (pid < 0) {
134a: 08054063 bltz a0,13ca <truncate3+0xb8>
if (pid == 0) {
134e: e969 bnez a0,1420 <truncate3+0x10e>
1350: 06400993 li s3,100
int fd = open("truncfile", O_WRONLY);
1354: 00005a17 auipc s4,0x5
1358: abca0a13 addi s4,s4,-1348 # 5e10 <l_free+0x3aa>
int n = write(fd, "1234567890", 10);
135c: 00005a97 auipc s5,0x5
1360: 204a8a93 addi s5,s5,516 # 6560 <l_free+0xafa>
int fd = open("truncfile", O_WRONLY);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1364: 4585 li a1,1
1366: 8552 mv a0,s4
1368: 00004097 auipc ra,0x4
136c: 1a4080e7 jalr 420(ra) # 550c <open>
1370: 84aa mv s1,a0
<<<<<<< HEAD
1372: 06054a63 bltz a0,13e6 <truncate3+0xd4>
=======
if (fd < 0) {
1372: 06054a63 bltz a0,13e6 <truncate3+0xd4>
int n = write(fd, "1234567890", 10);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1376: 4629 li a2,10
1378: 85d6 mv a1,s5
137a: 00004097 auipc ra,0x4
137e: 172080e7 jalr 370(ra) # 54ec <write>
<<<<<<< HEAD
1382: 47a9 li a5,10
1384: 06f51f63 bne a0,a5,1402 <truncate3+0xf0>
1388: 8526 mv a0,s1
138a: 00004097 auipc ra,0x4
138e: 16a080e7 jalr 362(ra) # 54f4 <close>
=======
if (n != 10) {
1382: 47a9 li a5,10
1384: 06f51f63 bne a0,a5,1402 <truncate3+0xf0>
close(fd);
1388: 8526 mv a0,s1
138a: 00004097 auipc ra,0x4
138e: 16a080e7 jalr 362(ra) # 54f4 <close>
fd = open("truncfile", O_RDONLY);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1392: 4581 li a1,0
1394: 8552 mv a0,s4
1396: 00004097 auipc ra,0x4
139a: 176080e7 jalr 374(ra) # 550c <open>
139e: 84aa mv s1,a0
<<<<<<< HEAD
=======
read(fd, buf, sizeof(buf));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
13a0: 02000613 li a2,32
13a4: f9840593 addi a1,s0,-104
13a8: 00004097 auipc ra,0x4
13ac: 13c080e7 jalr 316(ra) # 54e4 <read>
<<<<<<< HEAD
13b0: 8526 mv a0,s1
13b2: 00004097 auipc ra,0x4
13b6: 142080e7 jalr 322(ra) # 54f4 <close>
13ba: 39fd addiw s3,s3,-1
13bc: fa0994e3 bnez s3,1364 <truncate3+0x52>
13c0: 4501 li a0,0
13c2: 00004097 auipc ra,0x4
13c6: 10a080e7 jalr 266(ra) # 54cc <exit>
13ca: 85ca mv a1,s2
13cc: 00005517 auipc a0,0x5
13d0: 16450513 addi a0,a0,356 # 6530 <l_free+0xac8>
13d4: 00004097 auipc ra,0x4
13d8: 472080e7 jalr 1138(ra) # 5846 <printf>
13dc: 4505 li a0,1
13de: 00004097 auipc ra,0x4
13e2: 0ee080e7 jalr 238(ra) # 54cc <exit>
13e6: 85ca mv a1,s2
13e8: 00005517 auipc a0,0x5
13ec: 16050513 addi a0,a0,352 # 6548 <l_free+0xae0>
13f0: 00004097 auipc ra,0x4
13f4: 456080e7 jalr 1110(ra) # 5846 <printf>
13f8: 4505 li a0,1
13fa: 00004097 auipc ra,0x4
13fe: 0d2080e7 jalr 210(ra) # 54cc <exit>
1402: 862a mv a2,a0
1404: 85ca mv a1,s2
1406: 00005517 auipc a0,0x5
140a: 16a50513 addi a0,a0,362 # 6570 <l_free+0xb08>
140e: 00004097 auipc ra,0x4
1412: 438080e7 jalr 1080(ra) # 5846 <printf>
=======
close(fd);
13b0: 8526 mv a0,s1
13b2: 00004097 auipc ra,0x4
13b6: 142080e7 jalr 322(ra) # 54f4 <close>
for (int i = 0; i < 100; i++) {
13ba: 39fd addiw s3,s3,-1
13bc: fa0994e3 bnez s3,1364 <truncate3+0x52>
exit(0);
13c0: 4501 li a0,0
13c2: 00004097 auipc ra,0x4
13c6: 10a080e7 jalr 266(ra) # 54cc <exit>
printf("%s: fork failed\n", s);
13ca: 85ca mv a1,s2
13cc: 00005517 auipc a0,0x5
13d0: 16450513 addi a0,a0,356 # 6530 <l_free+0xaca>
13d4: 00004097 auipc ra,0x4
13d8: 470080e7 jalr 1136(ra) # 5844 <printf>
exit(1);
13dc: 4505 li a0,1
13de: 00004097 auipc ra,0x4
13e2: 0ee080e7 jalr 238(ra) # 54cc <exit>
printf("%s: open failed\n", s);
13e6: 85ca mv a1,s2
13e8: 00005517 auipc a0,0x5
13ec: 16050513 addi a0,a0,352 # 6548 <l_free+0xae2>
13f0: 00004097 auipc ra,0x4
13f4: 454080e7 jalr 1108(ra) # 5844 <printf>
exit(1);
13f8: 4505 li a0,1
13fa: 00004097 auipc ra,0x4
13fe: 0d2080e7 jalr 210(ra) # 54cc <exit>
printf("%s: write got %d, expected 10\n", s, n);
1402: 862a mv a2,a0
1404: 85ca mv a1,s2
1406: 00005517 auipc a0,0x5
140a: 16a50513 addi a0,a0,362 # 6570 <l_free+0xb0a>
140e: 00004097 auipc ra,0x4
1412: 436080e7 jalr 1078(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1416: 4505 li a0,1
1418: 00004097 auipc ra,0x4
141c: 0b4080e7 jalr 180(ra) # 54cc <exit>
1420: 09600993 li s3,150
<<<<<<< HEAD
1424: 00005a17 auipc s4,0x5
1428: 9eca0a13 addi s4,s4,-1556 # 5e10 <l_free+0x3a8>
142c: 00005a97 auipc s5,0x5
1430: 164a8a93 addi s5,s5,356 # 6590 <l_free+0xb28>
=======
int fd = open("truncfile", O_CREATE | O_WRONLY | O_TRUNC);
1424: 00005a17 auipc s4,0x5
1428: 9eca0a13 addi s4,s4,-1556 # 5e10 <l_free+0x3aa>
int n = write(fd, "xxx", 3);
142c: 00005a97 auipc s5,0x5
1430: 164a8a93 addi s5,s5,356 # 6590 <l_free+0xb2a>
int fd = open("truncfile", O_CREATE | O_WRONLY | O_TRUNC);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1434: 60100593 li a1,1537
1438: 8552 mv a0,s4
143a: 00004097 auipc ra,0x4
143e: 0d2080e7 jalr 210(ra) # 550c <open>
1442: 84aa mv s1,a0
<<<<<<< HEAD
1444: 04054763 bltz a0,1492 <truncate3+0x180>
=======
if (fd < 0) {
1444: 04054763 bltz a0,1492 <truncate3+0x180>
int n = write(fd, "xxx", 3);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1448: 460d li a2,3
144a: 85d6 mv a1,s5
144c: 00004097 auipc ra,0x4
1450: 0a0080e7 jalr 160(ra) # 54ec <write>
<<<<<<< HEAD
1454: 478d li a5,3
1456: 04f51c63 bne a0,a5,14ae <truncate3+0x19c>
145a: 8526 mv a0,s1
145c: 00004097 auipc ra,0x4
1460: 098080e7 jalr 152(ra) # 54f4 <close>
1464: 39fd addiw s3,s3,-1
1466: fc0997e3 bnez s3,1434 <truncate3+0x122>
146a: fbc40513 addi a0,s0,-68
146e: 00004097 auipc ra,0x4
1472: 066080e7 jalr 102(ra) # 54d4 <wait>
1476: 00005517 auipc a0,0x5
147a: 99a50513 addi a0,a0,-1638 # 5e10 <l_free+0x3a8>
147e: 00004097 auipc ra,0x4
1482: 09e080e7 jalr 158(ra) # 551c <unlink>
1486: fbc42503 lw a0,-68(s0)
148a: 00004097 auipc ra,0x4
148e: 042080e7 jalr 66(ra) # 54cc <exit>
1492: 85ca mv a1,s2
1494: 00005517 auipc a0,0x5
1498: 0b450513 addi a0,a0,180 # 6548 <l_free+0xae0>
149c: 00004097 auipc ra,0x4
14a0: 3aa080e7 jalr 938(ra) # 5846 <printf>
14a4: 4505 li a0,1
14a6: 00004097 auipc ra,0x4
14aa: 026080e7 jalr 38(ra) # 54cc <exit>
14ae: 862a mv a2,a0
14b0: 85ca mv a1,s2
14b2: 00005517 auipc a0,0x5
14b6: 0e650513 addi a0,a0,230 # 6598 <l_free+0xb30>
14ba: 00004097 auipc ra,0x4
14be: 38c080e7 jalr 908(ra) # 5846 <printf>
=======
if (n != 3) {
1454: 478d li a5,3
1456: 04f51c63 bne a0,a5,14ae <truncate3+0x19c>
close(fd);
145a: 8526 mv a0,s1
145c: 00004097 auipc ra,0x4
1460: 098080e7 jalr 152(ra) # 54f4 <close>
for (int i = 0; i < 150; i++) {
1464: 39fd addiw s3,s3,-1
1466: fc0997e3 bnez s3,1434 <truncate3+0x122>
wait(&xstatus);
146a: fbc40513 addi a0,s0,-68
146e: 00004097 auipc ra,0x4
1472: 066080e7 jalr 102(ra) # 54d4 <wait>
unlink("truncfile");
1476: 00005517 auipc a0,0x5
147a: 99a50513 addi a0,a0,-1638 # 5e10 <l_free+0x3aa>
147e: 00004097 auipc ra,0x4
1482: 09e080e7 jalr 158(ra) # 551c <unlink>
exit(xstatus);
1486: fbc42503 lw a0,-68(s0)
148a: 00004097 auipc ra,0x4
148e: 042080e7 jalr 66(ra) # 54cc <exit>
printf("%s: open failed\n", s);
1492: 85ca mv a1,s2
1494: 00005517 auipc a0,0x5
1498: 0b450513 addi a0,a0,180 # 6548 <l_free+0xae2>
149c: 00004097 auipc ra,0x4
14a0: 3a8080e7 jalr 936(ra) # 5844 <printf>
exit(1);
14a4: 4505 li a0,1
14a6: 00004097 auipc ra,0x4
14aa: 026080e7 jalr 38(ra) # 54cc <exit>
printf("%s: write got %d, expected 3\n", s, n);
14ae: 862a mv a2,a0
14b0: 85ca mv a1,s2
14b2: 00005517 auipc a0,0x5
14b6: 0e650513 addi a0,a0,230 # 6598 <l_free+0xb32>
14ba: 00004097 auipc ra,0x4
14be: 38a080e7 jalr 906(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
14c2: 4505 li a0,1
14c4: 00004097 auipc ra,0x4
14c8: 008080e7 jalr 8(ra) # 54cc <exit>
00000000000014cc <exectest>:
<<<<<<< HEAD
=======
void exectest(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
14cc: 715d addi sp,sp,-80
14ce: e486 sd ra,72(sp)
14d0: e0a2 sd s0,64(sp)
14d2: fc26 sd s1,56(sp)
14d4: f84a sd s2,48(sp)
14d6: 0880 addi s0,sp,80
14d8: 892a mv s2,a0
<<<<<<< HEAD
14da: 00005797 auipc a5,0x5
14de: 8de78793 addi a5,a5,-1826 # 5db8 <l_free+0x350>
14e2: fcf43023 sd a5,-64(s0)
14e6: 00005797 auipc a5,0x5
14ea: 0d278793 addi a5,a5,210 # 65b8 <l_free+0xb50>
14ee: fcf43423 sd a5,-56(s0)
14f2: fc043823 sd zero,-48(s0)
14f6: 00005517 auipc a0,0x5
14fa: 0ca50513 addi a0,a0,202 # 65c0 <l_free+0xb58>
14fe: 00004097 auipc ra,0x4
1502: 01e080e7 jalr 30(ra) # 551c <unlink>
1506: 00004097 auipc ra,0x4
150a: fbe080e7 jalr -66(ra) # 54c4 <fork>
150e: 04054663 bltz a0,155a <exectest+0x8e>
1512: 84aa mv s1,a0
1514: e959 bnez a0,15aa <exectest+0xde>
1516: 4505 li a0,1
1518: 00004097 auipc ra,0x4
151c: fdc080e7 jalr -36(ra) # 54f4 <close>
1520: 20100593 li a1,513
1524: 00005517 auipc a0,0x5
1528: 09c50513 addi a0,a0,156 # 65c0 <l_free+0xb58>
152c: 00004097 auipc ra,0x4
1530: fe0080e7 jalr -32(ra) # 550c <open>
1534: 04054163 bltz a0,1576 <exectest+0xaa>
1538: 4785 li a5,1
153a: 04f50c63 beq a0,a5,1592 <exectest+0xc6>
153e: 85ca mv a1,s2
1540: 00005517 auipc a0,0x5
1544: 0a050513 addi a0,a0,160 # 65e0 <l_free+0xb78>
1548: 00004097 auipc ra,0x4
154c: 2fe080e7 jalr 766(ra) # 5846 <printf>
1550: 4505 li a0,1
1552: 00004097 auipc ra,0x4
1556: f7a080e7 jalr -134(ra) # 54cc <exit>
155a: 85ca mv a1,s2
155c: 00005517 auipc a0,0x5
1560: fd450513 addi a0,a0,-44 # 6530 <l_free+0xac8>
1564: 00004097 auipc ra,0x4
1568: 2e2080e7 jalr 738(ra) # 5846 <printf>
156c: 4505 li a0,1
156e: 00004097 auipc ra,0x4
1572: f5e080e7 jalr -162(ra) # 54cc <exit>
1576: 85ca mv a1,s2
1578: 00005517 auipc a0,0x5
157c: 05050513 addi a0,a0,80 # 65c8 <l_free+0xb60>
1580: 00004097 auipc ra,0x4
1584: 2c6080e7 jalr 710(ra) # 5846 <printf>
1588: 4505 li a0,1
158a: 00004097 auipc ra,0x4
158e: f42080e7 jalr -190(ra) # 54cc <exit>
1592: fc040593 addi a1,s0,-64
1596: 00005517 auipc a0,0x5
159a: 82250513 addi a0,a0,-2014 # 5db8 <l_free+0x350>
159e: 00004097 auipc ra,0x4
15a2: f66080e7 jalr -154(ra) # 5504 <exec>
15a6: 02054163 bltz a0,15c8 <exectest+0xfc>
=======
char *echoargv[] = {"echo", "OK", 0};
14da: 00005797 auipc a5,0x5
14de: 8de78793 addi a5,a5,-1826 # 5db8 <l_free+0x352>
14e2: fcf43023 sd a5,-64(s0)
14e6: 00005797 auipc a5,0x5
14ea: 0d278793 addi a5,a5,210 # 65b8 <l_free+0xb52>
14ee: fcf43423 sd a5,-56(s0)
14f2: fc043823 sd zero,-48(s0)
unlink("echo-ok");
14f6: 00005517 auipc a0,0x5
14fa: 0ca50513 addi a0,a0,202 # 65c0 <l_free+0xb5a>
14fe: 00004097 auipc ra,0x4
1502: 01e080e7 jalr 30(ra) # 551c <unlink>
pid = fork();
1506: 00004097 auipc ra,0x4
150a: fbe080e7 jalr -66(ra) # 54c4 <fork>
if (pid < 0) {
150e: 04054663 bltz a0,155a <exectest+0x8e>
1512: 84aa mv s1,a0
if (pid == 0) {
1514: e959 bnez a0,15aa <exectest+0xde>
close(1);
1516: 4505 li a0,1
1518: 00004097 auipc ra,0x4
151c: fdc080e7 jalr -36(ra) # 54f4 <close>
fd = open("echo-ok", O_CREATE | O_WRONLY);
1520: 20100593 li a1,513
1524: 00005517 auipc a0,0x5
1528: 09c50513 addi a0,a0,156 # 65c0 <l_free+0xb5a>
152c: 00004097 auipc ra,0x4
1530: fe0080e7 jalr -32(ra) # 550c <open>
if (fd < 0) {
1534: 04054163 bltz a0,1576 <exectest+0xaa>
if (fd != 1) {
1538: 4785 li a5,1
153a: 04f50c63 beq a0,a5,1592 <exectest+0xc6>
printf("%s: wrong fd\n", s);
153e: 85ca mv a1,s2
1540: 00005517 auipc a0,0x5
1544: 0a050513 addi a0,a0,160 # 65e0 <l_free+0xb7a>
1548: 00004097 auipc ra,0x4
154c: 2fc080e7 jalr 764(ra) # 5844 <printf>
exit(1);
1550: 4505 li a0,1
1552: 00004097 auipc ra,0x4
1556: f7a080e7 jalr -134(ra) # 54cc <exit>
printf("%s: fork failed\n", s);
155a: 85ca mv a1,s2
155c: 00005517 auipc a0,0x5
1560: fd450513 addi a0,a0,-44 # 6530 <l_free+0xaca>
1564: 00004097 auipc ra,0x4
1568: 2e0080e7 jalr 736(ra) # 5844 <printf>
exit(1);
156c: 4505 li a0,1
156e: 00004097 auipc ra,0x4
1572: f5e080e7 jalr -162(ra) # 54cc <exit>
printf("%s: create failed\n", s);
1576: 85ca mv a1,s2
1578: 00005517 auipc a0,0x5
157c: 05050513 addi a0,a0,80 # 65c8 <l_free+0xb62>
1580: 00004097 auipc ra,0x4
1584: 2c4080e7 jalr 708(ra) # 5844 <printf>
exit(1);
1588: 4505 li a0,1
158a: 00004097 auipc ra,0x4
158e: f42080e7 jalr -190(ra) # 54cc <exit>
if (exec("echo", echoargv) < 0) {
1592: fc040593 addi a1,s0,-64
1596: 00005517 auipc a0,0x5
159a: 82250513 addi a0,a0,-2014 # 5db8 <l_free+0x352>
159e: 00004097 auipc ra,0x4
15a2: f66080e7 jalr -154(ra) # 5504 <exec>
15a6: 02054163 bltz a0,15c8 <exectest+0xfc>
if (wait(&xstatus) != pid) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
15aa: fdc40513 addi a0,s0,-36
15ae: 00004097 auipc ra,0x4
15b2: f26080e7 jalr -218(ra) # 54d4 <wait>
15b6: 02951763 bne a0,s1,15e4 <exectest+0x118>
<<<<<<< HEAD
15ba: fdc42503 lw a0,-36(s0)
15be: cd0d beqz a0,15f8 <exectest+0x12c>
15c0: 00004097 auipc ra,0x4
15c4: f0c080e7 jalr -244(ra) # 54cc <exit>
15c8: 85ca mv a1,s2
15ca: 00005517 auipc a0,0x5
15ce: 02650513 addi a0,a0,38 # 65f0 <l_free+0xb88>
15d2: 00004097 auipc ra,0x4
15d6: 274080e7 jalr 628(ra) # 5846 <printf>
15da: 4505 li a0,1
15dc: 00004097 auipc ra,0x4
15e0: ef0080e7 jalr -272(ra) # 54cc <exit>
15e4: 85ca mv a1,s2
15e6: 00005517 auipc a0,0x5
15ea: 02250513 addi a0,a0,34 # 6608 <l_free+0xba0>
15ee: 00004097 auipc ra,0x4
15f2: 258080e7 jalr 600(ra) # 5846 <printf>
15f6: b7d1 j 15ba <exectest+0xee>
15f8: 4581 li a1,0
15fa: 00005517 auipc a0,0x5
15fe: fc650513 addi a0,a0,-58 # 65c0 <l_free+0xb58>
1602: 00004097 auipc ra,0x4
1606: f0a080e7 jalr -246(ra) # 550c <open>
160a: 02054a63 bltz a0,163e <exectest+0x172>
=======
if (xstatus != 0)
15ba: fdc42503 lw a0,-36(s0)
15be: cd0d beqz a0,15f8 <exectest+0x12c>
exit(xstatus);
15c0: 00004097 auipc ra,0x4
15c4: f0c080e7 jalr -244(ra) # 54cc <exit>
printf("%s: exec echo failed\n", s);
15c8: 85ca mv a1,s2
15ca: 00005517 auipc a0,0x5
15ce: 02650513 addi a0,a0,38 # 65f0 <l_free+0xb8a>
15d2: 00004097 auipc ra,0x4
15d6: 272080e7 jalr 626(ra) # 5844 <printf>
exit(1);
15da: 4505 li a0,1
15dc: 00004097 auipc ra,0x4
15e0: ef0080e7 jalr -272(ra) # 54cc <exit>
printf("%s: wait failed!\n", s);
15e4: 85ca mv a1,s2
15e6: 00005517 auipc a0,0x5
15ea: 02250513 addi a0,a0,34 # 6608 <l_free+0xba2>
15ee: 00004097 auipc ra,0x4
15f2: 256080e7 jalr 598(ra) # 5844 <printf>
15f6: b7d1 j 15ba <exectest+0xee>
fd = open("echo-ok", O_RDONLY);
15f8: 4581 li a1,0
15fa: 00005517 auipc a0,0x5
15fe: fc650513 addi a0,a0,-58 # 65c0 <l_free+0xb5a>
1602: 00004097 auipc ra,0x4
1606: f0a080e7 jalr -246(ra) # 550c <open>
if (fd < 0) {
160a: 02054a63 bltz a0,163e <exectest+0x172>
if (read(fd, buf, 2) != 2) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
160e: 4609 li a2,2
1610: fb840593 addi a1,s0,-72
1614: 00004097 auipc ra,0x4
1618: ed0080e7 jalr -304(ra) # 54e4 <read>
161c: 4789 li a5,2
161e: 02f50e63 beq a0,a5,165a <exectest+0x18e>
<<<<<<< HEAD
1622: 85ca mv a1,s2
1624: 00005517 auipc a0,0x5
1628: b5450513 addi a0,a0,-1196 # 6178 <l_free+0x710>
162c: 00004097 auipc ra,0x4
1630: 21a080e7 jalr 538(ra) # 5846 <printf>
1634: 4505 li a0,1
1636: 00004097 auipc ra,0x4
163a: e96080e7 jalr -362(ra) # 54cc <exit>
163e: 85ca mv a1,s2
1640: 00005517 auipc a0,0x5
1644: f0850513 addi a0,a0,-248 # 6548 <l_free+0xae0>
1648: 00004097 auipc ra,0x4
164c: 1fe080e7 jalr 510(ra) # 5846 <printf>
1650: 4505 li a0,1
1652: 00004097 auipc ra,0x4
1656: e7a080e7 jalr -390(ra) # 54cc <exit>
165a: 00005517 auipc a0,0x5
165e: f6650513 addi a0,a0,-154 # 65c0 <l_free+0xb58>
1662: 00004097 auipc ra,0x4
1666: eba080e7 jalr -326(ra) # 551c <unlink>
=======
printf("%s: read failed\n", s);
1622: 85ca mv a1,s2
1624: 00005517 auipc a0,0x5
1628: b5450513 addi a0,a0,-1196 # 6178 <l_free+0x712>
162c: 00004097 auipc ra,0x4
1630: 218080e7 jalr 536(ra) # 5844 <printf>
exit(1);
1634: 4505 li a0,1
1636: 00004097 auipc ra,0x4
163a: e96080e7 jalr -362(ra) # 54cc <exit>
printf("%s: open failed\n", s);
163e: 85ca mv a1,s2
1640: 00005517 auipc a0,0x5
1644: f0850513 addi a0,a0,-248 # 6548 <l_free+0xae2>
1648: 00004097 auipc ra,0x4
164c: 1fc080e7 jalr 508(ra) # 5844 <printf>
exit(1);
1650: 4505 li a0,1
1652: 00004097 auipc ra,0x4
1656: e7a080e7 jalr -390(ra) # 54cc <exit>
unlink("echo-ok");
165a: 00005517 auipc a0,0x5
165e: f6650513 addi a0,a0,-154 # 65c0 <l_free+0xb5a>
1662: 00004097 auipc ra,0x4
1666: eba080e7 jalr -326(ra) # 551c <unlink>
if (buf[0] == 'O' && buf[1] == 'K')
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
166a: fb844703 lbu a4,-72(s0)
166e: 04f00793 li a5,79
1672: 00f71863 bne a4,a5,1682 <exectest+0x1b6>
1676: fb944703 lbu a4,-71(s0)
167a: 04b00793 li a5,75
167e: 02f70063 beq a4,a5,169e <exectest+0x1d2>
<<<<<<< HEAD
1682: 85ca mv a1,s2
1684: 00005517 auipc a0,0x5
1688: f9c50513 addi a0,a0,-100 # 6620 <l_free+0xbb8>
168c: 00004097 auipc ra,0x4
1690: 1ba080e7 jalr 442(ra) # 5846 <printf>
1694: 4505 li a0,1
1696: 00004097 auipc ra,0x4
169a: e36080e7 jalr -458(ra) # 54cc <exit>
=======
printf("%s: wrong output\n", s);
1682: 85ca mv a1,s2
1684: 00005517 auipc a0,0x5
1688: f9c50513 addi a0,a0,-100 # 6620 <l_free+0xbba>
168c: 00004097 auipc ra,0x4
1690: 1b8080e7 jalr 440(ra) # 5844 <printf>
exit(1);
1694: 4505 li a0,1
1696: 00004097 auipc ra,0x4
169a: e36080e7 jalr -458(ra) # 54cc <exit>
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
169e: 4501 li a0,0
16a0: 00004097 auipc ra,0x4
16a4: e2c080e7 jalr -468(ra) # 54cc <exit>
00000000000016a8 <pipe1>:
<<<<<<< HEAD
=======
void pipe1(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
16a8: 711d addi sp,sp,-96
16aa: ec86 sd ra,88(sp)
16ac: e8a2 sd s0,80(sp)
16ae: e4a6 sd s1,72(sp)
16b0: e0ca sd s2,64(sp)
16b2: fc4e sd s3,56(sp)
16b4: f852 sd s4,48(sp)
16b6: f456 sd s5,40(sp)
16b8: f05a sd s6,32(sp)
16ba: ec5e sd s7,24(sp)
16bc: 1080 addi s0,sp,96
16be: 892a mv s2,a0
<<<<<<< HEAD
=======
if (pipe(fds) != 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
16c0: fa840513 addi a0,s0,-88
16c4: 00004097 auipc ra,0x4
16c8: e18080e7 jalr -488(ra) # 54dc <pipe>
16cc: ed25 bnez a0,1744 <pipe1+0x9c>
16ce: 84aa mv s1,a0
<<<<<<< HEAD
16d0: 00004097 auipc ra,0x4
16d4: df4080e7 jalr -524(ra) # 54c4 <fork>
16d8: 8a2a mv s4,a0
16da: c159 beqz a0,1760 <pipe1+0xb8>
16dc: 16a05e63 blez a0,1858 <pipe1+0x1b0>
16e0: fac42503 lw a0,-84(s0)
16e4: 00004097 auipc ra,0x4
16e8: e10080e7 jalr -496(ra) # 54f4 <close>
16ec: 8a26 mv s4,s1
16ee: 4985 li s3,1
16f0: 0000aa97 auipc s5,0xa
16f4: 320a8a93 addi s5,s5,800 # ba10 <buf>
16f8: 6b0d lui s6,0x3
=======
pid = fork();
16d0: 00004097 auipc ra,0x4
16d4: df4080e7 jalr -524(ra) # 54c4 <fork>
16d8: 8a2a mv s4,a0
if (pid == 0) {
16da: c159 beqz a0,1760 <pipe1+0xb8>
} else if (pid > 0) {
16dc: 16a05e63 blez a0,1858 <pipe1+0x1b0>
close(fds[1]);
16e0: fac42503 lw a0,-84(s0)
16e4: 00004097 auipc ra,0x4
16e8: e10080e7 jalr -496(ra) # 54f4 <close>
total = 0;
16ec: 8a26 mv s4,s1
cc = 1;
16ee: 4985 li s3,1
while ((n = read(fds[0], buf, cc)) > 0) {
16f0: 0000aa97 auipc s5,0xa
16f4: 2c8a8a93 addi s5,s5,712 # b9b8 <buf>
if (cc > sizeof(buf))
16f8: 6b0d lui s6,0x3
while ((n = read(fds[0], buf, cc)) > 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
16fa: 864e mv a2,s3
16fc: 85d6 mv a1,s5
16fe: fa842503 lw a0,-88(s0)
1702: 00004097 auipc ra,0x4
1706: de2080e7 jalr -542(ra) # 54e4 <read>
170a: 10a05263 blez a0,180e <pipe1+0x166>
<<<<<<< HEAD
170e: 0000a717 auipc a4,0xa
1712: 30270713 addi a4,a4,770 # ba10 <buf>
1716: 00a4863b addw a2,s1,a0
171a: 00074683 lbu a3,0(a4)
171e: 0ff4f793 zext.b a5,s1
1722: 2485 addiw s1,s1,1
1724: 0cf69163 bne a3,a5,17e6 <pipe1+0x13e>
1728: 0705 addi a4,a4,1
172a: fec498e3 bne s1,a2,171a <pipe1+0x72>
172e: 00aa0a3b addw s4,s4,a0
1732: 0019979b slliw a5,s3,0x1
1736: 0007899b sext.w s3,a5
173a: 013b7363 bgeu s6,s3,1740 <pipe1+0x98>
173e: 89da mv s3,s6
1740: 84b2 mv s1,a2
1742: bf65 j 16fa <pipe1+0x52>
1744: 85ca mv a1,s2
1746: 00005517 auipc a0,0x5
174a: ef250513 addi a0,a0,-270 # 6638 <l_free+0xbd0>
174e: 00004097 auipc ra,0x4
1752: 0f8080e7 jalr 248(ra) # 5846 <printf>
1756: 4505 li a0,1
1758: 00004097 auipc ra,0x4
175c: d74080e7 jalr -652(ra) # 54cc <exit>
1760: fa842503 lw a0,-88(s0)
1764: 00004097 auipc ra,0x4
1768: d90080e7 jalr -624(ra) # 54f4 <close>
176c: 0000ab17 auipc s6,0xa
1770: 2a4b0b13 addi s6,s6,676 # ba10 <buf>
1774: 416004bb negw s1,s6
1778: 0ff4f493 zext.b s1,s1
177c: 409b0993 addi s3,s6,1033
1780: 8bda mv s7,s6
1782: 6a85 lui s5,0x1
1784: 42da8a93 addi s5,s5,1069 # 142d <truncate3+0x11b>
1788: 87da mv a5,s6
178a: 0097873b addw a4,a5,s1
178e: 00e78023 sb a4,0(a5)
1792: 0785 addi a5,a5,1
1794: fef99be3 bne s3,a5,178a <pipe1+0xe2>
1798: 409a0a1b addiw s4,s4,1033
=======
for (i = 0; i < n; i++) {
170e: 0000a717 auipc a4,0xa
1712: 2aa70713 addi a4,a4,682 # b9b8 <buf>
1716: 00a4863b addw a2,s1,a0
if ((buf[i] & 0xff) != (seq++ & 0xff)) {
171a: 00074683 lbu a3,0(a4)
171e: 0ff4f793 andi a5,s1,255
1722: 2485 addiw s1,s1,1
1724: 0cf69163 bne a3,a5,17e6 <pipe1+0x13e>
for (i = 0; i < n; i++) {
1728: 0705 addi a4,a4,1
172a: fec498e3 bne s1,a2,171a <pipe1+0x72>
total += n;
172e: 00aa0a3b addw s4,s4,a0
cc = cc * 2;
1732: 0019979b slliw a5,s3,0x1
1736: 0007899b sext.w s3,a5
if (cc > sizeof(buf))
173a: 013b7363 bgeu s6,s3,1740 <pipe1+0x98>
cc = sizeof(buf);
173e: 89da mv s3,s6
if ((buf[i] & 0xff) != (seq++ & 0xff)) {
1740: 84b2 mv s1,a2
1742: bf65 j 16fa <pipe1+0x52>
printf("%s: pipe() failed\n", s);
1744: 85ca mv a1,s2
1746: 00005517 auipc a0,0x5
174a: ef250513 addi a0,a0,-270 # 6638 <l_free+0xbd2>
174e: 00004097 auipc ra,0x4
1752: 0f6080e7 jalr 246(ra) # 5844 <printf>
exit(1);
1756: 4505 li a0,1
1758: 00004097 auipc ra,0x4
175c: d74080e7 jalr -652(ra) # 54cc <exit>
close(fds[0]);
1760: fa842503 lw a0,-88(s0)
1764: 00004097 auipc ra,0x4
1768: d90080e7 jalr -624(ra) # 54f4 <close>
for (n = 0; n < N; n++) {
176c: 0000ab17 auipc s6,0xa
1770: 24cb0b13 addi s6,s6,588 # b9b8 <buf>
1774: 416004bb negw s1,s6
1778: 0ff4f493 andi s1,s1,255
177c: 409b0993 addi s3,s6,1033
if (write(fds[1], buf, SZ) != SZ) {
1780: 8bda mv s7,s6
for (n = 0; n < N; n++) {
1782: 6a85 lui s5,0x1
1784: 42da8a93 addi s5,s5,1069 # 142d <truncate3+0x11b>
void pipe1(char *s) {
1788: 87da mv a5,s6
buf[i] = seq++;
178a: 0097873b addw a4,a5,s1
178e: 00e78023 sb a4,0(a5)
for (i = 0; i < SZ; i++)
1792: 0785 addi a5,a5,1
1794: fef99be3 bne s3,a5,178a <pipe1+0xe2>
buf[i] = seq++;
1798: 409a0a1b addiw s4,s4,1033
if (write(fds[1], buf, SZ) != SZ) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
179c: 40900613 li a2,1033
17a0: 85de mv a1,s7
17a2: fac42503 lw a0,-84(s0)
17a6: 00004097 auipc ra,0x4
17aa: d46080e7 jalr -698(ra) # 54ec <write>
17ae: 40900793 li a5,1033
17b2: 00f51c63 bne a0,a5,17ca <pipe1+0x122>
<<<<<<< HEAD
17b6: 24a5 addiw s1,s1,9
17b8: 0ff4f493 zext.b s1,s1
17bc: fd5a16e3 bne s4,s5,1788 <pipe1+0xe0>
17c0: 4501 li a0,0
17c2: 00004097 auipc ra,0x4
17c6: d0a080e7 jalr -758(ra) # 54cc <exit>
17ca: 85ca mv a1,s2
17cc: 00005517 auipc a0,0x5
17d0: e8450513 addi a0,a0,-380 # 6650 <l_free+0xbe8>
17d4: 00004097 auipc ra,0x4
17d8: 072080e7 jalr 114(ra) # 5846 <printf>
17dc: 4505 li a0,1
17de: 00004097 auipc ra,0x4
17e2: cee080e7 jalr -786(ra) # 54cc <exit>
17e6: 85ca mv a1,s2
17e8: 00005517 auipc a0,0x5
17ec: e8050513 addi a0,a0,-384 # 6668 <l_free+0xc00>
17f0: 00004097 auipc ra,0x4
17f4: 056080e7 jalr 86(ra) # 5846 <printf>
=======
for (n = 0; n < N; n++) {
17b6: 24a5 addiw s1,s1,9
17b8: 0ff4f493 andi s1,s1,255
17bc: fd5a16e3 bne s4,s5,1788 <pipe1+0xe0>
exit(0);
17c0: 4501 li a0,0
17c2: 00004097 auipc ra,0x4
17c6: d0a080e7 jalr -758(ra) # 54cc <exit>
printf("%s: pipe1 oops 1\n", s);
17ca: 85ca mv a1,s2
17cc: 00005517 auipc a0,0x5
17d0: e8450513 addi a0,a0,-380 # 6650 <l_free+0xbea>
17d4: 00004097 auipc ra,0x4
17d8: 070080e7 jalr 112(ra) # 5844 <printf>
exit(1);
17dc: 4505 li a0,1
17de: 00004097 auipc ra,0x4
17e2: cee080e7 jalr -786(ra) # 54cc <exit>
printf("%s: pipe1 oops 2\n", s);
17e6: 85ca mv a1,s2
17e8: 00005517 auipc a0,0x5
17ec: e8050513 addi a0,a0,-384 # 6668 <l_free+0xc02>
17f0: 00004097 auipc ra,0x4
17f4: 054080e7 jalr 84(ra) # 5844 <printf>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
17f8: 60e6 ld ra,88(sp)
17fa: 6446 ld s0,80(sp)
17fc: 64a6 ld s1,72(sp)
17fe: 6906 ld s2,64(sp)
1800: 79e2 ld s3,56(sp)
1802: 7a42 ld s4,48(sp)
1804: 7aa2 ld s5,40(sp)
1806: 7b02 ld s6,32(sp)
1808: 6be2 ld s7,24(sp)
180a: 6125 addi sp,sp,96
180c: 8082 ret
<<<<<<< HEAD
180e: 6785 lui a5,0x1
1810: 42d78793 addi a5,a5,1069 # 142d <truncate3+0x11b>
1814: 02fa0063 beq s4,a5,1834 <pipe1+0x18c>
1818: 85d2 mv a1,s4
181a: 00005517 auipc a0,0x5
181e: e6650513 addi a0,a0,-410 # 6680 <l_free+0xc18>
1822: 00004097 auipc ra,0x4
1826: 024080e7 jalr 36(ra) # 5846 <printf>
182a: 4505 li a0,1
182c: 00004097 auipc ra,0x4
1830: ca0080e7 jalr -864(ra) # 54cc <exit>
1834: fa842503 lw a0,-88(s0)
1838: 00004097 auipc ra,0x4
183c: cbc080e7 jalr -836(ra) # 54f4 <close>
1840: fa440513 addi a0,s0,-92
1844: 00004097 auipc ra,0x4
1848: c90080e7 jalr -880(ra) # 54d4 <wait>
184c: fa442503 lw a0,-92(s0)
1850: 00004097 auipc ra,0x4
1854: c7c080e7 jalr -900(ra) # 54cc <exit>
1858: 85ca mv a1,s2
185a: 00005517 auipc a0,0x5
185e: e4650513 addi a0,a0,-442 # 66a0 <l_free+0xc38>
1862: 00004097 auipc ra,0x4
1866: fe4080e7 jalr -28(ra) # 5846 <printf>
=======
if (total != N * SZ) {
180e: 6785 lui a5,0x1
1810: 42d78793 addi a5,a5,1069 # 142d <truncate3+0x11b>
1814: 02fa0063 beq s4,a5,1834 <pipe1+0x18c>
printf("%s: pipe1 oops 3 total %d\n", total);
1818: 85d2 mv a1,s4
181a: 00005517 auipc a0,0x5
181e: e6650513 addi a0,a0,-410 # 6680 <l_free+0xc1a>
1822: 00004097 auipc ra,0x4
1826: 022080e7 jalr 34(ra) # 5844 <printf>
exit(1);
182a: 4505 li a0,1
182c: 00004097 auipc ra,0x4
1830: ca0080e7 jalr -864(ra) # 54cc <exit>
close(fds[0]);
1834: fa842503 lw a0,-88(s0)
1838: 00004097 auipc ra,0x4
183c: cbc080e7 jalr -836(ra) # 54f4 <close>
wait(&xstatus);
1840: fa440513 addi a0,s0,-92
1844: 00004097 auipc ra,0x4
1848: c90080e7 jalr -880(ra) # 54d4 <wait>
exit(xstatus);
184c: fa442503 lw a0,-92(s0)
1850: 00004097 auipc ra,0x4
1854: c7c080e7 jalr -900(ra) # 54cc <exit>
printf("%s: fork() failed\n", s);
1858: 85ca mv a1,s2
185a: 00005517 auipc a0,0x5
185e: e4650513 addi a0,a0,-442 # 66a0 <l_free+0xc3a>
1862: 00004097 auipc ra,0x4
1866: fe2080e7 jalr -30(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
186a: 4505 li a0,1
186c: 00004097 auipc ra,0x4
1870: c60080e7 jalr -928(ra) # 54cc <exit>
0000000000001874 <exitwait>:
<<<<<<< HEAD
=======
void exitwait(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1874: 7139 addi sp,sp,-64
1876: fc06 sd ra,56(sp)
1878: f822 sd s0,48(sp)
187a: f426 sd s1,40(sp)
187c: f04a sd s2,32(sp)
187e: ec4e sd s3,24(sp)
1880: e852 sd s4,16(sp)
1882: 0080 addi s0,sp,64
1884: 8a2a mv s4,a0
<<<<<<< HEAD
1886: 4901 li s2,0
1888: 06400993 li s3,100
188c: 00004097 auipc ra,0x4
1890: c38080e7 jalr -968(ra) # 54c4 <fork>
1894: 84aa mv s1,a0
1896: 02054a63 bltz a0,18ca <exitwait+0x56>
189a: c151 beqz a0,191e <exitwait+0xaa>
=======
for (i = 0; i < 100; i++) {
1886: 4901 li s2,0
1888: 06400993 li s3,100
pid = fork();
188c: 00004097 auipc ra,0x4
1890: c38080e7 jalr -968(ra) # 54c4 <fork>
1894: 84aa mv s1,a0
if (pid < 0) {
1896: 02054a63 bltz a0,18ca <exitwait+0x56>
if (pid) {
189a: c151 beqz a0,191e <exitwait+0xaa>
if (wait(&xstate) != pid) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
189c: fcc40513 addi a0,s0,-52
18a0: 00004097 auipc ra,0x4
18a4: c34080e7 jalr -972(ra) # 54d4 <wait>
18a8: 02951f63 bne a0,s1,18e6 <exitwait+0x72>
<<<<<<< HEAD
18ac: fcc42783 lw a5,-52(s0)
18b0: 05279963 bne a5,s2,1902 <exitwait+0x8e>
18b4: 2905 addiw s2,s2,1
18b6: fd391be3 bne s2,s3,188c <exitwait+0x18>
=======
if (i != xstate) {
18ac: fcc42783 lw a5,-52(s0)
18b0: 05279963 bne a5,s2,1902 <exitwait+0x8e>
for (i = 0; i < 100; i++) {
18b4: 2905 addiw s2,s2,1
18b6: fd391be3 bne s2,s3,188c <exitwait+0x18>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
18ba: 70e2 ld ra,56(sp)
18bc: 7442 ld s0,48(sp)
18be: 74a2 ld s1,40(sp)
18c0: 7902 ld s2,32(sp)
18c2: 69e2 ld s3,24(sp)
18c4: 6a42 ld s4,16(sp)
18c6: 6121 addi sp,sp,64
18c8: 8082 ret
<<<<<<< HEAD
18ca: 85d2 mv a1,s4
18cc: 00005517 auipc a0,0x5
18d0: c6450513 addi a0,a0,-924 # 6530 <l_free+0xac8>
18d4: 00004097 auipc ra,0x4
18d8: f72080e7 jalr -142(ra) # 5846 <printf>
18dc: 4505 li a0,1
18de: 00004097 auipc ra,0x4
18e2: bee080e7 jalr -1042(ra) # 54cc <exit>
18e6: 85d2 mv a1,s4
18e8: 00005517 auipc a0,0x5
18ec: dd050513 addi a0,a0,-560 # 66b8 <l_free+0xc50>
18f0: 00004097 auipc ra,0x4
18f4: f56080e7 jalr -170(ra) # 5846 <printf>
18f8: 4505 li a0,1
18fa: 00004097 auipc ra,0x4
18fe: bd2080e7 jalr -1070(ra) # 54cc <exit>
1902: 85d2 mv a1,s4
1904: 00005517 auipc a0,0x5
1908: dcc50513 addi a0,a0,-564 # 66d0 <l_free+0xc68>
190c: 00004097 auipc ra,0x4
1910: f3a080e7 jalr -198(ra) # 5846 <printf>
1914: 4505 li a0,1
1916: 00004097 auipc ra,0x4
191a: bb6080e7 jalr -1098(ra) # 54cc <exit>
=======
printf("%s: fork failed\n", s);
18ca: 85d2 mv a1,s4
18cc: 00005517 auipc a0,0x5
18d0: c6450513 addi a0,a0,-924 # 6530 <l_free+0xaca>
18d4: 00004097 auipc ra,0x4
18d8: f70080e7 jalr -144(ra) # 5844 <printf>
exit(1);
18dc: 4505 li a0,1
18de: 00004097 auipc ra,0x4
18e2: bee080e7 jalr -1042(ra) # 54cc <exit>
printf("%s: wait wrong pid\n", s);
18e6: 85d2 mv a1,s4
18e8: 00005517 auipc a0,0x5
18ec: dd050513 addi a0,a0,-560 # 66b8 <l_free+0xc52>
18f0: 00004097 auipc ra,0x4
18f4: f54080e7 jalr -172(ra) # 5844 <printf>
exit(1);
18f8: 4505 li a0,1
18fa: 00004097 auipc ra,0x4
18fe: bd2080e7 jalr -1070(ra) # 54cc <exit>
printf("%s: wait wrong exit status\n", s);
1902: 85d2 mv a1,s4
1904: 00005517 auipc a0,0x5
1908: dcc50513 addi a0,a0,-564 # 66d0 <l_free+0xc6a>
190c: 00004097 auipc ra,0x4
1910: f38080e7 jalr -200(ra) # 5844 <printf>
exit(1);
1914: 4505 li a0,1
1916: 00004097 auipc ra,0x4
191a: bb6080e7 jalr -1098(ra) # 54cc <exit>
exit(i);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
191e: 854a mv a0,s2
1920: 00004097 auipc ra,0x4
1924: bac080e7 jalr -1108(ra) # 54cc <exit>
0000000000001928 <twochildren>:
<<<<<<< HEAD
=======
void twochildren(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1928: 1101 addi sp,sp,-32
192a: ec06 sd ra,24(sp)
192c: e822 sd s0,16(sp)
192e: e426 sd s1,8(sp)
1930: e04a sd s2,0(sp)
1932: 1000 addi s0,sp,32
1934: 892a mv s2,a0
1936: 3e800493 li s1,1000
<<<<<<< HEAD
193a: 00004097 auipc ra,0x4
193e: b8a080e7 jalr -1142(ra) # 54c4 <fork>
1942: 02054c63 bltz a0,197a <twochildren+0x52>
1946: c921 beqz a0,1996 <twochildren+0x6e>
1948: 00004097 auipc ra,0x4
194c: b7c080e7 jalr -1156(ra) # 54c4 <fork>
1950: 04054763 bltz a0,199e <twochildren+0x76>
1954: c13d beqz a0,19ba <twochildren+0x92>
1956: 4501 li a0,0
1958: 00004097 auipc ra,0x4
195c: b7c080e7 jalr -1156(ra) # 54d4 <wait>
1960: 4501 li a0,0
1962: 00004097 auipc ra,0x4
1966: b72080e7 jalr -1166(ra) # 54d4 <wait>
196a: 34fd addiw s1,s1,-1
196c: f4f9 bnez s1,193a <twochildren+0x12>
=======
int pid1 = fork();
193a: 00004097 auipc ra,0x4
193e: b8a080e7 jalr -1142(ra) # 54c4 <fork>
if (pid1 < 0) {
1942: 02054c63 bltz a0,197a <twochildren+0x52>
if (pid1 == 0) {
1946: c921 beqz a0,1996 <twochildren+0x6e>
int pid2 = fork();
1948: 00004097 auipc ra,0x4
194c: b7c080e7 jalr -1156(ra) # 54c4 <fork>
if (pid2 < 0) {
1950: 04054763 bltz a0,199e <twochildren+0x76>
if (pid2 == 0) {
1954: c13d beqz a0,19ba <twochildren+0x92>
wait(0);
1956: 4501 li a0,0
1958: 00004097 auipc ra,0x4
195c: b7c080e7 jalr -1156(ra) # 54d4 <wait>
wait(0);
1960: 4501 li a0,0
1962: 00004097 auipc ra,0x4
1966: b72080e7 jalr -1166(ra) # 54d4 <wait>
for (int i = 0; i < 1000; i++) {
196a: 34fd addiw s1,s1,-1
196c: f4f9 bnez s1,193a <twochildren+0x12>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
196e: 60e2 ld ra,24(sp)
1970: 6442 ld s0,16(sp)
1972: 64a2 ld s1,8(sp)
1974: 6902 ld s2,0(sp)
1976: 6105 addi sp,sp,32
1978: 8082 ret
<<<<<<< HEAD
197a: 85ca mv a1,s2
197c: 00005517 auipc a0,0x5
1980: bb450513 addi a0,a0,-1100 # 6530 <l_free+0xac8>
1984: 00004097 auipc ra,0x4
1988: ec2080e7 jalr -318(ra) # 5846 <printf>
198c: 4505 li a0,1
198e: 00004097 auipc ra,0x4
1992: b3e080e7 jalr -1218(ra) # 54cc <exit>
1996: 00004097 auipc ra,0x4
199a: b36080e7 jalr -1226(ra) # 54cc <exit>
199e: 85ca mv a1,s2
19a0: 00005517 auipc a0,0x5
19a4: b9050513 addi a0,a0,-1136 # 6530 <l_free+0xac8>
19a8: 00004097 auipc ra,0x4
19ac: e9e080e7 jalr -354(ra) # 5846 <printf>
19b0: 4505 li a0,1
19b2: 00004097 auipc ra,0x4
19b6: b1a080e7 jalr -1254(ra) # 54cc <exit>
=======
printf("%s: fork failed\n", s);
197a: 85ca mv a1,s2
197c: 00005517 auipc a0,0x5
1980: bb450513 addi a0,a0,-1100 # 6530 <l_free+0xaca>
1984: 00004097 auipc ra,0x4
1988: ec0080e7 jalr -320(ra) # 5844 <printf>
exit(1);
198c: 4505 li a0,1
198e: 00004097 auipc ra,0x4
1992: b3e080e7 jalr -1218(ra) # 54cc <exit>
exit(0);
1996: 00004097 auipc ra,0x4
199a: b36080e7 jalr -1226(ra) # 54cc <exit>
printf("%s: fork failed\n", s);
199e: 85ca mv a1,s2
19a0: 00005517 auipc a0,0x5
19a4: b9050513 addi a0,a0,-1136 # 6530 <l_free+0xaca>
19a8: 00004097 auipc ra,0x4
19ac: e9c080e7 jalr -356(ra) # 5844 <printf>
exit(1);
19b0: 4505 li a0,1
19b2: 00004097 auipc ra,0x4
19b6: b1a080e7 jalr -1254(ra) # 54cc <exit>
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
19ba: 00004097 auipc ra,0x4
19be: b12080e7 jalr -1262(ra) # 54cc <exit>
00000000000019c2 <forkfork>:
<<<<<<< HEAD
=======
void forkfork(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
19c2: 7179 addi sp,sp,-48
19c4: f406 sd ra,40(sp)
19c6: f022 sd s0,32(sp)
19c8: ec26 sd s1,24(sp)
19ca: 1800 addi s0,sp,48
19cc: 84aa mv s1,a0
<<<<<<< HEAD
19ce: 00004097 auipc ra,0x4
19d2: af6080e7 jalr -1290(ra) # 54c4 <fork>
19d6: 04054163 bltz a0,1a18 <forkfork+0x56>
19da: cd29 beqz a0,1a34 <forkfork+0x72>
19dc: 00004097 auipc ra,0x4
19e0: ae8080e7 jalr -1304(ra) # 54c4 <fork>
19e4: 02054a63 bltz a0,1a18 <forkfork+0x56>
19e8: c531 beqz a0,1a34 <forkfork+0x72>
19ea: fdc40513 addi a0,s0,-36
19ee: 00004097 auipc ra,0x4
19f2: ae6080e7 jalr -1306(ra) # 54d4 <wait>
19f6: fdc42783 lw a5,-36(s0)
19fa: ebbd bnez a5,1a70 <forkfork+0xae>
19fc: fdc40513 addi a0,s0,-36
1a00: 00004097 auipc ra,0x4
1a04: ad4080e7 jalr -1324(ra) # 54d4 <wait>
1a08: fdc42783 lw a5,-36(s0)
1a0c: e3b5 bnez a5,1a70 <forkfork+0xae>
=======
int pid = fork();
19ce: 00004097 auipc ra,0x4
19d2: af6080e7 jalr -1290(ra) # 54c4 <fork>
if (pid < 0) {
19d6: 04054163 bltz a0,1a18 <forkfork+0x56>
if (pid == 0) {
19da: cd29 beqz a0,1a34 <forkfork+0x72>
int pid = fork();
19dc: 00004097 auipc ra,0x4
19e0: ae8080e7 jalr -1304(ra) # 54c4 <fork>
if (pid < 0) {
19e4: 02054a63 bltz a0,1a18 <forkfork+0x56>
if (pid == 0) {
19e8: c531 beqz a0,1a34 <forkfork+0x72>
wait(&xstatus);
19ea: fdc40513 addi a0,s0,-36
19ee: 00004097 auipc ra,0x4
19f2: ae6080e7 jalr -1306(ra) # 54d4 <wait>
if (xstatus != 0) {
19f6: fdc42783 lw a5,-36(s0)
19fa: ebbd bnez a5,1a70 <forkfork+0xae>
wait(&xstatus);
19fc: fdc40513 addi a0,s0,-36
1a00: 00004097 auipc ra,0x4
1a04: ad4080e7 jalr -1324(ra) # 54d4 <wait>
if (xstatus != 0) {
1a08: fdc42783 lw a5,-36(s0)
1a0c: e3b5 bnez a5,1a70 <forkfork+0xae>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1a0e: 70a2 ld ra,40(sp)
1a10: 7402 ld s0,32(sp)
1a12: 64e2 ld s1,24(sp)
1a14: 6145 addi sp,sp,48
1a16: 8082 ret
<<<<<<< HEAD
1a18: 85a6 mv a1,s1
1a1a: 00005517 auipc a0,0x5
1a1e: cd650513 addi a0,a0,-810 # 66f0 <l_free+0xc88>
1a22: 00004097 auipc ra,0x4
1a26: e24080e7 jalr -476(ra) # 5846 <printf>
1a2a: 4505 li a0,1
1a2c: 00004097 auipc ra,0x4
1a30: aa0080e7 jalr -1376(ra) # 54cc <exit>
1a34: 0c800493 li s1,200
1a38: 00004097 auipc ra,0x4
1a3c: a8c080e7 jalr -1396(ra) # 54c4 <fork>
1a40: 00054f63 bltz a0,1a5e <forkfork+0x9c>
1a44: c115 beqz a0,1a68 <forkfork+0xa6>
1a46: 4501 li a0,0
1a48: 00004097 auipc ra,0x4
1a4c: a8c080e7 jalr -1396(ra) # 54d4 <wait>
1a50: 34fd addiw s1,s1,-1
1a52: f0fd bnez s1,1a38 <forkfork+0x76>
1a54: 4501 li a0,0
1a56: 00004097 auipc ra,0x4
1a5a: a76080e7 jalr -1418(ra) # 54cc <exit>
1a5e: 4505 li a0,1
1a60: 00004097 auipc ra,0x4
1a64: a6c080e7 jalr -1428(ra) # 54cc <exit>
1a68: 00004097 auipc ra,0x4
1a6c: a64080e7 jalr -1436(ra) # 54cc <exit>
1a70: 85a6 mv a1,s1
1a72: 00005517 auipc a0,0x5
1a76: c8e50513 addi a0,a0,-882 # 6700 <l_free+0xc98>
1a7a: 00004097 auipc ra,0x4
1a7e: dcc080e7 jalr -564(ra) # 5846 <printf>
=======
printf("%s: fork failed", s);
1a18: 85a6 mv a1,s1
1a1a: 00005517 auipc a0,0x5
1a1e: cd650513 addi a0,a0,-810 # 66f0 <l_free+0xc8a>
1a22: 00004097 auipc ra,0x4
1a26: e22080e7 jalr -478(ra) # 5844 <printf>
exit(1);
1a2a: 4505 li a0,1
1a2c: 00004097 auipc ra,0x4
1a30: aa0080e7 jalr -1376(ra) # 54cc <exit>
void forkfork(char *s) {
1a34: 0c800493 li s1,200
int pid1 = fork();
1a38: 00004097 auipc ra,0x4
1a3c: a8c080e7 jalr -1396(ra) # 54c4 <fork>
if (pid1 < 0) {
1a40: 00054f63 bltz a0,1a5e <forkfork+0x9c>
if (pid1 == 0) {
1a44: c115 beqz a0,1a68 <forkfork+0xa6>
wait(0);
1a46: 4501 li a0,0
1a48: 00004097 auipc ra,0x4
1a4c: a8c080e7 jalr -1396(ra) # 54d4 <wait>
for (int j = 0; j < 200; j++) {
1a50: 34fd addiw s1,s1,-1
1a52: f0fd bnez s1,1a38 <forkfork+0x76>
exit(0);
1a54: 4501 li a0,0
1a56: 00004097 auipc ra,0x4
1a5a: a76080e7 jalr -1418(ra) # 54cc <exit>
exit(1);
1a5e: 4505 li a0,1
1a60: 00004097 auipc ra,0x4
1a64: a6c080e7 jalr -1428(ra) # 54cc <exit>
exit(0);
1a68: 00004097 auipc ra,0x4
1a6c: a64080e7 jalr -1436(ra) # 54cc <exit>
printf("%s: fork in child failed", s);
1a70: 85a6 mv a1,s1
1a72: 00005517 auipc a0,0x5
1a76: c8e50513 addi a0,a0,-882 # 6700 <l_free+0xc9a>
1a7a: 00004097 auipc ra,0x4
1a7e: dca080e7 jalr -566(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1a82: 4505 li a0,1
1a84: 00004097 auipc ra,0x4
1a88: a48080e7 jalr -1464(ra) # 54cc <exit>
0000000000001a8c <reparent2>:
<<<<<<< HEAD
=======
void reparent2(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1a8c: 1101 addi sp,sp,-32
1a8e: ec06 sd ra,24(sp)
1a90: e822 sd s0,16(sp)
1a92: e426 sd s1,8(sp)
1a94: 1000 addi s0,sp,32
1a96: 32000493 li s1,800
<<<<<<< HEAD
1a9a: 00004097 auipc ra,0x4
1a9e: a2a080e7 jalr -1494(ra) # 54c4 <fork>
1aa2: 00054f63 bltz a0,1ac0 <reparent2+0x34>
1aa6: c915 beqz a0,1ada <reparent2+0x4e>
1aa8: 4501 li a0,0
1aaa: 00004097 auipc ra,0x4
1aae: a2a080e7 jalr -1494(ra) # 54d4 <wait>
1ab2: 34fd addiw s1,s1,-1
1ab4: f0fd bnez s1,1a9a <reparent2+0xe>
1ab6: 4501 li a0,0
1ab8: 00004097 auipc ra,0x4
1abc: a14080e7 jalr -1516(ra) # 54cc <exit>
1ac0: 00005517 auipc a0,0x5
1ac4: e6050513 addi a0,a0,-416 # 6920 <l_free+0xeb8>
1ac8: 00004097 auipc ra,0x4
1acc: d7e080e7 jalr -642(ra) # 5846 <printf>
1ad0: 4505 li a0,1
1ad2: 00004097 auipc ra,0x4
1ad6: 9fa080e7 jalr -1542(ra) # 54cc <exit>
1ada: 00004097 auipc ra,0x4
1ade: 9ea080e7 jalr -1558(ra) # 54c4 <fork>
1ae2: 00004097 auipc ra,0x4
1ae6: 9e2080e7 jalr -1566(ra) # 54c4 <fork>
=======
int pid1 = fork();
1a9a: 00004097 auipc ra,0x4
1a9e: a2a080e7 jalr -1494(ra) # 54c4 <fork>
if (pid1 < 0) {
1aa2: 00054f63 bltz a0,1ac0 <reparent2+0x34>
if (pid1 == 0) {
1aa6: c915 beqz a0,1ada <reparent2+0x4e>
wait(0);
1aa8: 4501 li a0,0
1aaa: 00004097 auipc ra,0x4
1aae: a2a080e7 jalr -1494(ra) # 54d4 <wait>
for (int i = 0; i < 800; i++) {
1ab2: 34fd addiw s1,s1,-1
1ab4: f0fd bnez s1,1a9a <reparent2+0xe>
exit(0);
1ab6: 4501 li a0,0
1ab8: 00004097 auipc ra,0x4
1abc: a14080e7 jalr -1516(ra) # 54cc <exit>
printf("fork failed\n");
1ac0: 00005517 auipc a0,0x5
1ac4: e6050513 addi a0,a0,-416 # 6920 <l_free+0xeba>
1ac8: 00004097 auipc ra,0x4
1acc: d7c080e7 jalr -644(ra) # 5844 <printf>
exit(1);
1ad0: 4505 li a0,1
1ad2: 00004097 auipc ra,0x4
1ad6: 9fa080e7 jalr -1542(ra) # 54cc <exit>
fork();
1ada: 00004097 auipc ra,0x4
1ade: 9ea080e7 jalr -1558(ra) # 54c4 <fork>
fork();
1ae2: 00004097 auipc ra,0x4
1ae6: 9e2080e7 jalr -1566(ra) # 54c4 <fork>
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1aea: 4501 li a0,0
1aec: 00004097 auipc ra,0x4
1af0: 9e0080e7 jalr -1568(ra) # 54cc <exit>
0000000000001af4 <createdelete>:
<<<<<<< HEAD
=======
void createdelete(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1af4: 7175 addi sp,sp,-144
1af6: e506 sd ra,136(sp)
1af8: e122 sd s0,128(sp)
1afa: fca6 sd s1,120(sp)
1afc: f8ca sd s2,112(sp)
1afe: f4ce sd s3,104(sp)
1b00: f0d2 sd s4,96(sp)
1b02: ecd6 sd s5,88(sp)
1b04: e8da sd s6,80(sp)
1b06: e4de sd s7,72(sp)
1b08: e0e2 sd s8,64(sp)
1b0a: fc66 sd s9,56(sp)
1b0c: 0900 addi s0,sp,144
1b0e: 8caa mv s9,a0
<<<<<<< HEAD
1b10: 4901 li s2,0
1b12: 4991 li s3,4
1b14: 00004097 auipc ra,0x4
1b18: 9b0080e7 jalr -1616(ra) # 54c4 <fork>
1b1c: 84aa mv s1,a0
1b1e: 02054f63 bltz a0,1b5c <createdelete+0x68>
1b22: c939 beqz a0,1b78 <createdelete+0x84>
1b24: 2905 addiw s2,s2,1
1b26: ff3917e3 bne s2,s3,1b14 <createdelete+0x20>
1b2a: 4491 li s1,4
1b2c: f7c40513 addi a0,s0,-132
1b30: 00004097 auipc ra,0x4
1b34: 9a4080e7 jalr -1628(ra) # 54d4 <wait>
1b38: f7c42903 lw s2,-132(s0)
1b3c: 0e091263 bnez s2,1c20 <createdelete+0x12c>
1b40: 34fd addiw s1,s1,-1
1b42: f4ed bnez s1,1b2c <createdelete+0x38>
=======
for (pi = 0; pi < NCHILD; pi++) {
1b10: 4901 li s2,0
1b12: 4991 li s3,4
pid = fork();
1b14: 00004097 auipc ra,0x4
1b18: 9b0080e7 jalr -1616(ra) # 54c4 <fork>
1b1c: 84aa mv s1,a0
if (pid < 0) {
1b1e: 02054f63 bltz a0,1b5c <createdelete+0x68>
if (pid == 0) {
1b22: c939 beqz a0,1b78 <createdelete+0x84>
for (pi = 0; pi < NCHILD; pi++) {
1b24: 2905 addiw s2,s2,1
1b26: ff3917e3 bne s2,s3,1b14 <createdelete+0x20>
1b2a: 4491 li s1,4
wait(&xstatus);
1b2c: f7c40513 addi a0,s0,-132
1b30: 00004097 auipc ra,0x4
1b34: 9a4080e7 jalr -1628(ra) # 54d4 <wait>
if (xstatus != 0)
1b38: f7c42903 lw s2,-132(s0)
1b3c: 0e091263 bnez s2,1c20 <createdelete+0x12c>
for (pi = 0; pi < NCHILD; pi++) {
1b40: 34fd addiw s1,s1,-1
1b42: f4ed bnez s1,1b2c <createdelete+0x38>
name[0] = name[1] = name[2] = 0;
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1b44: f8040123 sb zero,-126(s0)
1b48: 03000993 li s3,48
1b4c: 5a7d li s4,-1
1b4e: 07000c13 li s8,112
<<<<<<< HEAD
1b52: 4b21 li s6,8
1b54: 4ba5 li s7,9
1b56: 07400a93 li s5,116
1b5a: a29d j 1cc0 <createdelete+0x1cc>
1b5c: 85e6 mv a1,s9
1b5e: 00005517 auipc a0,0x5
1b62: dc250513 addi a0,a0,-574 # 6920 <l_free+0xeb8>
1b66: 00004097 auipc ra,0x4
1b6a: ce0080e7 jalr -800(ra) # 5846 <printf>
1b6e: 4505 li a0,1
1b70: 00004097 auipc ra,0x4
1b74: 95c080e7 jalr -1700(ra) # 54cc <exit>
1b78: 0709091b addiw s2,s2,112
1b7c: f9240023 sb s2,-128(s0)
1b80: f8040123 sb zero,-126(s0)
1b84: 4951 li s2,20
1b86: a015 j 1baa <createdelete+0xb6>
1b88: 85e6 mv a1,s9
1b8a: 00005517 auipc a0,0x5
1b8e: a3e50513 addi a0,a0,-1474 # 65c8 <l_free+0xb60>
1b92: 00004097 auipc ra,0x4
1b96: cb4080e7 jalr -844(ra) # 5846 <printf>
1b9a: 4505 li a0,1
1b9c: 00004097 auipc ra,0x4
1ba0: 930080e7 jalr -1744(ra) # 54cc <exit>
1ba4: 2485 addiw s1,s1,1
1ba6: 07248863 beq s1,s2,1c16 <createdelete+0x122>
1baa: 0304879b addiw a5,s1,48
1bae: f8f400a3 sb a5,-127(s0)
=======
} else if ((i >= 1 && i < N / 2) && fd >= 0) {
1b52: 4b21 li s6,8
if ((i == 0 || i >= N / 2) && fd < 0) {
1b54: 4ba5 li s7,9
for (pi = 0; pi < NCHILD; pi++) {
1b56: 07400a93 li s5,116
1b5a: a29d j 1cc0 <createdelete+0x1cc>
printf("fork failed\n", s);
1b5c: 85e6 mv a1,s9
1b5e: 00005517 auipc a0,0x5
1b62: dc250513 addi a0,a0,-574 # 6920 <l_free+0xeba>
1b66: 00004097 auipc ra,0x4
1b6a: cde080e7 jalr -802(ra) # 5844 <printf>
exit(1);
1b6e: 4505 li a0,1
1b70: 00004097 auipc ra,0x4
1b74: 95c080e7 jalr -1700(ra) # 54cc <exit>
name[0] = 'p' + pi;
1b78: 0709091b addiw s2,s2,112
1b7c: f9240023 sb s2,-128(s0)
name[2] = '\0';
1b80: f8040123 sb zero,-126(s0)
for (i = 0; i < N; i++) {
1b84: 4951 li s2,20
1b86: a015 j 1baa <createdelete+0xb6>
printf("%s: create failed\n", s);
1b88: 85e6 mv a1,s9
1b8a: 00005517 auipc a0,0x5
1b8e: a3e50513 addi a0,a0,-1474 # 65c8 <l_free+0xb62>
1b92: 00004097 auipc ra,0x4
1b96: cb2080e7 jalr -846(ra) # 5844 <printf>
exit(1);
1b9a: 4505 li a0,1
1b9c: 00004097 auipc ra,0x4
1ba0: 930080e7 jalr -1744(ra) # 54cc <exit>
for (i = 0; i < N; i++) {
1ba4: 2485 addiw s1,s1,1
1ba6: 07248863 beq s1,s2,1c16 <createdelete+0x122>
name[1] = '0' + i;
1baa: 0304879b addiw a5,s1,48
1bae: f8f400a3 sb a5,-127(s0)
fd = open(name, O_CREATE | O_RDWR);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1bb2: 20200593 li a1,514
1bb6: f8040513 addi a0,s0,-128
1bba: 00004097 auipc ra,0x4
1bbe: 952080e7 jalr -1710(ra) # 550c <open>
<<<<<<< HEAD
1bc2: fc0543e3 bltz a0,1b88 <createdelete+0x94>
1bc6: 00004097 auipc ra,0x4
1bca: 92e080e7 jalr -1746(ra) # 54f4 <close>
1bce: fc905be3 blez s1,1ba4 <createdelete+0xb0>
1bd2: 0014f793 andi a5,s1,1
1bd6: f7f9 bnez a5,1ba4 <createdelete+0xb0>
=======
if (fd < 0) {
1bc2: fc0543e3 bltz a0,1b88 <createdelete+0x94>
close(fd);
1bc6: 00004097 auipc ra,0x4
1bca: 92e080e7 jalr -1746(ra) # 54f4 <close>
if (i > 0 && (i % 2) == 0) {
1bce: fc905be3 blez s1,1ba4 <createdelete+0xb0>
1bd2: 0014f793 andi a5,s1,1
1bd6: f7f9 bnez a5,1ba4 <createdelete+0xb0>
name[1] = '0' + (i / 2);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1bd8: 01f4d79b srliw a5,s1,0x1f
1bdc: 9fa5 addw a5,a5,s1
1bde: 4017d79b sraiw a5,a5,0x1
1be2: 0307879b addiw a5,a5,48
1be6: f8f400a3 sb a5,-127(s0)
<<<<<<< HEAD
=======
if (unlink(name) < 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1bea: f8040513 addi a0,s0,-128
1bee: 00004097 auipc ra,0x4
1bf2: 92e080e7 jalr -1746(ra) # 551c <unlink>
1bf6: fa0557e3 bgez a0,1ba4 <createdelete+0xb0>
<<<<<<< HEAD
1bfa: 85e6 mv a1,s9
1bfc: 00005517 auipc a0,0x5
1c00: b2450513 addi a0,a0,-1244 # 6720 <l_free+0xcb8>
1c04: 00004097 auipc ra,0x4
1c08: c42080e7 jalr -958(ra) # 5846 <printf>
1c0c: 4505 li a0,1
1c0e: 00004097 auipc ra,0x4
1c12: 8be080e7 jalr -1858(ra) # 54cc <exit>
1c16: 4501 li a0,0
1c18: 00004097 auipc ra,0x4
1c1c: 8b4080e7 jalr -1868(ra) # 54cc <exit>
1c20: 4505 li a0,1
1c22: 00004097 auipc ra,0x4
1c26: 8aa080e7 jalr -1878(ra) # 54cc <exit>
1c2a: f8040613 addi a2,s0,-128
1c2e: 85e6 mv a1,s9
1c30: 00005517 auipc a0,0x5
1c34: b0850513 addi a0,a0,-1272 # 6738 <l_free+0xcd0>
1c38: 00004097 auipc ra,0x4
1c3c: c0e080e7 jalr -1010(ra) # 5846 <printf>
1c40: 4505 li a0,1
1c42: 00004097 auipc ra,0x4
1c46: 88a080e7 jalr -1910(ra) # 54cc <exit>
1c4a: 054b7163 bgeu s6,s4,1c8c <createdelete+0x198>
1c4e: 02055a63 bgez a0,1c82 <createdelete+0x18e>
1c52: 2485 addiw s1,s1,1
1c54: 0ff4f493 zext.b s1,s1
1c58: 05548c63 beq s1,s5,1cb0 <createdelete+0x1bc>
1c5c: f8940023 sb s1,-128(s0)
1c60: f93400a3 sb s3,-127(s0)
=======
printf("%s: unlink failed\n", s);
1bfa: 85e6 mv a1,s9
1bfc: 00005517 auipc a0,0x5
1c00: b2450513 addi a0,a0,-1244 # 6720 <l_free+0xcba>
1c04: 00004097 auipc ra,0x4
1c08: c40080e7 jalr -960(ra) # 5844 <printf>
exit(1);
1c0c: 4505 li a0,1
1c0e: 00004097 auipc ra,0x4
1c12: 8be080e7 jalr -1858(ra) # 54cc <exit>
exit(0);
1c16: 4501 li a0,0
1c18: 00004097 auipc ra,0x4
1c1c: 8b4080e7 jalr -1868(ra) # 54cc <exit>
exit(1);
1c20: 4505 li a0,1
1c22: 00004097 auipc ra,0x4
1c26: 8aa080e7 jalr -1878(ra) # 54cc <exit>
printf("%s: oops createdelete %s didn't exist\n", s, name);
1c2a: f8040613 addi a2,s0,-128
1c2e: 85e6 mv a1,s9
1c30: 00005517 auipc a0,0x5
1c34: b0850513 addi a0,a0,-1272 # 6738 <l_free+0xcd2>
1c38: 00004097 auipc ra,0x4
1c3c: c0c080e7 jalr -1012(ra) # 5844 <printf>
exit(1);
1c40: 4505 li a0,1
1c42: 00004097 auipc ra,0x4
1c46: 88a080e7 jalr -1910(ra) # 54cc <exit>
} else if ((i >= 1 && i < N / 2) && fd >= 0) {
1c4a: 054b7163 bgeu s6,s4,1c8c <createdelete+0x198>
if (fd >= 0)
1c4e: 02055a63 bgez a0,1c82 <createdelete+0x18e>
for (pi = 0; pi < NCHILD; pi++) {
1c52: 2485 addiw s1,s1,1
1c54: 0ff4f493 andi s1,s1,255
1c58: 05548c63 beq s1,s5,1cb0 <createdelete+0x1bc>
name[0] = 'p' + pi;
1c5c: f8940023 sb s1,-128(s0)
name[1] = '0' + i;
1c60: f93400a3 sb s3,-127(s0)
fd = open(name, 0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1c64: 4581 li a1,0
1c66: f8040513 addi a0,s0,-128
1c6a: 00004097 auipc ra,0x4
1c6e: 8a2080e7 jalr -1886(ra) # 550c <open>
<<<<<<< HEAD
1c72: 00090463 beqz s2,1c7a <createdelete+0x186>
1c76: fd2bdae3 bge s7,s2,1c4a <createdelete+0x156>
1c7a: fa0548e3 bltz a0,1c2a <createdelete+0x136>
1c7e: 014b7963 bgeu s6,s4,1c90 <createdelete+0x19c>
1c82: 00004097 auipc ra,0x4
1c86: 872080e7 jalr -1934(ra) # 54f4 <close>
1c8a: b7e1 j 1c52 <createdelete+0x15e>
1c8c: fc0543e3 bltz a0,1c52 <createdelete+0x15e>
1c90: f8040613 addi a2,s0,-128
1c94: 85e6 mv a1,s9
1c96: 00005517 auipc a0,0x5
1c9a: aca50513 addi a0,a0,-1334 # 6760 <l_free+0xcf8>
1c9e: 00004097 auipc ra,0x4
1ca2: ba8080e7 jalr -1112(ra) # 5846 <printf>
1ca6: 4505 li a0,1
1ca8: 00004097 auipc ra,0x4
1cac: 824080e7 jalr -2012(ra) # 54cc <exit>
1cb0: 2905 addiw s2,s2,1
1cb2: 2a05 addiw s4,s4,1
1cb4: 2985 addiw s3,s3,1
1cb6: 0ff9f993 zext.b s3,s3
1cba: 47d1 li a5,20
1cbc: 02f90a63 beq s2,a5,1cf0 <createdelete+0x1fc>
1cc0: 84e2 mv s1,s8
1cc2: bf69 j 1c5c <createdelete+0x168>
1cc4: 2905 addiw s2,s2,1
1cc6: 0ff97913 zext.b s2,s2
1cca: 2985 addiw s3,s3,1
1ccc: 0ff9f993 zext.b s3,s3
1cd0: 03490863 beq s2,s4,1d00 <createdelete+0x20c>
1cd4: 84d6 mv s1,s5
1cd6: f9240023 sb s2,-128(s0)
1cda: f93400a3 sb s3,-127(s0)
1cde: f8040513 addi a0,s0,-128
1ce2: 00004097 auipc ra,0x4
1ce6: 83a080e7 jalr -1990(ra) # 551c <unlink>
=======
if ((i == 0 || i >= N / 2) && fd < 0) {
1c72: 00090463 beqz s2,1c7a <createdelete+0x186>
1c76: fd2bdae3 bge s7,s2,1c4a <createdelete+0x156>
1c7a: fa0548e3 bltz a0,1c2a <createdelete+0x136>
} else if ((i >= 1 && i < N / 2) && fd >= 0) {
1c7e: 014b7963 bgeu s6,s4,1c90 <createdelete+0x19c>
close(fd);
1c82: 00004097 auipc ra,0x4
1c86: 872080e7 jalr -1934(ra) # 54f4 <close>
1c8a: b7e1 j 1c52 <createdelete+0x15e>
} else if ((i >= 1 && i < N / 2) && fd >= 0) {
1c8c: fc0543e3 bltz a0,1c52 <createdelete+0x15e>
printf("%s: oops createdelete %s did exist\n", s, name);
1c90: f8040613 addi a2,s0,-128
1c94: 85e6 mv a1,s9
1c96: 00005517 auipc a0,0x5
1c9a: aca50513 addi a0,a0,-1334 # 6760 <l_free+0xcfa>
1c9e: 00004097 auipc ra,0x4
1ca2: ba6080e7 jalr -1114(ra) # 5844 <printf>
exit(1);
1ca6: 4505 li a0,1
1ca8: 00004097 auipc ra,0x4
1cac: 824080e7 jalr -2012(ra) # 54cc <exit>
for (i = 0; i < N; i++) {
1cb0: 2905 addiw s2,s2,1
1cb2: 2a05 addiw s4,s4,1
1cb4: 2985 addiw s3,s3,1
1cb6: 0ff9f993 andi s3,s3,255
1cba: 47d1 li a5,20
1cbc: 02f90a63 beq s2,a5,1cf0 <createdelete+0x1fc>
for (pi = 0; pi < NCHILD; pi++) {
1cc0: 84e2 mv s1,s8
1cc2: bf69 j 1c5c <createdelete+0x168>
for (i = 0; i < N; i++) {
1cc4: 2905 addiw s2,s2,1
1cc6: 0ff97913 andi s2,s2,255
1cca: 2985 addiw s3,s3,1
1ccc: 0ff9f993 andi s3,s3,255
1cd0: 03490863 beq s2,s4,1d00 <createdelete+0x20c>
name[0] = name[1] = name[2] = 0;
1cd4: 84d6 mv s1,s5
name[0] = 'p' + i;
1cd6: f9240023 sb s2,-128(s0)
name[1] = '0' + i;
1cda: f93400a3 sb s3,-127(s0)
unlink(name);
1cde: f8040513 addi a0,s0,-128
1ce2: 00004097 auipc ra,0x4
1ce6: 83a080e7 jalr -1990(ra) # 551c <unlink>
for (pi = 0; pi < NCHILD; pi++) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1cea: 34fd addiw s1,s1,-1
1cec: f4ed bnez s1,1cd6 <createdelete+0x1e2>
1cee: bfd9 j 1cc4 <createdelete+0x1d0>
1cf0: 03000993 li s3,48
1cf4: 07000913 li s2,112
<<<<<<< HEAD
1cf8: 4a91 li s5,4
1cfa: 08400a13 li s4,132
1cfe: bfd9 j 1cd4 <createdelete+0x1e0>
=======
name[0] = name[1] = name[2] = 0;
1cf8: 4a91 li s5,4
for (i = 0; i < N; i++) {
1cfa: 08400a13 li s4,132
1cfe: bfd9 j 1cd4 <createdelete+0x1e0>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1d00: 60aa ld ra,136(sp)
1d02: 640a ld s0,128(sp)
1d04: 74e6 ld s1,120(sp)
1d06: 7946 ld s2,112(sp)
1d08: 79a6 ld s3,104(sp)
1d0a: 7a06 ld s4,96(sp)
1d0c: 6ae6 ld s5,88(sp)
1d0e: 6b46 ld s6,80(sp)
1d10: 6ba6 ld s7,72(sp)
1d12: 6c06 ld s8,64(sp)
1d14: 7ce2 ld s9,56(sp)
1d16: 6149 addi sp,sp,144
1d18: 8082 ret
0000000000001d1a <linkunlink>:
<<<<<<< HEAD
=======
void linkunlink(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1d1a: 711d addi sp,sp,-96
1d1c: ec86 sd ra,88(sp)
1d1e: e8a2 sd s0,80(sp)
1d20: e4a6 sd s1,72(sp)
1d22: e0ca sd s2,64(sp)
1d24: fc4e sd s3,56(sp)
1d26: f852 sd s4,48(sp)
1d28: f456 sd s5,40(sp)
1d2a: f05a sd s6,32(sp)
1d2c: ec5e sd s7,24(sp)
1d2e: e862 sd s8,16(sp)
1d30: e466 sd s9,8(sp)
1d32: 1080 addi s0,sp,96
1d34: 84aa mv s1,a0
<<<<<<< HEAD
1d36: 00004517 auipc a0,0x4
1d3a: 0f250513 addi a0,a0,242 # 5e28 <l_free+0x3c0>
1d3e: 00003097 auipc ra,0x3
1d42: 7de080e7 jalr 2014(ra) # 551c <unlink>
1d46: 00003097 auipc ra,0x3
1d4a: 77e080e7 jalr 1918(ra) # 54c4 <fork>
1d4e: 02054b63 bltz a0,1d84 <linkunlink+0x6a>
1d52: 8c2a mv s8,a0
=======
unlink("x");
1d36: 00004517 auipc a0,0x4
1d3a: 0f250513 addi a0,a0,242 # 5e28 <l_free+0x3c2>
1d3e: 00003097 auipc ra,0x3
1d42: 7de080e7 jalr 2014(ra) # 551c <unlink>
pid = fork();
1d46: 00003097 auipc ra,0x3
1d4a: 77e080e7 jalr 1918(ra) # 54c4 <fork>
if (pid < 0) {
1d4e: 02054b63 bltz a0,1d84 <linkunlink+0x6a>
1d52: 8c2a mv s8,a0
unsigned int x = (pid ? 1 : 97);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1d54: 4c85 li s9,1
1d56: e119 bnez a0,1d5c <linkunlink+0x42>
1d58: 06100c93 li s9,97
1d5c: 06400493 li s1,100
<<<<<<< HEAD
=======
x = x * 1103515245 + 12345;
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1d60: 41c659b7 lui s3,0x41c65
1d64: e6d9899b addiw s3,s3,-403
1d68: 690d lui s2,0x3
1d6a: 0399091b addiw s2,s2,57
<<<<<<< HEAD
1d6e: 4a0d li s4,3
1d70: 4b05 li s6,1
1d72: 00004a97 auipc s5,0x4
1d76: 0b6a8a93 addi s5,s5,182 # 5e28 <l_free+0x3c0>
1d7a: 00005b97 auipc s7,0x5
1d7e: a0eb8b93 addi s7,s7,-1522 # 6788 <l_free+0xd20>
1d82: a825 j 1dba <linkunlink+0xa0>
1d84: 85a6 mv a1,s1
1d86: 00004517 auipc a0,0x4
1d8a: 7aa50513 addi a0,a0,1962 # 6530 <l_free+0xac8>
1d8e: 00004097 auipc ra,0x4
1d92: ab8080e7 jalr -1352(ra) # 5846 <printf>
1d96: 4505 li a0,1
1d98: 00003097 auipc ra,0x3
1d9c: 734080e7 jalr 1844(ra) # 54cc <exit>
=======
if ((x % 3) == 0) {
1d6e: 4a0d li s4,3
} else if ((x % 3) == 1) {
1d70: 4b05 li s6,1
unlink("x");
1d72: 00004a97 auipc s5,0x4
1d76: 0b6a8a93 addi s5,s5,182 # 5e28 <l_free+0x3c2>
link("cat", "x");
1d7a: 00005b97 auipc s7,0x5
1d7e: a0eb8b93 addi s7,s7,-1522 # 6788 <l_free+0xd22>
1d82: a825 j 1dba <linkunlink+0xa0>
printf("%s: fork failed\n", s);
1d84: 85a6 mv a1,s1
1d86: 00004517 auipc a0,0x4
1d8a: 7aa50513 addi a0,a0,1962 # 6530 <l_free+0xaca>
1d8e: 00004097 auipc ra,0x4
1d92: ab6080e7 jalr -1354(ra) # 5844 <printf>
exit(1);
1d96: 4505 li a0,1
1d98: 00003097 auipc ra,0x3
1d9c: 734080e7 jalr 1844(ra) # 54cc <exit>
close(open("x", O_RDWR | O_CREATE));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1da0: 20200593 li a1,514
1da4: 8556 mv a0,s5
1da6: 00003097 auipc ra,0x3
1daa: 766080e7 jalr 1894(ra) # 550c <open>
1dae: 00003097 auipc ra,0x3
1db2: 746080e7 jalr 1862(ra) # 54f4 <close>
<<<<<<< HEAD
1db6: 34fd addiw s1,s1,-1
1db8: c88d beqz s1,1dea <linkunlink+0xd0>
1dba: 033c87bb mulw a5,s9,s3
1dbe: 012787bb addw a5,a5,s2
1dc2: 00078c9b sext.w s9,a5
1dc6: 0347f7bb remuw a5,a5,s4
1dca: dbf9 beqz a5,1da0 <linkunlink+0x86>
1dcc: 01678863 beq a5,s6,1ddc <linkunlink+0xc2>
=======
for (i = 0; i < 100; i++) {
1db6: 34fd addiw s1,s1,-1
1db8: c88d beqz s1,1dea <linkunlink+0xd0>
x = x * 1103515245 + 12345;
1dba: 033c87bb mulw a5,s9,s3
1dbe: 012787bb addw a5,a5,s2
1dc2: 00078c9b sext.w s9,a5
if ((x % 3) == 0) {
1dc6: 0347f7bb remuw a5,a5,s4
1dca: dbf9 beqz a5,1da0 <linkunlink+0x86>
} else if ((x % 3) == 1) {
1dcc: 01678863 beq a5,s6,1ddc <linkunlink+0xc2>
unlink("x");
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1dd0: 8556 mv a0,s5
1dd2: 00003097 auipc ra,0x3
1dd6: 74a080e7 jalr 1866(ra) # 551c <unlink>
1dda: bff1 j 1db6 <linkunlink+0x9c>
<<<<<<< HEAD
=======
link("cat", "x");
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1ddc: 85d6 mv a1,s5
1dde: 855e mv a0,s7
1de0: 00003097 auipc ra,0x3
1de4: 74c080e7 jalr 1868(ra) # 552c <link>
1de8: b7f9 j 1db6 <linkunlink+0x9c>
<<<<<<< HEAD
1dea: 020c0463 beqz s8,1e12 <linkunlink+0xf8>
1dee: 4501 li a0,0
1df0: 00003097 auipc ra,0x3
1df4: 6e4080e7 jalr 1764(ra) # 54d4 <wait>
=======
if (pid)
1dea: 020c0463 beqz s8,1e12 <linkunlink+0xf8>
wait(0);
1dee: 4501 li a0,0
1df0: 00003097 auipc ra,0x3
1df4: 6e4080e7 jalr 1764(ra) # 54d4 <wait>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1df8: 60e6 ld ra,88(sp)
1dfa: 6446 ld s0,80(sp)
1dfc: 64a6 ld s1,72(sp)
1dfe: 6906 ld s2,64(sp)
1e00: 79e2 ld s3,56(sp)
1e02: 7a42 ld s4,48(sp)
1e04: 7aa2 ld s5,40(sp)
1e06: 7b02 ld s6,32(sp)
1e08: 6be2 ld s7,24(sp)
1e0a: 6c42 ld s8,16(sp)
1e0c: 6ca2 ld s9,8(sp)
1e0e: 6125 addi sp,sp,96
1e10: 8082 ret
<<<<<<< HEAD
=======
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1e12: 4501 li a0,0
1e14: 00003097 auipc ra,0x3
1e18: 6b8080e7 jalr 1720(ra) # 54cc <exit>
0000000000001e1c <forktest>:
<<<<<<< HEAD
=======
void forktest(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1e1c: 7179 addi sp,sp,-48
1e1e: f406 sd ra,40(sp)
1e20: f022 sd s0,32(sp)
1e22: ec26 sd s1,24(sp)
1e24: e84a sd s2,16(sp)
1e26: e44e sd s3,8(sp)
1e28: 1800 addi s0,sp,48
1e2a: 89aa mv s3,a0
<<<<<<< HEAD
1e2c: 4481 li s1,0
1e2e: 3e800913 li s2,1000
1e32: 00003097 auipc ra,0x3
1e36: 692080e7 jalr 1682(ra) # 54c4 <fork>
1e3a: 02054863 bltz a0,1e6a <forktest+0x4e>
1e3e: c115 beqz a0,1e62 <forktest+0x46>
1e40: 2485 addiw s1,s1,1
1e42: ff2498e3 bne s1,s2,1e32 <forktest+0x16>
1e46: 85ce mv a1,s3
1e48: 00005517 auipc a0,0x5
1e4c: 96050513 addi a0,a0,-1696 # 67a8 <l_free+0xd40>
1e50: 00004097 auipc ra,0x4
1e54: 9f6080e7 jalr -1546(ra) # 5846 <printf>
1e58: 4505 li a0,1
1e5a: 00003097 auipc ra,0x3
1e5e: 672080e7 jalr 1650(ra) # 54cc <exit>
1e62: 00003097 auipc ra,0x3
1e66: 66a080e7 jalr 1642(ra) # 54cc <exit>
1e6a: cc9d beqz s1,1ea8 <forktest+0x8c>
1e6c: 3e800793 li a5,1000
1e70: fcf48be3 beq s1,a5,1e46 <forktest+0x2a>
1e74: 00905b63 blez s1,1e8a <forktest+0x6e>
=======
for (n = 0; n < N; n++) {
1e2c: 4481 li s1,0
1e2e: 3e800913 li s2,1000
pid = fork();
1e32: 00003097 auipc ra,0x3
1e36: 692080e7 jalr 1682(ra) # 54c4 <fork>
if (pid < 0)
1e3a: 02054863 bltz a0,1e6a <forktest+0x4e>
if (pid == 0)
1e3e: c115 beqz a0,1e62 <forktest+0x46>
for (n = 0; n < N; n++) {
1e40: 2485 addiw s1,s1,1
1e42: ff2498e3 bne s1,s2,1e32 <forktest+0x16>
printf("%s: fork claimed to work 1000 times!\n", s);
1e46: 85ce mv a1,s3
1e48: 00005517 auipc a0,0x5
1e4c: 96050513 addi a0,a0,-1696 # 67a8 <l_free+0xd42>
1e50: 00004097 auipc ra,0x4
1e54: 9f4080e7 jalr -1548(ra) # 5844 <printf>
exit(1);
1e58: 4505 li a0,1
1e5a: 00003097 auipc ra,0x3
1e5e: 672080e7 jalr 1650(ra) # 54cc <exit>
exit(0);
1e62: 00003097 auipc ra,0x3
1e66: 66a080e7 jalr 1642(ra) # 54cc <exit>
if (n == 0) {
1e6a: cc9d beqz s1,1ea8 <forktest+0x8c>
if (n == N) {
1e6c: 3e800793 li a5,1000
1e70: fcf48be3 beq s1,a5,1e46 <forktest+0x2a>
for (; n > 0; n--) {
1e74: 00905b63 blez s1,1e8a <forktest+0x6e>
if (wait(0) < 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1e78: 4501 li a0,0
1e7a: 00003097 auipc ra,0x3
1e7e: 65a080e7 jalr 1626(ra) # 54d4 <wait>
1e82: 04054163 bltz a0,1ec4 <forktest+0xa8>
<<<<<<< HEAD
1e86: 34fd addiw s1,s1,-1
1e88: f8e5 bnez s1,1e78 <forktest+0x5c>
=======
for (; n > 0; n--) {
1e86: 34fd addiw s1,s1,-1
1e88: f8e5 bnez s1,1e78 <forktest+0x5c>
if (wait(0) != -1) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1e8a: 4501 li a0,0
1e8c: 00003097 auipc ra,0x3
1e90: 648080e7 jalr 1608(ra) # 54d4 <wait>
1e94: 57fd li a5,-1
1e96: 04f51563 bne a0,a5,1ee0 <forktest+0xc4>
<<<<<<< HEAD
=======
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1e9a: 70a2 ld ra,40(sp)
1e9c: 7402 ld s0,32(sp)
1e9e: 64e2 ld s1,24(sp)
1ea0: 6942 ld s2,16(sp)
1ea2: 69a2 ld s3,8(sp)
1ea4: 6145 addi sp,sp,48
1ea6: 8082 ret
<<<<<<< HEAD
1ea8: 85ce mv a1,s3
1eaa: 00005517 auipc a0,0x5
1eae: 8e650513 addi a0,a0,-1818 # 6790 <l_free+0xd28>
1eb2: 00004097 auipc ra,0x4
1eb6: 994080e7 jalr -1644(ra) # 5846 <printf>
1eba: 4505 li a0,1
1ebc: 00003097 auipc ra,0x3
1ec0: 610080e7 jalr 1552(ra) # 54cc <exit>
1ec4: 85ce mv a1,s3
1ec6: 00005517 auipc a0,0x5
1eca: 90a50513 addi a0,a0,-1782 # 67d0 <l_free+0xd68>
1ece: 00004097 auipc ra,0x4
1ed2: 978080e7 jalr -1672(ra) # 5846 <printf>
1ed6: 4505 li a0,1
1ed8: 00003097 auipc ra,0x3
1edc: 5f4080e7 jalr 1524(ra) # 54cc <exit>
1ee0: 85ce mv a1,s3
1ee2: 00005517 auipc a0,0x5
1ee6: 90650513 addi a0,a0,-1786 # 67e8 <l_free+0xd80>
1eea: 00004097 auipc ra,0x4
1eee: 95c080e7 jalr -1700(ra) # 5846 <printf>
=======
printf("%s: no fork at all!\n", s);
1ea8: 85ce mv a1,s3
1eaa: 00005517 auipc a0,0x5
1eae: 8e650513 addi a0,a0,-1818 # 6790 <l_free+0xd2a>
1eb2: 00004097 auipc ra,0x4
1eb6: 992080e7 jalr -1646(ra) # 5844 <printf>
exit(1);
1eba: 4505 li a0,1
1ebc: 00003097 auipc ra,0x3
1ec0: 610080e7 jalr 1552(ra) # 54cc <exit>
printf("%s: wait stopped early\n", s);
1ec4: 85ce mv a1,s3
1ec6: 00005517 auipc a0,0x5
1eca: 90a50513 addi a0,a0,-1782 # 67d0 <l_free+0xd6a>
1ece: 00004097 auipc ra,0x4
1ed2: 976080e7 jalr -1674(ra) # 5844 <printf>
exit(1);
1ed6: 4505 li a0,1
1ed8: 00003097 auipc ra,0x3
1edc: 5f4080e7 jalr 1524(ra) # 54cc <exit>
printf("%s: wait got too many\n", s);
1ee0: 85ce mv a1,s3
1ee2: 00005517 auipc a0,0x5
1ee6: 90650513 addi a0,a0,-1786 # 67e8 <l_free+0xd82>
1eea: 00004097 auipc ra,0x4
1eee: 95a080e7 jalr -1702(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1ef2: 4505 li a0,1
1ef4: 00003097 auipc ra,0x3
1ef8: 5d8080e7 jalr 1496(ra) # 54cc <exit>
0000000000001efc <kernmem>:
<<<<<<< HEAD
=======
void kernmem(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1efc: 715d addi sp,sp,-80
1efe: e486 sd ra,72(sp)
1f00: e0a2 sd s0,64(sp)
1f02: fc26 sd s1,56(sp)
1f04: f84a sd s2,48(sp)
1f06: f44e sd s3,40(sp)
1f08: f052 sd s4,32(sp)
1f0a: ec56 sd s5,24(sp)
1f0c: 0880 addi s0,sp,80
1f0e: 8a2a mv s4,a0
<<<<<<< HEAD
1f10: 4485 li s1,1
1f12: 04fe slli s1,s1,0x1f
1f14: 5afd li s5,-1
1f16: 69b1 lui s3,0xc
1f18: 35098993 addi s3,s3,848 # c350 <buf+0x940>
1f1c: 1003d937 lui s2,0x1003d
1f20: 090e slli s2,s2,0x3
1f22: 48090913 addi s2,s2,1152 # 1003d480 <__BSS_END__+0x1002ea60>
1f26: 00003097 auipc ra,0x3
1f2a: 59e080e7 jalr 1438(ra) # 54c4 <fork>
1f2e: 02054963 bltz a0,1f60 <kernmem+0x64>
1f32: c529 beqz a0,1f7c <kernmem+0x80>
1f34: fbc40513 addi a0,s0,-68
1f38: 00003097 auipc ra,0x3
1f3c: 59c080e7 jalr 1436(ra) # 54d4 <wait>
1f40: fbc42783 lw a5,-68(s0)
1f44: 05579c63 bne a5,s5,1f9c <kernmem+0xa0>
1f48: 94ce add s1,s1,s3
1f4a: fd249ee3 bne s1,s2,1f26 <kernmem+0x2a>
=======
for (a = (char *)(KERNBASE); a < (char *)(KERNBASE + 2000000); a += 50000) {
1f10: 4485 li s1,1
1f12: 04fe slli s1,s1,0x1f
if (xstatus != -1) // did kernel kill child?
1f14: 5afd li s5,-1
for (a = (char *)(KERNBASE); a < (char *)(KERNBASE + 2000000); a += 50000) {
1f16: 69b1 lui s3,0xc
1f18: 35098993 addi s3,s3,848 # c350 <buf+0x998>
1f1c: 1003d937 lui s2,0x1003d
1f20: 090e slli s2,s2,0x3
1f22: 48090913 addi s2,s2,1152 # 1003d480 <__BSS_END__+0x1002eab8>
pid = fork();
1f26: 00003097 auipc ra,0x3
1f2a: 59e080e7 jalr 1438(ra) # 54c4 <fork>
if (pid < 0) {
1f2e: 02054963 bltz a0,1f60 <kernmem+0x64>
if (pid == 0) {
1f32: c529 beqz a0,1f7c <kernmem+0x80>
wait(&xstatus);
1f34: fbc40513 addi a0,s0,-68
1f38: 00003097 auipc ra,0x3
1f3c: 59c080e7 jalr 1436(ra) # 54d4 <wait>
if (xstatus != -1) // did kernel kill child?
1f40: fbc42783 lw a5,-68(s0)
1f44: 05579c63 bne a5,s5,1f9c <kernmem+0xa0>
for (a = (char *)(KERNBASE); a < (char *)(KERNBASE + 2000000); a += 50000) {
1f48: 94ce add s1,s1,s3
1f4a: fd249ee3 bne s1,s2,1f26 <kernmem+0x2a>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1f4e: 60a6 ld ra,72(sp)
1f50: 6406 ld s0,64(sp)
1f52: 74e2 ld s1,56(sp)
1f54: 7942 ld s2,48(sp)
1f56: 79a2 ld s3,40(sp)
1f58: 7a02 ld s4,32(sp)
1f5a: 6ae2 ld s5,24(sp)
1f5c: 6161 addi sp,sp,80
1f5e: 8082 ret
<<<<<<< HEAD
1f60: 85d2 mv a1,s4
1f62: 00004517 auipc a0,0x4
1f66: 5ce50513 addi a0,a0,1486 # 6530 <l_free+0xac8>
1f6a: 00004097 auipc ra,0x4
1f6e: 8dc080e7 jalr -1828(ra) # 5846 <printf>
1f72: 4505 li a0,1
1f74: 00003097 auipc ra,0x3
1f78: 558080e7 jalr 1368(ra) # 54cc <exit>
1f7c: 0004c603 lbu a2,0(s1)
1f80: 85a6 mv a1,s1
1f82: 00005517 auipc a0,0x5
1f86: 87e50513 addi a0,a0,-1922 # 6800 <l_free+0xd98>
1f8a: 00004097 auipc ra,0x4
1f8e: 8bc080e7 jalr -1860(ra) # 5846 <printf>
1f92: 4505 li a0,1
1f94: 00003097 auipc ra,0x3
1f98: 538080e7 jalr 1336(ra) # 54cc <exit>
=======
printf("%s: fork failed\n", s);
1f60: 85d2 mv a1,s4
1f62: 00004517 auipc a0,0x4
1f66: 5ce50513 addi a0,a0,1486 # 6530 <l_free+0xaca>
1f6a: 00004097 auipc ra,0x4
1f6e: 8da080e7 jalr -1830(ra) # 5844 <printf>
exit(1);
1f72: 4505 li a0,1
1f74: 00003097 auipc ra,0x3
1f78: 558080e7 jalr 1368(ra) # 54cc <exit>
printf("%s: oops could read %x = %x\n", a, *a);
1f7c: 0004c603 lbu a2,0(s1)
1f80: 85a6 mv a1,s1
1f82: 00005517 auipc a0,0x5
1f86: 87e50513 addi a0,a0,-1922 # 6800 <l_free+0xd9a>
1f8a: 00004097 auipc ra,0x4
1f8e: 8ba080e7 jalr -1862(ra) # 5844 <printf>
exit(1);
1f92: 4505 li a0,1
1f94: 00003097 auipc ra,0x3
1f98: 538080e7 jalr 1336(ra) # 54cc <exit>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1f9c: 4505 li a0,1
1f9e: 00003097 auipc ra,0x3
1fa2: 52e080e7 jalr 1326(ra) # 54cc <exit>
0000000000001fa6 <bigargtest>:
<<<<<<< HEAD
=======
void bigargtest(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
1fa6: 7179 addi sp,sp,-48
1fa8: f406 sd ra,40(sp)
1faa: f022 sd s0,32(sp)
1fac: ec26 sd s1,24(sp)
1fae: 1800 addi s0,sp,48
1fb0: 84aa mv s1,a0
<<<<<<< HEAD
1fb2: 00005517 auipc a0,0x5
1fb6: 86e50513 addi a0,a0,-1938 # 6820 <l_free+0xdb8>
1fba: 00003097 auipc ra,0x3
1fbe: 562080e7 jalr 1378(ra) # 551c <unlink>
1fc2: 00003097 auipc ra,0x3
1fc6: 502080e7 jalr 1282(ra) # 54c4 <fork>
1fca: c121 beqz a0,200a <bigargtest+0x64>
1fcc: 0a054063 bltz a0,206c <bigargtest+0xc6>
1fd0: fdc40513 addi a0,s0,-36
1fd4: 00003097 auipc ra,0x3
1fd8: 500080e7 jalr 1280(ra) # 54d4 <wait>
1fdc: fdc42503 lw a0,-36(s0)
1fe0: e545 bnez a0,2088 <bigargtest+0xe2>
1fe2: 4581 li a1,0
1fe4: 00005517 auipc a0,0x5
1fe8: 83c50513 addi a0,a0,-1988 # 6820 <l_free+0xdb8>
1fec: 00003097 auipc ra,0x3
1ff0: 520080e7 jalr 1312(ra) # 550c <open>
1ff4: 08054e63 bltz a0,2090 <bigargtest+0xea>
1ff8: 00003097 auipc ra,0x3
1ffc: 4fc080e7 jalr 1276(ra) # 54f4 <close>
=======
unlink("bigarg-ok");
1fb2: 00005517 auipc a0,0x5
1fb6: 86e50513 addi a0,a0,-1938 # 6820 <l_free+0xdba>
1fba: 00003097 auipc ra,0x3
1fbe: 562080e7 jalr 1378(ra) # 551c <unlink>
pid = fork();
1fc2: 00003097 auipc ra,0x3
1fc6: 502080e7 jalr 1282(ra) # 54c4 <fork>
if (pid == 0) {
1fca: c121 beqz a0,200a <bigargtest+0x64>
} else if (pid < 0) {
1fcc: 0a054063 bltz a0,206c <bigargtest+0xc6>
wait(&xstatus);
1fd0: fdc40513 addi a0,s0,-36
1fd4: 00003097 auipc ra,0x3
1fd8: 500080e7 jalr 1280(ra) # 54d4 <wait>
if (xstatus != 0)
1fdc: fdc42503 lw a0,-36(s0)
1fe0: e545 bnez a0,2088 <bigargtest+0xe2>
fd = open("bigarg-ok", 0);
1fe2: 4581 li a1,0
1fe4: 00005517 auipc a0,0x5
1fe8: 83c50513 addi a0,a0,-1988 # 6820 <l_free+0xdba>
1fec: 00003097 auipc ra,0x3
1ff0: 520080e7 jalr 1312(ra) # 550c <open>
if (fd < 0) {
1ff4: 08054e63 bltz a0,2090 <bigargtest+0xea>
close(fd);
1ff8: 00003097 auipc ra,0x3
1ffc: 4fc080e7 jalr 1276(ra) # 54f4 <close>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2000: 70a2 ld ra,40(sp)
2002: 7402 ld s0,32(sp)
2004: 64e2 ld s1,24(sp)
2006: 6145 addi sp,sp,48
2008: 8082 ret
200a: 00006797 auipc a5,0x6
<<<<<<< HEAD
200e: 1ee78793 addi a5,a5,494 # 81f8 <args.1>
2012: 00006697 auipc a3,0x6
2016: 2de68693 addi a3,a3,734 # 82f0 <args.1+0xf8>
201a: 00005717 auipc a4,0x5
201e: 81670713 addi a4,a4,-2026 # 6830 <l_free+0xdc8>
2022: e398 sd a4,0(a5)
2024: 07a1 addi a5,a5,8
2026: fed79ee3 bne a5,a3,2022 <bigargtest+0x7c>
202a: 00006597 auipc a1,0x6
202e: 1ce58593 addi a1,a1,462 # 81f8 <args.1>
2032: 0e05bc23 sd zero,248(a1)
2036: 00004517 auipc a0,0x4
203a: d8250513 addi a0,a0,-638 # 5db8 <l_free+0x350>
203e: 00003097 auipc ra,0x3
2042: 4c6080e7 jalr 1222(ra) # 5504 <exec>
2046: 20000593 li a1,512
204a: 00004517 auipc a0,0x4
204e: 7d650513 addi a0,a0,2006 # 6820 <l_free+0xdb8>
2052: 00003097 auipc ra,0x3
2056: 4ba080e7 jalr 1210(ra) # 550c <open>
205a: 00003097 auipc ra,0x3
205e: 49a080e7 jalr 1178(ra) # 54f4 <close>
2062: 4501 li a0,0
2064: 00003097 auipc ra,0x3
2068: 468080e7 jalr 1128(ra) # 54cc <exit>
206c: 85a6 mv a1,s1
206e: 00005517 auipc a0,0x5
2072: 8a250513 addi a0,a0,-1886 # 6910 <l_free+0xea8>
2076: 00003097 auipc ra,0x3
207a: 7d0080e7 jalr 2000(ra) # 5846 <printf>
207e: 4505 li a0,1
2080: 00003097 auipc ra,0x3
2084: 44c080e7 jalr 1100(ra) # 54cc <exit>
2088: 00003097 auipc ra,0x3
208c: 444080e7 jalr 1092(ra) # 54cc <exit>
2090: 85a6 mv a1,s1
2092: 00005517 auipc a0,0x5
2096: 89e50513 addi a0,a0,-1890 # 6930 <l_free+0xec8>
209a: 00003097 auipc ra,0x3
209e: 7ac080e7 jalr 1964(ra) # 5846 <printf>
=======
200e: 19678793 addi a5,a5,406 # 81a0 <args.1>
2012: 00006697 auipc a3,0x6
2016: 28668693 addi a3,a3,646 # 8298 <args.1+0xf8>
args[i] = "bigargs test: failed\n "
201a: 00005717 auipc a4,0x5
201e: 81670713 addi a4,a4,-2026 # 6830 <l_free+0xdca>
2022: e398 sd a4,0(a5)
for (i = 0; i < MAXARG - 1; i++)
2024: 07a1 addi a5,a5,8
2026: fed79ee3 bne a5,a3,2022 <bigargtest+0x7c>
args[MAXARG - 1] = 0;
202a: 00006597 auipc a1,0x6
202e: 17658593 addi a1,a1,374 # 81a0 <args.1>
2032: 0e05bc23 sd zero,248(a1)
exec("echo", args);
2036: 00004517 auipc a0,0x4
203a: d8250513 addi a0,a0,-638 # 5db8 <l_free+0x352>
203e: 00003097 auipc ra,0x3
2042: 4c6080e7 jalr 1222(ra) # 5504 <exec>
fd = open("bigarg-ok", O_CREATE);
2046: 20000593 li a1,512
204a: 00004517 auipc a0,0x4
204e: 7d650513 addi a0,a0,2006 # 6820 <l_free+0xdba>
2052: 00003097 auipc ra,0x3
2056: 4ba080e7 jalr 1210(ra) # 550c <open>
close(fd);
205a: 00003097 auipc ra,0x3
205e: 49a080e7 jalr 1178(ra) # 54f4 <close>
exit(0);
2062: 4501 li a0,0
2064: 00003097 auipc ra,0x3
2068: 468080e7 jalr 1128(ra) # 54cc <exit>
printf("%s: bigargtest: fork failed\n", s);
206c: 85a6 mv a1,s1
206e: 00005517 auipc a0,0x5
2072: 8a250513 addi a0,a0,-1886 # 6910 <l_free+0xeaa>
2076: 00003097 auipc ra,0x3
207a: 7ce080e7 jalr 1998(ra) # 5844 <printf>
exit(1);
207e: 4505 li a0,1
2080: 00003097 auipc ra,0x3
2084: 44c080e7 jalr 1100(ra) # 54cc <exit>
exit(xstatus);
2088: 00003097 auipc ra,0x3
208c: 444080e7 jalr 1092(ra) # 54cc <exit>
printf("%s: bigarg test failed!\n", s);
2090: 85a6 mv a1,s1
2092: 00005517 auipc a0,0x5
2096: 89e50513 addi a0,a0,-1890 # 6930 <l_free+0xeca>
209a: 00003097 auipc ra,0x3
209e: 7aa080e7 jalr 1962(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
20a2: 4505 li a0,1
20a4: 00003097 auipc ra,0x3
20a8: 428080e7 jalr 1064(ra) # 54cc <exit>
00000000000020ac <stacktest>:
<<<<<<< HEAD
=======
void stacktest(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
20ac: 7179 addi sp,sp,-48
20ae: f406 sd ra,40(sp)
20b0: f022 sd s0,32(sp)
20b2: ec26 sd s1,24(sp)
20b4: 1800 addi s0,sp,48
20b6: 84aa mv s1,a0
<<<<<<< HEAD
20b8: 00003097 auipc ra,0x3
20bc: 40c080e7 jalr 1036(ra) # 54c4 <fork>
20c0: c115 beqz a0,20e4 <stacktest+0x38>
20c2: 04054363 bltz a0,2108 <stacktest+0x5c>
20c6: fdc40513 addi a0,s0,-36
20ca: 00003097 auipc ra,0x3
20ce: 40a080e7 jalr 1034(ra) # 54d4 <wait>
20d2: fdc42503 lw a0,-36(s0)
20d6: 57fd li a5,-1
20d8: 04f50663 beq a0,a5,2124 <stacktest+0x78>
20dc: 00003097 auipc ra,0x3
20e0: 3f0080e7 jalr 1008(ra) # 54cc <exit>
20e4: 870a mv a4,sp
20e6: 77fd lui a5,0xfffff
20e8: 97ba add a5,a5,a4
20ea: 0007c583 lbu a1,0(a5) # fffffffffffff000 <__BSS_END__+0xffffffffffff05e0>
20ee: 00005517 auipc a0,0x5
20f2: 86250513 addi a0,a0,-1950 # 6950 <l_free+0xee8>
20f6: 00003097 auipc ra,0x3
20fa: 750080e7 jalr 1872(ra) # 5846 <printf>
20fe: 4505 li a0,1
2100: 00003097 auipc ra,0x3
2104: 3cc080e7 jalr 972(ra) # 54cc <exit>
2108: 85a6 mv a1,s1
210a: 00004517 auipc a0,0x4
210e: 42650513 addi a0,a0,1062 # 6530 <l_free+0xac8>
2112: 00003097 auipc ra,0x3
2116: 734080e7 jalr 1844(ra) # 5846 <printf>
211a: 4505 li a0,1
211c: 00003097 auipc ra,0x3
2120: 3b0080e7 jalr 944(ra) # 54cc <exit>
=======
pid = fork();
20b8: 00003097 auipc ra,0x3
20bc: 40c080e7 jalr 1036(ra) # 54c4 <fork>
if (pid == 0) {
20c0: c115 beqz a0,20e4 <stacktest+0x38>
} else if (pid < 0) {
20c2: 04054363 bltz a0,2108 <stacktest+0x5c>
wait(&xstatus);
20c6: fdc40513 addi a0,s0,-36
20ca: 00003097 auipc ra,0x3
20ce: 40a080e7 jalr 1034(ra) # 54d4 <wait>
if (xstatus == -1) // kernel killed child?
20d2: fdc42503 lw a0,-36(s0)
20d6: 57fd li a5,-1
20d8: 04f50663 beq a0,a5,2124 <stacktest+0x78>
exit(xstatus);
20dc: 00003097 auipc ra,0x3
20e0: 3f0080e7 jalr 1008(ra) # 54cc <exit>
return (x & SSTATUS_SIE) != 0;
}
static inline uint64 r_sp() {
uint64 x;
asm volatile("mv %0, sp" : "=r"(x));
20e4: 870a mv a4,sp
printf("%s: stacktest: read below stack %p\n", *sp);
20e6: 77fd lui a5,0xfffff
20e8: 97ba add a5,a5,a4
20ea: 0007c583 lbu a1,0(a5) # fffffffffffff000 <__BSS_END__+0xffffffffffff0638>
20ee: 00005517 auipc a0,0x5
20f2: 86250513 addi a0,a0,-1950 # 6950 <l_free+0xeea>
20f6: 00003097 auipc ra,0x3
20fa: 74e080e7 jalr 1870(ra) # 5844 <printf>
exit(1);
20fe: 4505 li a0,1
2100: 00003097 auipc ra,0x3
2104: 3cc080e7 jalr 972(ra) # 54cc <exit>
printf("%s: fork failed\n", s);
2108: 85a6 mv a1,s1
210a: 00004517 auipc a0,0x4
210e: 42650513 addi a0,a0,1062 # 6530 <l_free+0xaca>
2112: 00003097 auipc ra,0x3
2116: 732080e7 jalr 1842(ra) # 5844 <printf>
exit(1);
211a: 4505 li a0,1
211c: 00003097 auipc ra,0x3
2120: 3b0080e7 jalr 944(ra) # 54cc <exit>
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2124: 4501 li a0,0
2126: 00003097 auipc ra,0x3
212a: 3a6080e7 jalr 934(ra) # 54cc <exit>
000000000000212e <copyinstr3>:
<<<<<<< HEAD
=======
void copyinstr3(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
212e: 7179 addi sp,sp,-48
2130: f406 sd ra,40(sp)
2132: f022 sd s0,32(sp)
2134: ec26 sd s1,24(sp)
2136: 1800 addi s0,sp,48
<<<<<<< HEAD
2138: 6509 lui a0,0x2
213a: 00003097 auipc ra,0x3
213e: 41a080e7 jalr 1050(ra) # 5554 <sbrk>
2142: 4501 li a0,0
2144: 00003097 auipc ra,0x3
2148: 410080e7 jalr 1040(ra) # 5554 <sbrk>
214c: 03451793 slli a5,a0,0x34
2150: e3c9 bnez a5,21d2 <copyinstr3+0xa4>
2152: 4501 li a0,0
2154: 00003097 auipc ra,0x3
2158: 400080e7 jalr 1024(ra) # 5554 <sbrk>
215c: 03451793 slli a5,a0,0x34
2160: e3d9 bnez a5,21e6 <copyinstr3+0xb8>
2162: fff50493 addi s1,a0,-1 # 1fff <bigargtest+0x59>
2166: 07800793 li a5,120
216a: fef50fa3 sb a5,-1(a0)
216e: 8526 mv a0,s1
2170: 00003097 auipc ra,0x3
2174: 3ac080e7 jalr 940(ra) # 551c <unlink>
2178: 57fd li a5,-1
217a: 08f51363 bne a0,a5,2200 <copyinstr3+0xd2>
=======
sbrk(8192);
2138: 6509 lui a0,0x2
213a: 00003097 auipc ra,0x3
213e: 41a080e7 jalr 1050(ra) # 5554 <sbrk>
uint64 top = (uint64)sbrk(0);
2142: 4501 li a0,0
2144: 00003097 auipc ra,0x3
2148: 410080e7 jalr 1040(ra) # 5554 <sbrk>
if ((top % PGSIZE) != 0) {
214c: 03451793 slli a5,a0,0x34
2150: e3c9 bnez a5,21d2 <copyinstr3+0xa4>
top = (uint64)sbrk(0);
2152: 4501 li a0,0
2154: 00003097 auipc ra,0x3
2158: 400080e7 jalr 1024(ra) # 5554 <sbrk>
if (top % PGSIZE) {
215c: 03451793 slli a5,a0,0x34
2160: e3d9 bnez a5,21e6 <copyinstr3+0xb8>
char *b = (char *)(top - 1);
2162: fff50493 addi s1,a0,-1 # 1fff <bigargtest+0x59>
*b = 'x';
2166: 07800793 li a5,120
216a: fef50fa3 sb a5,-1(a0)
int ret = unlink(b);
216e: 8526 mv a0,s1
2170: 00003097 auipc ra,0x3
2174: 3ac080e7 jalr 940(ra) # 551c <unlink>
if (ret != -1) {
2178: 57fd li a5,-1
217a: 08f51363 bne a0,a5,2200 <copyinstr3+0xd2>
int fd = open(b, O_CREATE | O_WRONLY);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
217e: 20100593 li a1,513
2182: 8526 mv a0,s1
2184: 00003097 auipc ra,0x3
2188: 388080e7 jalr 904(ra) # 550c <open>
<<<<<<< HEAD
218c: 57fd li a5,-1
218e: 08f51863 bne a0,a5,221e <copyinstr3+0xf0>
=======
if (fd != -1) {
218c: 57fd li a5,-1
218e: 08f51863 bne a0,a5,221e <copyinstr3+0xf0>
ret = link(b, b);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2192: 85a6 mv a1,s1
2194: 8526 mv a0,s1
2196: 00003097 auipc ra,0x3
219a: 396080e7 jalr 918(ra) # 552c <link>
<<<<<<< HEAD
219e: 57fd li a5,-1
21a0: 08f51e63 bne a0,a5,223c <copyinstr3+0x10e>
21a4: 00005797 auipc a5,0x5
21a8: 35478793 addi a5,a5,852 # 74f8 <l_free+0x1a90>
21ac: fcf43823 sd a5,-48(s0)
21b0: fc043c23 sd zero,-40(s0)
=======
if (ret != -1) {
219e: 57fd li a5,-1
21a0: 08f51e63 bne a0,a5,223c <copyinstr3+0x10e>
char *args[] = {"xx", 0};
21a4: 00005797 auipc a5,0x5
21a8: 35478793 addi a5,a5,852 # 74f8 <l_free+0x1a92>
21ac: fcf43823 sd a5,-48(s0)
21b0: fc043c23 sd zero,-40(s0)
ret = exec(b, args);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
21b4: fd040593 addi a1,s0,-48
21b8: 8526 mv a0,s1
21ba: 00003097 auipc ra,0x3
21be: 34a080e7 jalr 842(ra) # 5504 <exec>
<<<<<<< HEAD
21c2: 57fd li a5,-1
21c4: 08f51c63 bne a0,a5,225c <copyinstr3+0x12e>
=======
if (ret != -1) {
21c2: 57fd li a5,-1
21c4: 08f51c63 bne a0,a5,225c <copyinstr3+0x12e>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
21c8: 70a2 ld ra,40(sp)
21ca: 7402 ld s0,32(sp)
21cc: 64e2 ld s1,24(sp)
21ce: 6145 addi sp,sp,48
21d0: 8082 ret
<<<<<<< HEAD
=======
sbrk(PGSIZE - (top % PGSIZE));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
21d2: 0347d513 srli a0,a5,0x34
21d6: 6785 lui a5,0x1
21d8: 40a7853b subw a0,a5,a0
21dc: 00003097 auipc ra,0x3
21e0: 378080e7 jalr 888(ra) # 5554 <sbrk>
21e4: b7bd j 2152 <copyinstr3+0x24>
<<<<<<< HEAD
21e6: 00004517 auipc a0,0x4
21ea: 79250513 addi a0,a0,1938 # 6978 <l_free+0xf10>
21ee: 00003097 auipc ra,0x3
21f2: 658080e7 jalr 1624(ra) # 5846 <printf>
21f6: 4505 li a0,1
21f8: 00003097 auipc ra,0x3
21fc: 2d4080e7 jalr 724(ra) # 54cc <exit>
2200: 862a mv a2,a0
2202: 85a6 mv a1,s1
2204: 00004517 auipc a0,0x4
2208: 24c50513 addi a0,a0,588 # 6450 <l_free+0x9e8>
220c: 00003097 auipc ra,0x3
2210: 63a080e7 jalr 1594(ra) # 5846 <printf>
2214: 4505 li a0,1
2216: 00003097 auipc ra,0x3
221a: 2b6080e7 jalr 694(ra) # 54cc <exit>
221e: 862a mv a2,a0
2220: 85a6 mv a1,s1
2222: 00004517 auipc a0,0x4
2226: 24e50513 addi a0,a0,590 # 6470 <l_free+0xa08>
222a: 00003097 auipc ra,0x3
222e: 61c080e7 jalr 1564(ra) # 5846 <printf>
2232: 4505 li a0,1
2234: 00003097 auipc ra,0x3
2238: 298080e7 jalr 664(ra) # 54cc <exit>
=======
printf("oops\n");
21e6: 00004517 auipc a0,0x4
21ea: 79250513 addi a0,a0,1938 # 6978 <l_free+0xf12>
21ee: 00003097 auipc ra,0x3
21f2: 656080e7 jalr 1622(ra) # 5844 <printf>
exit(1);
21f6: 4505 li a0,1
21f8: 00003097 auipc ra,0x3
21fc: 2d4080e7 jalr 724(ra) # 54cc <exit>
printf("unlink(%s) returned %d, not -1\n", b, ret);
2200: 862a mv a2,a0
2202: 85a6 mv a1,s1
2204: 00004517 auipc a0,0x4
2208: 24c50513 addi a0,a0,588 # 6450 <l_free+0x9ea>
220c: 00003097 auipc ra,0x3
2210: 638080e7 jalr 1592(ra) # 5844 <printf>
exit(1);
2214: 4505 li a0,1
2216: 00003097 auipc ra,0x3
221a: 2b6080e7 jalr 694(ra) # 54cc <exit>
printf("open(%s) returned %d, not -1\n", b, fd);
221e: 862a mv a2,a0
2220: 85a6 mv a1,s1
2222: 00004517 auipc a0,0x4
2226: 24e50513 addi a0,a0,590 # 6470 <l_free+0xa0a>
222a: 00003097 auipc ra,0x3
222e: 61a080e7 jalr 1562(ra) # 5844 <printf>
exit(1);
2232: 4505 li a0,1
2234: 00003097 auipc ra,0x3
2238: 298080e7 jalr 664(ra) # 54cc <exit>
printf("link(%s, %s) returned %d, not -1\n", b, b, ret);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
223c: 86aa mv a3,a0
223e: 8626 mv a2,s1
2240: 85a6 mv a1,s1
2242: 00004517 auipc a0,0x4
<<<<<<< HEAD
2246: 24e50513 addi a0,a0,590 # 6490 <l_free+0xa28>
224a: 00003097 auipc ra,0x3
224e: 5fc080e7 jalr 1532(ra) # 5846 <printf>
2252: 4505 li a0,1
2254: 00003097 auipc ra,0x3
2258: 278080e7 jalr 632(ra) # 54cc <exit>
225c: 567d li a2,-1
225e: 85a6 mv a1,s1
2260: 00004517 auipc a0,0x4
2264: 25850513 addi a0,a0,600 # 64b8 <l_free+0xa50>
2268: 00003097 auipc ra,0x3
226c: 5de080e7 jalr 1502(ra) # 5846 <printf>
=======
2246: 24e50513 addi a0,a0,590 # 6490 <l_free+0xa2a>
224a: 00003097 auipc ra,0x3
224e: 5fa080e7 jalr 1530(ra) # 5844 <printf>
exit(1);
2252: 4505 li a0,1
2254: 00003097 auipc ra,0x3
2258: 278080e7 jalr 632(ra) # 54cc <exit>
printf("exec(%s) returned %d, not -1\n", b, fd);
225c: 567d li a2,-1
225e: 85a6 mv a1,s1
2260: 00004517 auipc a0,0x4
2264: 25850513 addi a0,a0,600 # 64b8 <l_free+0xa52>
2268: 00003097 auipc ra,0x3
226c: 5dc080e7 jalr 1500(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2270: 4505 li a0,1
2272: 00003097 auipc ra,0x3
2276: 25a080e7 jalr 602(ra) # 54cc <exit>
000000000000227a <rwsbrk>:
<<<<<<< HEAD
=======
void rwsbrk() {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
227a: 1101 addi sp,sp,-32
227c: ec06 sd ra,24(sp)
227e: e822 sd s0,16(sp)
2280: e426 sd s1,8(sp)
2282: e04a sd s2,0(sp)
2284: 1000 addi s0,sp,32
<<<<<<< HEAD
2286: 6509 lui a0,0x2
2288: 00003097 auipc ra,0x3
228c: 2cc080e7 jalr 716(ra) # 5554 <sbrk>
2290: 57fd li a5,-1
2292: 06f50363 beq a0,a5,22f8 <rwsbrk+0x7e>
2296: 84aa mv s1,a0
=======
uint64 a = (uint64)sbrk(8192);
2286: 6509 lui a0,0x2
2288: 00003097 auipc ra,0x3
228c: 2cc080e7 jalr 716(ra) # 5554 <sbrk>
if (a == 0xffffffffffffffffLL) {
2290: 57fd li a5,-1
2292: 06f50363 beq a0,a5,22f8 <rwsbrk+0x7e>
2296: 84aa mv s1,a0
if ((uint64)sbrk(-8192) == 0xffffffffffffffffLL) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2298: 7579 lui a0,0xffffe
229a: 00003097 auipc ra,0x3
229e: 2ba080e7 jalr 698(ra) # 5554 <sbrk>
22a2: 57fd li a5,-1
22a4: 06f50763 beq a0,a5,2312 <rwsbrk+0x98>
<<<<<<< HEAD
22a8: 20100593 li a1,513
22ac: 00004517 auipc a0,0x4
22b0: 83450513 addi a0,a0,-1996 # 5ae0 <l_free+0x78>
22b4: 00003097 auipc ra,0x3
22b8: 258080e7 jalr 600(ra) # 550c <open>
22bc: 892a mv s2,a0
22be: 06054763 bltz a0,232c <rwsbrk+0xb2>
=======
fd = open("rwsbrk", O_CREATE | O_WRONLY);
22a8: 20100593 li a1,513
22ac: 00004517 auipc a0,0x4
22b0: 83450513 addi a0,a0,-1996 # 5ae0 <l_free+0x7a>
22b4: 00003097 auipc ra,0x3
22b8: 258080e7 jalr 600(ra) # 550c <open>
22bc: 892a mv s2,a0
if (fd < 0) {
22be: 06054763 bltz a0,232c <rwsbrk+0xb2>
n = write(fd, (void *)(a + 4096), 1024);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
22c2: 6505 lui a0,0x1
22c4: 94aa add s1,s1,a0
22c6: 40000613 li a2,1024
22ca: 85a6 mv a1,s1
22cc: 854a mv a0,s2
22ce: 00003097 auipc ra,0x3
22d2: 21e080e7 jalr 542(ra) # 54ec <write>
22d6: 862a mv a2,a0
<<<<<<< HEAD
22d8: 06054763 bltz a0,2346 <rwsbrk+0xcc>
22dc: 85a6 mv a1,s1
22de: 00004517 auipc a0,0x4
22e2: 6f250513 addi a0,a0,1778 # 69d0 <l_free+0xf68>
22e6: 00003097 auipc ra,0x3
22ea: 560080e7 jalr 1376(ra) # 5846 <printf>
22ee: 4505 li a0,1
22f0: 00003097 auipc ra,0x3
22f4: 1dc080e7 jalr 476(ra) # 54cc <exit>
22f8: 00004517 auipc a0,0x4
22fc: 68850513 addi a0,a0,1672 # 6980 <l_free+0xf18>
2300: 00003097 auipc ra,0x3
2304: 546080e7 jalr 1350(ra) # 5846 <printf>
2308: 4505 li a0,1
230a: 00003097 auipc ra,0x3
230e: 1c2080e7 jalr 450(ra) # 54cc <exit>
2312: 00004517 auipc a0,0x4
2316: 68650513 addi a0,a0,1670 # 6998 <l_free+0xf30>
231a: 00003097 auipc ra,0x3
231e: 52c080e7 jalr 1324(ra) # 5846 <printf>
2322: 4505 li a0,1
2324: 00003097 auipc ra,0x3
2328: 1a8080e7 jalr 424(ra) # 54cc <exit>
232c: 00004517 auipc a0,0x4
2330: 68c50513 addi a0,a0,1676 # 69b8 <l_free+0xf50>
2334: 00003097 auipc ra,0x3
2338: 512080e7 jalr 1298(ra) # 5846 <printf>
233c: 4505 li a0,1
233e: 00003097 auipc ra,0x3
2342: 18e080e7 jalr 398(ra) # 54cc <exit>
2346: 854a mv a0,s2
2348: 00003097 auipc ra,0x3
234c: 1ac080e7 jalr 428(ra) # 54f4 <close>
2350: 00003517 auipc a0,0x3
2354: 79050513 addi a0,a0,1936 # 5ae0 <l_free+0x78>
2358: 00003097 auipc ra,0x3
235c: 1c4080e7 jalr 452(ra) # 551c <unlink>
2360: 4581 li a1,0
2362: 00004517 auipc a0,0x4
2366: c1e50513 addi a0,a0,-994 # 5f80 <l_free+0x518>
236a: 00003097 auipc ra,0x3
236e: 1a2080e7 jalr 418(ra) # 550c <open>
2372: 892a mv s2,a0
2374: 02054963 bltz a0,23a6 <rwsbrk+0x12c>
=======
if (n >= 0) {
22d8: 06054763 bltz a0,2346 <rwsbrk+0xcc>
printf("write(fd, %p, 1024) returned %d, not -1\n", a + 4096, n);
22dc: 85a6 mv a1,s1
22de: 00004517 auipc a0,0x4
22e2: 6f250513 addi a0,a0,1778 # 69d0 <l_free+0xf6a>
22e6: 00003097 auipc ra,0x3
22ea: 55e080e7 jalr 1374(ra) # 5844 <printf>
exit(1);
22ee: 4505 li a0,1
22f0: 00003097 auipc ra,0x3
22f4: 1dc080e7 jalr 476(ra) # 54cc <exit>
printf("sbrk(rwsbrk) failed\n");
22f8: 00004517 auipc a0,0x4
22fc: 68850513 addi a0,a0,1672 # 6980 <l_free+0xf1a>
2300: 00003097 auipc ra,0x3
2304: 544080e7 jalr 1348(ra) # 5844 <printf>
exit(1);
2308: 4505 li a0,1
230a: 00003097 auipc ra,0x3
230e: 1c2080e7 jalr 450(ra) # 54cc <exit>
printf("sbrk(rwsbrk) shrink failed\n");
2312: 00004517 auipc a0,0x4
2316: 68650513 addi a0,a0,1670 # 6998 <l_free+0xf32>
231a: 00003097 auipc ra,0x3
231e: 52a080e7 jalr 1322(ra) # 5844 <printf>
exit(1);
2322: 4505 li a0,1
2324: 00003097 auipc ra,0x3
2328: 1a8080e7 jalr 424(ra) # 54cc <exit>
printf("open(rwsbrk) failed\n");
232c: 00004517 auipc a0,0x4
2330: 68c50513 addi a0,a0,1676 # 69b8 <l_free+0xf52>
2334: 00003097 auipc ra,0x3
2338: 510080e7 jalr 1296(ra) # 5844 <printf>
exit(1);
233c: 4505 li a0,1
233e: 00003097 auipc ra,0x3
2342: 18e080e7 jalr 398(ra) # 54cc <exit>
close(fd);
2346: 854a mv a0,s2
2348: 00003097 auipc ra,0x3
234c: 1ac080e7 jalr 428(ra) # 54f4 <close>
unlink("rwsbrk");
2350: 00003517 auipc a0,0x3
2354: 79050513 addi a0,a0,1936 # 5ae0 <l_free+0x7a>
2358: 00003097 auipc ra,0x3
235c: 1c4080e7 jalr 452(ra) # 551c <unlink>
fd = open("README", O_RDONLY);
2360: 4581 li a1,0
2362: 00004517 auipc a0,0x4
2366: c1e50513 addi a0,a0,-994 # 5f80 <l_free+0x51a>
236a: 00003097 auipc ra,0x3
236e: 1a2080e7 jalr 418(ra) # 550c <open>
2372: 892a mv s2,a0
if (fd < 0) {
2374: 02054963 bltz a0,23a6 <rwsbrk+0x12c>
n = read(fd, (void *)(a + 4096), 10);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2378: 4629 li a2,10
237a: 85a6 mv a1,s1
237c: 00003097 auipc ra,0x3
2380: 168080e7 jalr 360(ra) # 54e4 <read>
2384: 862a mv a2,a0
<<<<<<< HEAD
2386: 02054d63 bltz a0,23c0 <rwsbrk+0x146>
238a: 85a6 mv a1,s1
238c: 00004517 auipc a0,0x4
2390: 67450513 addi a0,a0,1652 # 6a00 <l_free+0xf98>
2394: 00003097 auipc ra,0x3
2398: 4b2080e7 jalr 1202(ra) # 5846 <printf>
239c: 4505 li a0,1
239e: 00003097 auipc ra,0x3
23a2: 12e080e7 jalr 302(ra) # 54cc <exit>
23a6: 00004517 auipc a0,0x4
23aa: 61250513 addi a0,a0,1554 # 69b8 <l_free+0xf50>
23ae: 00003097 auipc ra,0x3
23b2: 498080e7 jalr 1176(ra) # 5846 <printf>
23b6: 4505 li a0,1
23b8: 00003097 auipc ra,0x3
23bc: 114080e7 jalr 276(ra) # 54cc <exit>
23c0: 854a mv a0,s2
23c2: 00003097 auipc ra,0x3
23c6: 132080e7 jalr 306(ra) # 54f4 <close>
=======
if (n >= 0) {
2386: 02054d63 bltz a0,23c0 <rwsbrk+0x146>
printf("read(fd, %p, 10) returned %d, not -1\n", a + 4096, n);
238a: 85a6 mv a1,s1
238c: 00004517 auipc a0,0x4
2390: 67450513 addi a0,a0,1652 # 6a00 <l_free+0xf9a>
2394: 00003097 auipc ra,0x3
2398: 4b0080e7 jalr 1200(ra) # 5844 <printf>
exit(1);
239c: 4505 li a0,1
239e: 00003097 auipc ra,0x3
23a2: 12e080e7 jalr 302(ra) # 54cc <exit>
printf("open(rwsbrk) failed\n");
23a6: 00004517 auipc a0,0x4
23aa: 61250513 addi a0,a0,1554 # 69b8 <l_free+0xf52>
23ae: 00003097 auipc ra,0x3
23b2: 496080e7 jalr 1174(ra) # 5844 <printf>
exit(1);
23b6: 4505 li a0,1
23b8: 00003097 auipc ra,0x3
23bc: 114080e7 jalr 276(ra) # 54cc <exit>
close(fd);
23c0: 854a mv a0,s2
23c2: 00003097 auipc ra,0x3
23c6: 132080e7 jalr 306(ra) # 54f4 <close>
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
23ca: 4501 li a0,0
23cc: 00003097 auipc ra,0x3
23d0: 100080e7 jalr 256(ra) # 54cc <exit>
00000000000023d4 <sbrkmuch>:
<<<<<<< HEAD
=======
void sbrkmuch(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
23d4: 7179 addi sp,sp,-48
23d6: f406 sd ra,40(sp)
23d8: f022 sd s0,32(sp)
23da: ec26 sd s1,24(sp)
23dc: e84a sd s2,16(sp)
23de: e44e sd s3,8(sp)
23e0: e052 sd s4,0(sp)
23e2: 1800 addi s0,sp,48
23e4: 89aa mv s3,a0
<<<<<<< HEAD
=======
oldbrk = sbrk(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
23e6: 4501 li a0,0
23e8: 00003097 auipc ra,0x3
23ec: 16c080e7 jalr 364(ra) # 5554 <sbrk>
23f0: 892a mv s2,a0
<<<<<<< HEAD
=======
a = sbrk(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
23f2: 4501 li a0,0
23f4: 00003097 auipc ra,0x3
23f8: 160080e7 jalr 352(ra) # 5554 <sbrk>
23fc: 84aa mv s1,a0
<<<<<<< HEAD
=======
p = sbrk(amt);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
23fe: 06400537 lui a0,0x6400
2402: 9d05 subw a0,a0,s1
2404: 00003097 auipc ra,0x3
2408: 150080e7 jalr 336(ra) # 5554 <sbrk>
<<<<<<< HEAD
240c: 0ca49863 bne s1,a0,24dc <sbrkmuch+0x108>
=======
if (p != a) {
240c: 0ca49863 bne s1,a0,24dc <sbrkmuch+0x108>
char *eee = sbrk(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2410: 4501 li a0,0
2412: 00003097 auipc ra,0x3
2416: 142080e7 jalr 322(ra) # 5554 <sbrk>
241a: 87aa mv a5,a0
<<<<<<< HEAD
241c: 00a4f963 bgeu s1,a0,242e <sbrkmuch+0x5a>
2420: 4685 li a3,1
2422: 6705 lui a4,0x1
2424: 00d48023 sb a3,0(s1)
2428: 94ba add s1,s1,a4
242a: fef4ede3 bltu s1,a5,2424 <sbrkmuch+0x50>
242e: 064007b7 lui a5,0x6400
2432: 06300713 li a4,99
2436: fee78fa3 sb a4,-1(a5) # 63fffff <__BSS_END__+0x63f15df>
=======
for (char *pp = a; pp < eee; pp += 4096)
241c: 00a4f963 bgeu s1,a0,242e <sbrkmuch+0x5a>
*pp = 1;
2420: 4685 li a3,1
for (char *pp = a; pp < eee; pp += 4096)
2422: 6705 lui a4,0x1
*pp = 1;
2424: 00d48023 sb a3,0(s1)
for (char *pp = a; pp < eee; pp += 4096)
2428: 94ba add s1,s1,a4
242a: fef4ede3 bltu s1,a5,2424 <sbrkmuch+0x50>
*lastaddr = 99;
242e: 064007b7 lui a5,0x6400
2432: 06300713 li a4,99
2436: fee78fa3 sb a4,-1(a5) # 63fffff <__BSS_END__+0x63f1637>
a = sbrk(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
243a: 4501 li a0,0
243c: 00003097 auipc ra,0x3
2440: 118080e7 jalr 280(ra) # 5554 <sbrk>
2444: 84aa mv s1,a0
<<<<<<< HEAD
2446: 757d lui a0,0xfffff
2448: 00003097 auipc ra,0x3
244c: 10c080e7 jalr 268(ra) # 5554 <sbrk>
2450: 57fd li a5,-1
2452: 0af50363 beq a0,a5,24f8 <sbrkmuch+0x124>
2456: 4501 li a0,0
2458: 00003097 auipc ra,0x3
245c: 0fc080e7 jalr 252(ra) # 5554 <sbrk>
2460: 77fd lui a5,0xfffff
2462: 97a6 add a5,a5,s1
2464: 0af51863 bne a0,a5,2514 <sbrkmuch+0x140>
=======
c = sbrk(-PGSIZE);
2446: 757d lui a0,0xfffff
2448: 00003097 auipc ra,0x3
244c: 10c080e7 jalr 268(ra) # 5554 <sbrk>
if (c == (char *)0xffffffffffffffffL) {
2450: 57fd li a5,-1
2452: 0af50363 beq a0,a5,24f8 <sbrkmuch+0x124>
c = sbrk(0);
2456: 4501 li a0,0
2458: 00003097 auipc ra,0x3
245c: 0fc080e7 jalr 252(ra) # 5554 <sbrk>
if (c != a - PGSIZE) {
2460: 77fd lui a5,0xfffff
2462: 97a6 add a5,a5,s1
2464: 0af51863 bne a0,a5,2514 <sbrkmuch+0x140>
a = sbrk(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2468: 4501 li a0,0
246a: 00003097 auipc ra,0x3
246e: 0ea080e7 jalr 234(ra) # 5554 <sbrk>
2472: 84aa mv s1,a0
<<<<<<< HEAD
=======
c = sbrk(PGSIZE);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2474: 6505 lui a0,0x1
2476: 00003097 auipc ra,0x3
247a: 0de080e7 jalr 222(ra) # 5554 <sbrk>
247e: 8a2a mv s4,a0
<<<<<<< HEAD
=======
if (c != a || sbrk(0) != a + PGSIZE) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2480: 0aa49963 bne s1,a0,2532 <sbrkmuch+0x15e>
2484: 4501 li a0,0
2486: 00003097 auipc ra,0x3
248a: 0ce080e7 jalr 206(ra) # 5554 <sbrk>
248e: 6785 lui a5,0x1
2490: 97a6 add a5,a5,s1
2492: 0af51063 bne a0,a5,2532 <sbrkmuch+0x15e>
<<<<<<< HEAD
2496: 064007b7 lui a5,0x6400
249a: fff7c703 lbu a4,-1(a5) # 63fffff <__BSS_END__+0x63f15df>
249e: 06300793 li a5,99
24a2: 0af70763 beq a4,a5,2550 <sbrkmuch+0x17c>
=======
if (*lastaddr == 99) {
2496: 064007b7 lui a5,0x6400
249a: fff7c703 lbu a4,-1(a5) # 63fffff <__BSS_END__+0x63f1637>
249e: 06300793 li a5,99
24a2: 0af70763 beq a4,a5,2550 <sbrkmuch+0x17c>
a = sbrk(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
24a6: 4501 li a0,0
24a8: 00003097 auipc ra,0x3
24ac: 0ac080e7 jalr 172(ra) # 5554 <sbrk>
24b0: 84aa mv s1,a0
<<<<<<< HEAD
=======
c = sbrk(-(sbrk(0) - oldbrk));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
24b2: 4501 li a0,0
24b4: 00003097 auipc ra,0x3
24b8: 0a0080e7 jalr 160(ra) # 5554 <sbrk>
24bc: 40a9053b subw a0,s2,a0
24c0: 00003097 auipc ra,0x3
24c4: 094080e7 jalr 148(ra) # 5554 <sbrk>
<<<<<<< HEAD
24c8: 0aa49263 bne s1,a0,256c <sbrkmuch+0x198>
=======
if (c != a) {
24c8: 0aa49263 bne s1,a0,256c <sbrkmuch+0x198>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
24cc: 70a2 ld ra,40(sp)
24ce: 7402 ld s0,32(sp)
24d0: 64e2 ld s1,24(sp)
24d2: 6942 ld s2,16(sp)
24d4: 69a2 ld s3,8(sp)
24d6: 6a02 ld s4,0(sp)
24d8: 6145 addi sp,sp,48
24da: 8082 ret
<<<<<<< HEAD
24dc: 85ce mv a1,s3
24de: 00004517 auipc a0,0x4
24e2: 54a50513 addi a0,a0,1354 # 6a28 <l_free+0xfc0>
24e6: 00003097 auipc ra,0x3
24ea: 360080e7 jalr 864(ra) # 5846 <printf>
24ee: 4505 li a0,1
24f0: 00003097 auipc ra,0x3
24f4: fdc080e7 jalr -36(ra) # 54cc <exit>
24f8: 85ce mv a1,s3
24fa: 00004517 auipc a0,0x4
24fe: 57650513 addi a0,a0,1398 # 6a70 <l_free+0x1008>
2502: 00003097 auipc ra,0x3
2506: 344080e7 jalr 836(ra) # 5846 <printf>
250a: 4505 li a0,1
250c: 00003097 auipc ra,0x3
2510: fc0080e7 jalr -64(ra) # 54cc <exit>
2514: 862a mv a2,a0
2516: 85a6 mv a1,s1
2518: 00004517 auipc a0,0x4
251c: 57850513 addi a0,a0,1400 # 6a90 <l_free+0x1028>
2520: 00003097 auipc ra,0x3
2524: 326080e7 jalr 806(ra) # 5846 <printf>
2528: 4505 li a0,1
252a: 00003097 auipc ra,0x3
252e: fa2080e7 jalr -94(ra) # 54cc <exit>
2532: 8652 mv a2,s4
2534: 85a6 mv a1,s1
2536: 00004517 auipc a0,0x4
253a: 59a50513 addi a0,a0,1434 # 6ad0 <l_free+0x1068>
253e: 00003097 auipc ra,0x3
2542: 308080e7 jalr 776(ra) # 5846 <printf>
2546: 4505 li a0,1
2548: 00003097 auipc ra,0x3
254c: f84080e7 jalr -124(ra) # 54cc <exit>
2550: 85ce mv a1,s3
2552: 00004517 auipc a0,0x4
2556: 5ae50513 addi a0,a0,1454 # 6b00 <l_free+0x1098>
255a: 00003097 auipc ra,0x3
255e: 2ec080e7 jalr 748(ra) # 5846 <printf>
2562: 4505 li a0,1
2564: 00003097 auipc ra,0x3
2568: f68080e7 jalr -152(ra) # 54cc <exit>
256c: 862a mv a2,a0
256e: 85a6 mv a1,s1
2570: 00004517 auipc a0,0x4
2574: 5c850513 addi a0,a0,1480 # 6b38 <l_free+0x10d0>
2578: 00003097 auipc ra,0x3
257c: 2ce080e7 jalr 718(ra) # 5846 <printf>
=======
printf("%s: sbrk test failed to grow big address space; enough phys mem?\n",
24dc: 85ce mv a1,s3
24de: 00004517 auipc a0,0x4
24e2: 54a50513 addi a0,a0,1354 # 6a28 <l_free+0xfc2>
24e6: 00003097 auipc ra,0x3
24ea: 35e080e7 jalr 862(ra) # 5844 <printf>
exit(1);
24ee: 4505 li a0,1
24f0: 00003097 auipc ra,0x3
24f4: fdc080e7 jalr -36(ra) # 54cc <exit>
printf("%s: sbrk could not deallocate\n", s);
24f8: 85ce mv a1,s3
24fa: 00004517 auipc a0,0x4
24fe: 57650513 addi a0,a0,1398 # 6a70 <l_free+0x100a>
2502: 00003097 auipc ra,0x3
2506: 342080e7 jalr 834(ra) # 5844 <printf>
exit(1);
250a: 4505 li a0,1
250c: 00003097 auipc ra,0x3
2510: fc0080e7 jalr -64(ra) # 54cc <exit>
printf("%s: sbrk deallocation produced wrong address, a %x c %x\n", a, c);
2514: 862a mv a2,a0
2516: 85a6 mv a1,s1
2518: 00004517 auipc a0,0x4
251c: 57850513 addi a0,a0,1400 # 6a90 <l_free+0x102a>
2520: 00003097 auipc ra,0x3
2524: 324080e7 jalr 804(ra) # 5844 <printf>
exit(1);
2528: 4505 li a0,1
252a: 00003097 auipc ra,0x3
252e: fa2080e7 jalr -94(ra) # 54cc <exit>
printf("%s: sbrk re-allocation failed, a %x c %x\n", a, c);
2532: 8652 mv a2,s4
2534: 85a6 mv a1,s1
2536: 00004517 auipc a0,0x4
253a: 59a50513 addi a0,a0,1434 # 6ad0 <l_free+0x106a>
253e: 00003097 auipc ra,0x3
2542: 306080e7 jalr 774(ra) # 5844 <printf>
exit(1);
2546: 4505 li a0,1
2548: 00003097 auipc ra,0x3
254c: f84080e7 jalr -124(ra) # 54cc <exit>
printf("%s: sbrk de-allocation didn't really deallocate\n", s);
2550: 85ce mv a1,s3
2552: 00004517 auipc a0,0x4
2556: 5ae50513 addi a0,a0,1454 # 6b00 <l_free+0x109a>
255a: 00003097 auipc ra,0x3
255e: 2ea080e7 jalr 746(ra) # 5844 <printf>
exit(1);
2562: 4505 li a0,1
2564: 00003097 auipc ra,0x3
2568: f68080e7 jalr -152(ra) # 54cc <exit>
printf("%s: sbrk downsize failed, a %x c %x\n", a, c);
256c: 862a mv a2,a0
256e: 85a6 mv a1,s1
2570: 00004517 auipc a0,0x4
2574: 5c850513 addi a0,a0,1480 # 6b38 <l_free+0x10d2>
2578: 00003097 auipc ra,0x3
257c: 2cc080e7 jalr 716(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2580: 4505 li a0,1
2582: 00003097 auipc ra,0x3
2586: f4a080e7 jalr -182(ra) # 54cc <exit>
000000000000258a <sbrkarg>:
<<<<<<< HEAD
=======
void sbrkarg(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
258a: 7179 addi sp,sp,-48
258c: f406 sd ra,40(sp)
258e: f022 sd s0,32(sp)
2590: ec26 sd s1,24(sp)
2592: e84a sd s2,16(sp)
2594: e44e sd s3,8(sp)
2596: 1800 addi s0,sp,48
2598: 89aa mv s3,a0
<<<<<<< HEAD
=======
a = sbrk(PGSIZE);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
259a: 6505 lui a0,0x1
259c: 00003097 auipc ra,0x3
25a0: fb8080e7 jalr -72(ra) # 5554 <sbrk>
25a4: 892a mv s2,a0
<<<<<<< HEAD
25a6: 20100593 li a1,513
25aa: 00004517 auipc a0,0x4
25ae: 5b650513 addi a0,a0,1462 # 6b60 <l_free+0x10f8>
25b2: 00003097 auipc ra,0x3
25b6: f5a080e7 jalr -166(ra) # 550c <open>
25ba: 84aa mv s1,a0
25bc: 00004517 auipc a0,0x4
25c0: 5a450513 addi a0,a0,1444 # 6b60 <l_free+0x10f8>
25c4: 00003097 auipc ra,0x3
25c8: f58080e7 jalr -168(ra) # 551c <unlink>
25cc: 0404c163 bltz s1,260e <sbrkarg+0x84>
=======
fd = open("sbrk", O_CREATE | O_WRONLY);
25a6: 20100593 li a1,513
25aa: 00004517 auipc a0,0x4
25ae: 5b650513 addi a0,a0,1462 # 6b60 <l_free+0x10fa>
25b2: 00003097 auipc ra,0x3
25b6: f5a080e7 jalr -166(ra) # 550c <open>
25ba: 84aa mv s1,a0
unlink("sbrk");
25bc: 00004517 auipc a0,0x4
25c0: 5a450513 addi a0,a0,1444 # 6b60 <l_free+0x10fa>
25c4: 00003097 auipc ra,0x3
25c8: f58080e7 jalr -168(ra) # 551c <unlink>
if (fd < 0) {
25cc: 0404c163 bltz s1,260e <sbrkarg+0x84>
if ((n = write(fd, a, PGSIZE)) < 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
25d0: 6605 lui a2,0x1
25d2: 85ca mv a1,s2
25d4: 8526 mv a0,s1
25d6: 00003097 auipc ra,0x3
25da: f16080e7 jalr -234(ra) # 54ec <write>
25de: 04054663 bltz a0,262a <sbrkarg+0xa0>
<<<<<<< HEAD
25e2: 8526 mv a0,s1
25e4: 00003097 auipc ra,0x3
25e8: f10080e7 jalr -240(ra) # 54f4 <close>
25ec: 6505 lui a0,0x1
25ee: 00003097 auipc ra,0x3
25f2: f66080e7 jalr -154(ra) # 5554 <sbrk>
25f6: 00003097 auipc ra,0x3
25fa: ee6080e7 jalr -282(ra) # 54dc <pipe>
25fe: e521 bnez a0,2646 <sbrkarg+0xbc>
=======
close(fd);
25e2: 8526 mv a0,s1
25e4: 00003097 auipc ra,0x3
25e8: f10080e7 jalr -240(ra) # 54f4 <close>
a = sbrk(PGSIZE);
25ec: 6505 lui a0,0x1
25ee: 00003097 auipc ra,0x3
25f2: f66080e7 jalr -154(ra) # 5554 <sbrk>
if (pipe((int *)a) != 0) {
25f6: 00003097 auipc ra,0x3
25fa: ee6080e7 jalr -282(ra) # 54dc <pipe>
25fe: e521 bnez a0,2646 <sbrkarg+0xbc>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2600: 70a2 ld ra,40(sp)
2602: 7402 ld s0,32(sp)
2604: 64e2 ld s1,24(sp)
2606: 6942 ld s2,16(sp)
2608: 69a2 ld s3,8(sp)
260a: 6145 addi sp,sp,48
260c: 8082 ret
<<<<<<< HEAD
260e: 85ce mv a1,s3
2610: 00004517 auipc a0,0x4
2614: 55850513 addi a0,a0,1368 # 6b68 <l_free+0x1100>
2618: 00003097 auipc ra,0x3
261c: 22e080e7 jalr 558(ra) # 5846 <printf>
2620: 4505 li a0,1
2622: 00003097 auipc ra,0x3
2626: eaa080e7 jalr -342(ra) # 54cc <exit>
262a: 85ce mv a1,s3
262c: 00004517 auipc a0,0x4
2630: 55450513 addi a0,a0,1364 # 6b80 <l_free+0x1118>
2634: 00003097 auipc ra,0x3
2638: 212080e7 jalr 530(ra) # 5846 <printf>
263c: 4505 li a0,1
263e: 00003097 auipc ra,0x3
2642: e8e080e7 jalr -370(ra) # 54cc <exit>
2646: 85ce mv a1,s3
2648: 00004517 auipc a0,0x4
264c: ff050513 addi a0,a0,-16 # 6638 <l_free+0xbd0>
2650: 00003097 auipc ra,0x3
2654: 1f6080e7 jalr 502(ra) # 5846 <printf>
=======
printf("%s: open sbrk failed\n", s);
260e: 85ce mv a1,s3
2610: 00004517 auipc a0,0x4
2614: 55850513 addi a0,a0,1368 # 6b68 <l_free+0x1102>
2618: 00003097 auipc ra,0x3
261c: 22c080e7 jalr 556(ra) # 5844 <printf>
exit(1);
2620: 4505 li a0,1
2622: 00003097 auipc ra,0x3
2626: eaa080e7 jalr -342(ra) # 54cc <exit>
printf("%s: write sbrk failed\n", s);
262a: 85ce mv a1,s3
262c: 00004517 auipc a0,0x4
2630: 55450513 addi a0,a0,1364 # 6b80 <l_free+0x111a>
2634: 00003097 auipc ra,0x3
2638: 210080e7 jalr 528(ra) # 5844 <printf>
exit(1);
263c: 4505 li a0,1
263e: 00003097 auipc ra,0x3
2642: e8e080e7 jalr -370(ra) # 54cc <exit>
printf("%s: pipe() failed\n", s);
2646: 85ce mv a1,s3
2648: 00004517 auipc a0,0x4
264c: ff050513 addi a0,a0,-16 # 6638 <l_free+0xbd2>
2650: 00003097 auipc ra,0x3
2654: 1f4080e7 jalr 500(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2658: 4505 li a0,1
265a: 00003097 auipc ra,0x3
265e: e72080e7 jalr -398(ra) # 54cc <exit>
0000000000002662 <argptest>:
<<<<<<< HEAD
=======
void argptest(char *s) {
>>>>>>> <KEY>
2662: 1101 addi sp,sp,-32
2664: ec06 sd ra,24(sp)
2666: e822 sd s0,16(sp)
2668: e426 sd s1,8(sp)
266a: e04a sd s2,0(sp)
266c: 1000 addi s0,sp,32
266e: 892a mv s2,a0
<<<<<<< HEAD
2670: 4581 li a1,0
2672: 00004517 auipc a0,0x4
2676: 52650513 addi a0,a0,1318 # 6b98 <l_free+0x1130>
267a: 00003097 auipc ra,0x3
267e: e92080e7 jalr -366(ra) # 550c <open>
2682: 02054b63 bltz a0,26b8 <argptest+0x56>
2686: 84aa mv s1,a0
=======
fd = open("init", O_RDONLY);
2670: 4581 li a1,0
2672: 00004517 auipc a0,0x4
2676: 52650513 addi a0,a0,1318 # 6b98 <l_free+0x1132>
267a: 00003097 auipc ra,0x3
267e: e92080e7 jalr -366(ra) # 550c <open>
if (fd < 0) {
2682: 02054b63 bltz a0,26b8 <argptest+0x56>
2686: 84aa mv s1,a0
read(fd, sbrk(0) - 1, -1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2688: 4501 li a0,0
268a: 00003097 auipc ra,0x3
268e: eca080e7 jalr -310(ra) # 5554 <sbrk>
2692: 567d li a2,-1
2694: fff50593 addi a1,a0,-1
2698: 8526 mv a0,s1
269a: 00003097 auipc ra,0x3
269e: e4a080e7 jalr -438(ra) # 54e4 <read>
<<<<<<< HEAD
26a2: 8526 mv a0,s1
26a4: 00003097 auipc ra,0x3
26a8: e50080e7 jalr -432(ra) # 54f4 <close>
=======
close(fd);
26a2: 8526 mv a0,s1
26a4: 00003097 auipc ra,0x3
26a8: e50080e7 jalr -432(ra) # 54f4 <close>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
26ac: 60e2 ld ra,24(sp)
26ae: 6442 ld s0,16(sp)
26b0: 64a2 ld s1,8(sp)
26b2: 6902 ld s2,0(sp)
26b4: 6105 addi sp,sp,32
26b6: 8082 ret
<<<<<<< HEAD
26b8: 85ca mv a1,s2
26ba: 00004517 auipc a0,0x4
26be: e8e50513 addi a0,a0,-370 # 6548 <l_free+0xae0>
26c2: 00003097 auipc ra,0x3
26c6: 184080e7 jalr 388(ra) # 5846 <printf>
=======
printf("%s: open failed\n", s);
26b8: 85ca mv a1,s2
26ba: 00004517 auipc a0,0x4
26be: e8e50513 addi a0,a0,-370 # 6548 <l_free+0xae2>
26c2: 00003097 auipc ra,0x3
26c6: 182080e7 jalr 386(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
26ca: 4505 li a0,1
26cc: 00003097 auipc ra,0x3
26d0: e00080e7 jalr -512(ra) # 54cc <exit>
00000000000026d4 <sbrkbugs>:
<<<<<<< HEAD
=======
void sbrkbugs(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
26d4: 1141 addi sp,sp,-16
26d6: e406 sd ra,8(sp)
26d8: e022 sd s0,0(sp)
26da: 0800 addi s0,sp,16
<<<<<<< HEAD
26dc: 00003097 auipc ra,0x3
26e0: de8080e7 jalr -536(ra) # 54c4 <fork>
26e4: 02054263 bltz a0,2708 <sbrkbugs+0x34>
26e8: ed0d bnez a0,2722 <sbrkbugs+0x4e>
26ea: 00003097 auipc ra,0x3
26ee: e6a080e7 jalr -406(ra) # 5554 <sbrk>
26f2: 40a0053b negw a0,a0
26f6: 00003097 auipc ra,0x3
26fa: e5e080e7 jalr -418(ra) # 5554 <sbrk>
26fe: 4501 li a0,0
2700: 00003097 auipc ra,0x3
2704: dcc080e7 jalr -564(ra) # 54cc <exit>
2708: 00004517 auipc a0,0x4
270c: 21850513 addi a0,a0,536 # 6920 <l_free+0xeb8>
2710: 00003097 auipc ra,0x3
2714: 136080e7 jalr 310(ra) # 5846 <printf>
2718: 4505 li a0,1
271a: 00003097 auipc ra,0x3
271e: db2080e7 jalr -590(ra) # 54cc <exit>
2722: 4501 li a0,0
2724: 00003097 auipc ra,0x3
2728: db0080e7 jalr -592(ra) # 54d4 <wait>
272c: 00003097 auipc ra,0x3
2730: d98080e7 jalr -616(ra) # 54c4 <fork>
2734: 02054563 bltz a0,275e <sbrkbugs+0x8a>
2738: e121 bnez a0,2778 <sbrkbugs+0xa4>
273a: 00003097 auipc ra,0x3
273e: e1a080e7 jalr -486(ra) # 5554 <sbrk>
=======
int pid = fork();
26dc: 00003097 auipc ra,0x3
26e0: de8080e7 jalr -536(ra) # 54c4 <fork>
if (pid < 0) {
26e4: 02054263 bltz a0,2708 <sbrkbugs+0x34>
if (pid == 0) {
26e8: ed0d bnez a0,2722 <sbrkbugs+0x4e>
int sz = (uint64)sbrk(0);
26ea: 00003097 auipc ra,0x3
26ee: e6a080e7 jalr -406(ra) # 5554 <sbrk>
sbrk(-sz);
26f2: 40a0053b negw a0,a0
26f6: 00003097 auipc ra,0x3
26fa: e5e080e7 jalr -418(ra) # 5554 <sbrk>
exit(0);
26fe: 4501 li a0,0
2700: 00003097 auipc ra,0x3
2704: dcc080e7 jalr -564(ra) # 54cc <exit>
printf("fork failed\n");
2708: 00004517 auipc a0,0x4
270c: 21850513 addi a0,a0,536 # 6920 <l_free+0xeba>
2710: 00003097 auipc ra,0x3
2714: 134080e7 jalr 308(ra) # 5844 <printf>
exit(1);
2718: 4505 li a0,1
271a: 00003097 auipc ra,0x3
271e: db2080e7 jalr -590(ra) # 54cc <exit>
wait(0);
2722: 4501 li a0,0
2724: 00003097 auipc ra,0x3
2728: db0080e7 jalr -592(ra) # 54d4 <wait>
pid = fork();
272c: 00003097 auipc ra,0x3
2730: d98080e7 jalr -616(ra) # 54c4 <fork>
if (pid < 0) {
2734: 02054563 bltz a0,275e <sbrkbugs+0x8a>
if (pid == 0) {
2738: e121 bnez a0,2778 <sbrkbugs+0xa4>
int sz = (uint64)sbrk(0);
273a: 00003097 auipc ra,0x3
273e: e1a080e7 jalr -486(ra) # 5554 <sbrk>
sbrk(-(sz - 3500));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2742: 6785 lui a5,0x1
2744: dac7879b addiw a5,a5,-596
2748: 40a7853b subw a0,a5,a0
274c: 00003097 auipc ra,0x3
2750: e08080e7 jalr -504(ra) # 5554 <sbrk>
<<<<<<< HEAD
2754: 4501 li a0,0
2756: 00003097 auipc ra,0x3
275a: d76080e7 jalr -650(ra) # 54cc <exit>
275e: 00004517 auipc a0,0x4
2762: 1c250513 addi a0,a0,450 # 6920 <l_free+0xeb8>
2766: 00003097 auipc ra,0x3
276a: 0e0080e7 jalr 224(ra) # 5846 <printf>
276e: 4505 li a0,1
2770: 00003097 auipc ra,0x3
2774: d5c080e7 jalr -676(ra) # 54cc <exit>
2778: 4501 li a0,0
277a: 00003097 auipc ra,0x3
277e: d5a080e7 jalr -678(ra) # 54d4 <wait>
2782: 00003097 auipc ra,0x3
2786: d42080e7 jalr -702(ra) # 54c4 <fork>
278a: 02054a63 bltz a0,27be <sbrkbugs+0xea>
278e: e529 bnez a0,27d8 <sbrkbugs+0x104>
=======
exit(0);
2754: 4501 li a0,0
2756: 00003097 auipc ra,0x3
275a: d76080e7 jalr -650(ra) # 54cc <exit>
printf("fork failed\n");
275e: 00004517 auipc a0,0x4
2762: 1c250513 addi a0,a0,450 # 6920 <l_free+0xeba>
2766: 00003097 auipc ra,0x3
276a: 0de080e7 jalr 222(ra) # 5844 <printf>
exit(1);
276e: 4505 li a0,1
2770: 00003097 auipc ra,0x3
2774: d5c080e7 jalr -676(ra) # 54cc <exit>
wait(0);
2778: 4501 li a0,0
277a: 00003097 auipc ra,0x3
277e: d5a080e7 jalr -678(ra) # 54d4 <wait>
pid = fork();
2782: 00003097 auipc ra,0x3
2786: d42080e7 jalr -702(ra) # 54c4 <fork>
if (pid < 0) {
278a: 02054a63 bltz a0,27be <sbrkbugs+0xea>
if (pid == 0) {
278e: e529 bnez a0,27d8 <sbrkbugs+0x104>
sbrk((10 * 4096 + 2048) - (uint64)sbrk(0));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2790: 00003097 auipc ra,0x3
2794: dc4080e7 jalr -572(ra) # 5554 <sbrk>
2798: 67ad lui a5,0xb
279a: 8007879b addiw a5,a5,-2048
279e: 40a7853b subw a0,a5,a0
27a2: 00003097 auipc ra,0x3
27a6: db2080e7 jalr -590(ra) # 5554 <sbrk>
<<<<<<< HEAD
27aa: 5559 li a0,-10
27ac: 00003097 auipc ra,0x3
27b0: da8080e7 jalr -600(ra) # 5554 <sbrk>
27b4: 4501 li a0,0
27b6: 00003097 auipc ra,0x3
27ba: d16080e7 jalr -746(ra) # 54cc <exit>
27be: 00004517 auipc a0,0x4
27c2: 16250513 addi a0,a0,354 # 6920 <l_free+0xeb8>
27c6: 00003097 auipc ra,0x3
27ca: 080080e7 jalr 128(ra) # 5846 <printf>
27ce: 4505 li a0,1
27d0: 00003097 auipc ra,0x3
27d4: cfc080e7 jalr -772(ra) # 54cc <exit>
27d8: 4501 li a0,0
27da: 00003097 auipc ra,0x3
27de: cfa080e7 jalr -774(ra) # 54d4 <wait>
=======
sbrk(-10);
27aa: 5559 li a0,-10
27ac: 00003097 auipc ra,0x3
27b0: da8080e7 jalr -600(ra) # 5554 <sbrk>
exit(0);
27b4: 4501 li a0,0
27b6: 00003097 auipc ra,0x3
27ba: d16080e7 jalr -746(ra) # 54cc <exit>
printf("fork failed\n");
27be: 00004517 auipc a0,0x4
27c2: 16250513 addi a0,a0,354 # 6920 <l_free+0xeba>
27c6: 00003097 auipc ra,0x3
27ca: 07e080e7 jalr 126(ra) # 5844 <printf>
exit(1);
27ce: 4505 li a0,1
27d0: 00003097 auipc ra,0x3
27d4: cfc080e7 jalr -772(ra) # 54cc <exit>
wait(0);
27d8: 4501 li a0,0
27da: 00003097 auipc ra,0x3
27de: cfa080e7 jalr -774(ra) # 54d4 <wait>
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
27e2: 4501 li a0,0
27e4: 00003097 auipc ra,0x3
27e8: ce8080e7 jalr -792(ra) # 54cc <exit>
00000000000027ec <execout>:
<<<<<<< HEAD
=======
}
// test the exec() code that cleans up if it runs out
// of memory. it's really a test that such a condition
// doesn't cause a panic.
void execout(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
27ec: 715d addi sp,sp,-80
27ee: e486 sd ra,72(sp)
27f0: e0a2 sd s0,64(sp)
27f2: fc26 sd s1,56(sp)
27f4: f84a sd s2,48(sp)
27f6: f44e sd s3,40(sp)
27f8: f052 sd s4,32(sp)
27fa: 0880 addi s0,sp,80
<<<<<<< HEAD
27fc: 4901 li s2,0
27fe: 49bd li s3,15
2800: 00003097 auipc ra,0x3
2804: cc4080e7 jalr -828(ra) # 54c4 <fork>
2808: 84aa mv s1,a0
280a: 02054063 bltz a0,282a <execout+0x3e>
280e: c91d beqz a0,2844 <execout+0x58>
2810: 4501 li a0,0
2812: 00003097 auipc ra,0x3
2816: cc2080e7 jalr -830(ra) # 54d4 <wait>
281a: 2905 addiw s2,s2,1
281c: ff3912e3 bne s2,s3,2800 <execout+0x14>
2820: 4501 li a0,0
2822: 00003097 auipc ra,0x3
2826: caa080e7 jalr -854(ra) # 54cc <exit>
282a: 00004517 auipc a0,0x4
282e: 0f650513 addi a0,a0,246 # 6920 <l_free+0xeb8>
2832: 00003097 auipc ra,0x3
2836: 014080e7 jalr 20(ra) # 5846 <printf>
283a: 4505 li a0,1
283c: 00003097 auipc ra,0x3
2840: c90080e7 jalr -880(ra) # 54cc <exit>
2844: 59fd li s3,-1
2846: 4a05 li s4,1
2848: 6505 lui a0,0x1
284a: 00003097 auipc ra,0x3
284e: d0a080e7 jalr -758(ra) # 5554 <sbrk>
2852: 01350763 beq a0,s3,2860 <execout+0x74>
2856: 6785 lui a5,0x1
2858: 953e add a0,a0,a5
285a: ff450fa3 sb s4,-1(a0) # fff <bigdir+0x133>
285e: b7ed j 2848 <execout+0x5c>
2860: 01205a63 blez s2,2874 <execout+0x88>
2864: 757d lui a0,0xfffff
2866: 00003097 auipc ra,0x3
286a: cee080e7 jalr -786(ra) # 5554 <sbrk>
286e: 2485 addiw s1,s1,1
2870: ff249ae3 bne s1,s2,2864 <execout+0x78>
2874: 4505 li a0,1
2876: 00003097 auipc ra,0x3
287a: c7e080e7 jalr -898(ra) # 54f4 <close>
287e: 00003517 auipc a0,0x3
2882: 53a50513 addi a0,a0,1338 # 5db8 <l_free+0x350>
2886: faa43c23 sd a0,-72(s0)
288a: 00003797 auipc a5,0x3
288e: 59e78793 addi a5,a5,1438 # 5e28 <l_free+0x3c0>
2892: fcf43023 sd a5,-64(s0)
2896: fc043423 sd zero,-56(s0)
289a: fb840593 addi a1,s0,-72
289e: 00003097 auipc ra,0x3
28a2: c66080e7 jalr -922(ra) # 5504 <exec>
=======
for (int avail = 0; avail < 15; avail++) {
27fc: 4901 li s2,0
27fe: 49bd li s3,15
int pid = fork();
2800: 00003097 auipc ra,0x3
2804: cc4080e7 jalr -828(ra) # 54c4 <fork>
2808: 84aa mv s1,a0
if (pid < 0) {
280a: 02054063 bltz a0,282a <execout+0x3e>
printf("fork failed\n");
exit(1);
} else if (pid == 0) {
280e: c91d beqz a0,2844 <execout+0x58>
close(1);
char *args[] = {"echo", "x", 0};
exec("echo", args);
exit(0);
} else {
wait((int *)0);
2810: 4501 li a0,0
2812: 00003097 auipc ra,0x3
2816: cc2080e7 jalr -830(ra) # 54d4 <wait>
for (int avail = 0; avail < 15; avail++) {
281a: 2905 addiw s2,s2,1
281c: ff3912e3 bne s2,s3,2800 <execout+0x14>
}
}
exit(0);
2820: 4501 li a0,0
2822: 00003097 auipc ra,0x3
2826: caa080e7 jalr -854(ra) # 54cc <exit>
printf("fork failed\n");
282a: 00004517 auipc a0,0x4
282e: 0f650513 addi a0,a0,246 # 6920 <l_free+0xeba>
2832: 00003097 auipc ra,0x3
2836: 012080e7 jalr 18(ra) # 5844 <printf>
exit(1);
283a: 4505 li a0,1
283c: 00003097 auipc ra,0x3
2840: c90080e7 jalr -880(ra) # 54cc <exit>
if (a == 0xffffffffffffffffLL)
2844: 59fd li s3,-1
*(char *)(a + 4096 - 1) = 1;
2846: 4a05 li s4,1
uint64 a = (uint64)sbrk(4096);
2848: 6505 lui a0,0x1
284a: 00003097 auipc ra,0x3
284e: d0a080e7 jalr -758(ra) # 5554 <sbrk>
if (a == 0xffffffffffffffffLL)
2852: 01350763 beq a0,s3,2860 <execout+0x74>
*(char *)(a + 4096 - 1) = 1;
2856: 6785 lui a5,0x1
2858: 953e add a0,a0,a5
285a: ff450fa3 sb s4,-1(a0) # fff <bigdir+0x133>
while (1) {
285e: b7ed j 2848 <execout+0x5c>
for (int i = 0; i < avail; i++)
2860: 01205a63 blez s2,2874 <execout+0x88>
sbrk(-4096);
2864: 757d lui a0,0xfffff
2866: 00003097 auipc ra,0x3
286a: cee080e7 jalr -786(ra) # 5554 <sbrk>
for (int i = 0; i < avail; i++)
286e: 2485 addiw s1,s1,1
2870: ff249ae3 bne s1,s2,2864 <execout+0x78>
close(1);
2874: 4505 li a0,1
2876: 00003097 auipc ra,0x3
287a: c7e080e7 jalr -898(ra) # 54f4 <close>
char *args[] = {"echo", "x", 0};
287e: 00003517 auipc a0,0x3
2882: 53a50513 addi a0,a0,1338 # 5db8 <l_free+0x352>
2886: faa43c23 sd a0,-72(s0)
288a: 00003797 auipc a5,0x3
288e: 59e78793 addi a5,a5,1438 # 5e28 <l_free+0x3c2>
2892: fcf43023 sd a5,-64(s0)
2896: fc043423 sd zero,-56(s0)
exec("echo", args);
289a: fb840593 addi a1,s0,-72
289e: 00003097 auipc ra,0x3
28a2: c66080e7 jalr -922(ra) # 5504 <exec>
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
28a6: 4501 li a0,0
28a8: 00003097 auipc ra,0x3
28ac: c24080e7 jalr -988(ra) # 54cc <exit>
00000000000028b0 <fourteen>:
<<<<<<< HEAD
=======
void fourteen(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
28b0: 1101 addi sp,sp,-32
28b2: ec06 sd ra,24(sp)
28b4: e822 sd s0,16(sp)
28b6: e426 sd s1,8(sp)
28b8: 1000 addi s0,sp,32
28ba: 84aa mv s1,a0
<<<<<<< HEAD
28bc: 00004517 auipc a0,0x4
28c0: 4b450513 addi a0,a0,1204 # 6d70 <l_free+0x1308>
28c4: 00003097 auipc ra,0x3
28c8: c70080e7 jalr -912(ra) # 5534 <mkdir>
28cc: e165 bnez a0,29ac <fourteen+0xfc>
28ce: 00004517 auipc a0,0x4
28d2: 2fa50513 addi a0,a0,762 # 6bc8 <l_free+0x1160>
28d6: 00003097 auipc ra,0x3
28da: c5e080e7 jalr -930(ra) # 5534 <mkdir>
28de: e56d bnez a0,29c8 <fourteen+0x118>
28e0: 20000593 li a1,512
28e4: 00004517 auipc a0,0x4
28e8: 33c50513 addi a0,a0,828 # 6c20 <l_free+0x11b8>
28ec: 00003097 auipc ra,0x3
28f0: c20080e7 jalr -992(ra) # 550c <open>
28f4: 0e054863 bltz a0,29e4 <fourteen+0x134>
28f8: 00003097 auipc ra,0x3
28fc: bfc080e7 jalr -1028(ra) # 54f4 <close>
2900: 4581 li a1,0
2902: 00004517 auipc a0,0x4
2906: 39650513 addi a0,a0,918 # 6c98 <l_free+0x1230>
290a: 00003097 auipc ra,0x3
290e: c02080e7 jalr -1022(ra) # 550c <open>
2912: 0e054763 bltz a0,2a00 <fourteen+0x150>
2916: 00003097 auipc ra,0x3
291a: bde080e7 jalr -1058(ra) # 54f4 <close>
291e: 00004517 auipc a0,0x4
2922: 3ea50513 addi a0,a0,1002 # 6d08 <l_free+0x12a0>
2926: 00003097 auipc ra,0x3
292a: c0e080e7 jalr -1010(ra) # 5534 <mkdir>
292e: c57d beqz a0,2a1c <fourteen+0x16c>
2930: 00004517 auipc a0,0x4
2934: 43050513 addi a0,a0,1072 # 6d60 <l_free+0x12f8>
2938: 00003097 auipc ra,0x3
293c: bfc080e7 jalr -1028(ra) # 5534 <mkdir>
2940: cd65 beqz a0,2a38 <fourteen+0x188>
2942: 00004517 auipc a0,0x4
2946: 41e50513 addi a0,a0,1054 # 6d60 <l_free+0x12f8>
294a: 00003097 auipc ra,0x3
294e: bd2080e7 jalr -1070(ra) # 551c <unlink>
2952: 00004517 auipc a0,0x4
2956: 3b650513 addi a0,a0,950 # 6d08 <l_free+0x12a0>
295a: 00003097 auipc ra,0x3
295e: bc2080e7 jalr -1086(ra) # 551c <unlink>
2962: 00004517 auipc a0,0x4
2966: 33650513 addi a0,a0,822 # 6c98 <l_free+0x1230>
296a: 00003097 auipc ra,0x3
296e: bb2080e7 jalr -1102(ra) # 551c <unlink>
2972: 00004517 auipc a0,0x4
2976: 2ae50513 addi a0,a0,686 # 6c20 <l_free+0x11b8>
297a: 00003097 auipc ra,0x3
297e: ba2080e7 jalr -1118(ra) # 551c <unlink>
2982: 00004517 auipc a0,0x4
2986: 24650513 addi a0,a0,582 # 6bc8 <l_free+0x1160>
298a: 00003097 auipc ra,0x3
298e: b92080e7 jalr -1134(ra) # 551c <unlink>
2992: 00004517 auipc a0,0x4
2996: 3de50513 addi a0,a0,990 # 6d70 <l_free+0x1308>
299a: 00003097 auipc ra,0x3
299e: b82080e7 jalr -1150(ra) # 551c <unlink>
=======
if (mkdir("12345678901234") != 0) {
28bc: 00004517 auipc a0,0x4
28c0: 4b450513 addi a0,a0,1204 # 6d70 <l_free+0x130a>
28c4: 00003097 auipc ra,0x3
28c8: c70080e7 jalr -912(ra) # 5534 <mkdir>
28cc: e165 bnez a0,29ac <fourteen+0xfc>
if (mkdir("12345678901234/123456789012345") != 0) {
28ce: 00004517 auipc a0,0x4
28d2: 2fa50513 addi a0,a0,762 # 6bc8 <l_free+0x1162>
28d6: 00003097 auipc ra,0x3
28da: c5e080e7 jalr -930(ra) # 5534 <mkdir>
28de: e56d bnez a0,29c8 <fourteen+0x118>
fd = open("123456789012345/123456789012345/123456789012345", O_CREATE);
28e0: 20000593 li a1,512
28e4: 00004517 auipc a0,0x4
28e8: 33c50513 addi a0,a0,828 # 6c20 <l_free+0x11ba>
28ec: 00003097 auipc ra,0x3
28f0: c20080e7 jalr -992(ra) # 550c <open>
if (fd < 0) {
28f4: 0e054863 bltz a0,29e4 <fourteen+0x134>
close(fd);
28f8: 00003097 auipc ra,0x3
28fc: bfc080e7 jalr -1028(ra) # 54f4 <close>
fd = open("12345678901234/12345678901234/12345678901234", 0);
2900: 4581 li a1,0
2902: 00004517 auipc a0,0x4
2906: 39650513 addi a0,a0,918 # 6c98 <l_free+0x1232>
290a: 00003097 auipc ra,0x3
290e: c02080e7 jalr -1022(ra) # 550c <open>
if (fd < 0) {
2912: 0e054763 bltz a0,2a00 <fourteen+0x150>
close(fd);
2916: 00003097 auipc ra,0x3
291a: bde080e7 jalr -1058(ra) # 54f4 <close>
if (mkdir("12345678901234/12345678901234") == 0) {
291e: 00004517 auipc a0,0x4
2922: 3ea50513 addi a0,a0,1002 # 6d08 <l_free+0x12a2>
2926: 00003097 auipc ra,0x3
292a: c0e080e7 jalr -1010(ra) # 5534 <mkdir>
292e: c57d beqz a0,2a1c <fourteen+0x16c>
if (mkdir("123456789012345/12345678901234") == 0) {
2930: 00004517 auipc a0,0x4
2934: 43050513 addi a0,a0,1072 # 6d60 <l_free+0x12fa>
2938: 00003097 auipc ra,0x3
293c: bfc080e7 jalr -1028(ra) # 5534 <mkdir>
2940: cd65 beqz a0,2a38 <fourteen+0x188>
unlink("123456789012345/12345678901234");
2942: 00004517 auipc a0,0x4
2946: 41e50513 addi a0,a0,1054 # 6d60 <l_free+0x12fa>
294a: 00003097 auipc ra,0x3
294e: bd2080e7 jalr -1070(ra) # 551c <unlink>
unlink("12345678901234/12345678901234");
2952: 00004517 auipc a0,0x4
2956: 3b650513 addi a0,a0,950 # 6d08 <l_free+0x12a2>
295a: 00003097 auipc ra,0x3
295e: bc2080e7 jalr -1086(ra) # 551c <unlink>
unlink("12345678901234/12345678901234/12345678901234");
2962: 00004517 auipc a0,0x4
2966: 33650513 addi a0,a0,822 # 6c98 <l_free+0x1232>
296a: 00003097 auipc ra,0x3
296e: bb2080e7 jalr -1102(ra) # 551c <unlink>
unlink("123456789012345/123456789012345/123456789012345");
2972: 00004517 auipc a0,0x4
2976: 2ae50513 addi a0,a0,686 # 6c20 <l_free+0x11ba>
297a: 00003097 auipc ra,0x3
297e: ba2080e7 jalr -1118(ra) # 551c <unlink>
unlink("12345678901234/123456789012345");
2982: 00004517 auipc a0,0x4
2986: 24650513 addi a0,a0,582 # 6bc8 <l_free+0x1162>
298a: 00003097 auipc ra,0x3
298e: b92080e7 jalr -1134(ra) # 551c <unlink>
unlink("12345678901234");
2992: 00004517 auipc a0,0x4
2996: 3de50513 addi a0,a0,990 # 6d70 <l_free+0x130a>
299a: 00003097 auipc ra,0x3
299e: b82080e7 jalr -1150(ra) # 551c <unlink>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
29a2: 60e2 ld ra,24(sp)
29a4: 6442 ld s0,16(sp)
29a6: 64a2 ld s1,8(sp)
29a8: 6105 addi sp,sp,32
29aa: 8082 ret
<<<<<<< HEAD
29ac: 85a6 mv a1,s1
29ae: 00004517 auipc a0,0x4
29b2: 1f250513 addi a0,a0,498 # 6ba0 <l_free+0x1138>
29b6: 00003097 auipc ra,0x3
29ba: e90080e7 jalr -368(ra) # 5846 <printf>
29be: 4505 li a0,1
29c0: 00003097 auipc ra,0x3
29c4: b0c080e7 jalr -1268(ra) # 54cc <exit>
29c8: 85a6 mv a1,s1
29ca: 00004517 auipc a0,0x4
29ce: 21e50513 addi a0,a0,542 # 6be8 <l_free+0x1180>
29d2: 00003097 auipc ra,0x3
29d6: e74080e7 jalr -396(ra) # 5846 <printf>
29da: 4505 li a0,1
29dc: 00003097 auipc ra,0x3
29e0: af0080e7 jalr -1296(ra) # 54cc <exit>
29e4: 85a6 mv a1,s1
29e6: 00004517 auipc a0,0x4
29ea: 26a50513 addi a0,a0,618 # 6c50 <l_free+0x11e8>
29ee: 00003097 auipc ra,0x3
29f2: e58080e7 jalr -424(ra) # 5846 <printf>
29f6: 4505 li a0,1
29f8: 00003097 auipc ra,0x3
29fc: ad4080e7 jalr -1324(ra) # 54cc <exit>
2a00: 85a6 mv a1,s1
2a02: 00004517 auipc a0,0x4
2a06: 2c650513 addi a0,a0,710 # 6cc8 <l_free+0x1260>
2a0a: 00003097 auipc ra,0x3
2a0e: e3c080e7 jalr -452(ra) # 5846 <printf>
2a12: 4505 li a0,1
2a14: 00003097 auipc ra,0x3
2a18: ab8080e7 jalr -1352(ra) # 54cc <exit>
2a1c: 85a6 mv a1,s1
2a1e: 00004517 auipc a0,0x4
2a22: 30a50513 addi a0,a0,778 # 6d28 <l_free+0x12c0>
2a26: 00003097 auipc ra,0x3
2a2a: e20080e7 jalr -480(ra) # 5846 <printf>
2a2e: 4505 li a0,1
2a30: 00003097 auipc ra,0x3
2a34: a9c080e7 jalr -1380(ra) # 54cc <exit>
2a38: 85a6 mv a1,s1
2a3a: 00004517 auipc a0,0x4
2a3e: 34650513 addi a0,a0,838 # 6d80 <l_free+0x1318>
2a42: 00003097 auipc ra,0x3
2a46: e04080e7 jalr -508(ra) # 5846 <printf>
=======
printf("%s: mkdir 12345678901234 failed\n", s);
29ac: 85a6 mv a1,s1
29ae: 00004517 auipc a0,0x4
29b2: 1f250513 addi a0,a0,498 # 6ba0 <l_free+0x113a>
29b6: 00003097 auipc ra,0x3
29ba: e8e080e7 jalr -370(ra) # 5844 <printf>
exit(1);
29be: 4505 li a0,1
29c0: 00003097 auipc ra,0x3
29c4: b0c080e7 jalr -1268(ra) # 54cc <exit>
printf("%s: mkdir 12345678901234/123456789012345 failed\n", s);
29c8: 85a6 mv a1,s1
29ca: 00004517 auipc a0,0x4
29ce: 21e50513 addi a0,a0,542 # 6be8 <l_free+0x1182>
29d2: 00003097 auipc ra,0x3
29d6: e72080e7 jalr -398(ra) # 5844 <printf>
exit(1);
29da: 4505 li a0,1
29dc: 00003097 auipc ra,0x3
29e0: af0080e7 jalr -1296(ra) # 54cc <exit>
printf(
29e4: 85a6 mv a1,s1
29e6: 00004517 auipc a0,0x4
29ea: 26a50513 addi a0,a0,618 # 6c50 <l_free+0x11ea>
29ee: 00003097 auipc ra,0x3
29f2: e56080e7 jalr -426(ra) # 5844 <printf>
exit(1);
29f6: 4505 li a0,1
29f8: 00003097 auipc ra,0x3
29fc: ad4080e7 jalr -1324(ra) # 54cc <exit>
printf("%s: open 12345678901234/12345678901234/12345678901234 failed\n", s);
2a00: 85a6 mv a1,s1
2a02: 00004517 auipc a0,0x4
2a06: 2c650513 addi a0,a0,710 # 6cc8 <l_free+0x1262>
2a0a: 00003097 auipc ra,0x3
2a0e: e3a080e7 jalr -454(ra) # 5844 <printf>
exit(1);
2a12: 4505 li a0,1
2a14: 00003097 auipc ra,0x3
2a18: ab8080e7 jalr -1352(ra) # 54cc <exit>
printf("%s: mkdir 12345678901234/12345678901234 succeeded!\n", s);
2a1c: 85a6 mv a1,s1
2a1e: 00004517 auipc a0,0x4
2a22: 30a50513 addi a0,a0,778 # 6d28 <l_free+0x12c2>
2a26: 00003097 auipc ra,0x3
2a2a: e1e080e7 jalr -482(ra) # 5844 <printf>
exit(1);
2a2e: 4505 li a0,1
2a30: 00003097 auipc ra,0x3
2a34: a9c080e7 jalr -1380(ra) # 54cc <exit>
printf("%s: mkdir 12345678901234/123456789012345 succeeded!\n", s);
2a38: 85a6 mv a1,s1
2a3a: 00004517 auipc a0,0x4
2a3e: 34650513 addi a0,a0,838 # 6d80 <l_free+0x131a>
2a42: 00003097 auipc ra,0x3
2a46: e02080e7 jalr -510(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2a4a: 4505 li a0,1
2a4c: 00003097 auipc ra,0x3
2a50: a80080e7 jalr -1408(ra) # 54cc <exit>
0000000000002a54 <iputtest>:
<<<<<<< HEAD
=======
void iputtest(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2a54: 1101 addi sp,sp,-32
2a56: ec06 sd ra,24(sp)
2a58: e822 sd s0,16(sp)
2a5a: e426 sd s1,8(sp)
2a5c: 1000 addi s0,sp,32
2a5e: 84aa mv s1,a0
<<<<<<< HEAD
2a60: 00004517 auipc a0,0x4
2a64: 35850513 addi a0,a0,856 # 6db8 <l_free+0x1350>
2a68: 00003097 auipc ra,0x3
2a6c: acc080e7 jalr -1332(ra) # 5534 <mkdir>
2a70: 04054563 bltz a0,2aba <iputtest+0x66>
2a74: 00004517 auipc a0,0x4
2a78: 34450513 addi a0,a0,836 # 6db8 <l_free+0x1350>
2a7c: 00003097 auipc ra,0x3
2a80: ac0080e7 jalr -1344(ra) # 553c <chdir>
2a84: 04054963 bltz a0,2ad6 <iputtest+0x82>
2a88: 00004517 auipc a0,0x4
2a8c: 37050513 addi a0,a0,880 # 6df8 <l_free+0x1390>
2a90: 00003097 auipc ra,0x3
2a94: a8c080e7 jalr -1396(ra) # 551c <unlink>
2a98: 04054d63 bltz a0,2af2 <iputtest+0x9e>
2a9c: 00004517 auipc a0,0x4
2aa0: 38c50513 addi a0,a0,908 # 6e28 <l_free+0x13c0>
2aa4: 00003097 auipc ra,0x3
2aa8: a98080e7 jalr -1384(ra) # 553c <chdir>
2aac: 06054163 bltz a0,2b0e <iputtest+0xba>
=======
if (mkdir("iputdir") < 0) {
2a60: 00004517 auipc a0,0x4
2a64: 35850513 addi a0,a0,856 # 6db8 <l_free+0x1352>
2a68: 00003097 auipc ra,0x3
2a6c: acc080e7 jalr -1332(ra) # 5534 <mkdir>
2a70: 04054563 bltz a0,2aba <iputtest+0x66>
if (chdir("iputdir") < 0) {
2a74: 00004517 auipc a0,0x4
2a78: 34450513 addi a0,a0,836 # 6db8 <l_free+0x1352>
2a7c: 00003097 auipc ra,0x3
2a80: ac0080e7 jalr -1344(ra) # 553c <chdir>
2a84: 04054963 bltz a0,2ad6 <iputtest+0x82>
if (unlink("../iputdir") < 0) {
2a88: 00004517 auipc a0,0x4
2a8c: 37050513 addi a0,a0,880 # 6df8 <l_free+0x1392>
2a90: 00003097 auipc ra,0x3
2a94: a8c080e7 jalr -1396(ra) # 551c <unlink>
2a98: 04054d63 bltz a0,2af2 <iputtest+0x9e>
if (chdir("/") < 0) {
2a9c: 00004517 auipc a0,0x4
2aa0: 38c50513 addi a0,a0,908 # 6e28 <l_free+0x13c2>
2aa4: 00003097 auipc ra,0x3
2aa8: a98080e7 jalr -1384(ra) # 553c <chdir>
2aac: 06054163 bltz a0,2b0e <iputtest+0xba>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2ab0: 60e2 ld ra,24(sp)
2ab2: 6442 ld s0,16(sp)
2ab4: 64a2 ld s1,8(sp)
2ab6: 6105 addi sp,sp,32
2ab8: 8082 ret
<<<<<<< HEAD
2aba: 85a6 mv a1,s1
2abc: 00004517 auipc a0,0x4
2ac0: 30450513 addi a0,a0,772 # 6dc0 <l_free+0x1358>
2ac4: 00003097 auipc ra,0x3
2ac8: d82080e7 jalr -638(ra) # 5846 <printf>
2acc: 4505 li a0,1
2ace: 00003097 auipc ra,0x3
2ad2: 9fe080e7 jalr -1538(ra) # 54cc <exit>
2ad6: 85a6 mv a1,s1
2ad8: 00004517 auipc a0,0x4
2adc: 30050513 addi a0,a0,768 # 6dd8 <l_free+0x1370>
2ae0: 00003097 auipc ra,0x3
2ae4: d66080e7 jalr -666(ra) # 5846 <printf>
2ae8: 4505 li a0,1
2aea: 00003097 auipc ra,0x3
2aee: 9e2080e7 jalr -1566(ra) # 54cc <exit>
2af2: 85a6 mv a1,s1
2af4: 00004517 auipc a0,0x4
2af8: 31450513 addi a0,a0,788 # 6e08 <l_free+0x13a0>
2afc: 00003097 auipc ra,0x3
2b00: d4a080e7 jalr -694(ra) # 5846 <printf>
2b04: 4505 li a0,1
2b06: 00003097 auipc ra,0x3
2b0a: 9c6080e7 jalr -1594(ra) # 54cc <exit>
2b0e: 85a6 mv a1,s1
2b10: 00004517 auipc a0,0x4
2b14: 32050513 addi a0,a0,800 # 6e30 <l_free+0x13c8>
2b18: 00003097 auipc ra,0x3
2b1c: d2e080e7 jalr -722(ra) # 5846 <printf>
=======
printf("%s: mkdir failed\n", s);
2aba: 85a6 mv a1,s1
2abc: 00004517 auipc a0,0x4
2ac0: 30450513 addi a0,a0,772 # 6dc0 <l_free+0x135a>
2ac4: 00003097 auipc ra,0x3
2ac8: d80080e7 jalr -640(ra) # 5844 <printf>
exit(1);
2acc: 4505 li a0,1
2ace: 00003097 auipc ra,0x3
2ad2: 9fe080e7 jalr -1538(ra) # 54cc <exit>
printf("%s: chdir iputdir failed\n", s);
2ad6: 85a6 mv a1,s1
2ad8: 00004517 auipc a0,0x4
2adc: 30050513 addi a0,a0,768 # 6dd8 <l_free+0x1372>
2ae0: 00003097 auipc ra,0x3
2ae4: d64080e7 jalr -668(ra) # 5844 <printf>
exit(1);
2ae8: 4505 li a0,1
2aea: 00003097 auipc ra,0x3
2aee: 9e2080e7 jalr -1566(ra) # 54cc <exit>
printf("%s: unlink ../iputdir failed\n", s);
2af2: 85a6 mv a1,s1
2af4: 00004517 auipc a0,0x4
2af8: 31450513 addi a0,a0,788 # 6e08 <l_free+0x13a2>
2afc: 00003097 auipc ra,0x3
2b00: d48080e7 jalr -696(ra) # 5844 <printf>
exit(1);
2b04: 4505 li a0,1
2b06: 00003097 auipc ra,0x3
2b0a: 9c6080e7 jalr -1594(ra) # 54cc <exit>
printf("%s: chdir / failed\n", s);
2b0e: 85a6 mv a1,s1
2b10: 00004517 auipc a0,0x4
2b14: 32050513 addi a0,a0,800 # 6e30 <l_free+0x13ca>
2b18: 00003097 auipc ra,0x3
2b1c: d2c080e7 jalr -724(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2b20: 4505 li a0,1
2b22: 00003097 auipc ra,0x3
2b26: 9aa080e7 jalr -1622(ra) # 54cc <exit>
0000000000002b2a <exitiputtest>:
<<<<<<< HEAD
=======
void exitiputtest(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2b2a: 7179 addi sp,sp,-48
2b2c: f406 sd ra,40(sp)
2b2e: f022 sd s0,32(sp)
2b30: ec26 sd s1,24(sp)
2b32: 1800 addi s0,sp,48
2b34: 84aa mv s1,a0
<<<<<<< HEAD
2b36: 00003097 auipc ra,0x3
2b3a: 98e080e7 jalr -1650(ra) # 54c4 <fork>
2b3e: 04054663 bltz a0,2b8a <exitiputtest+0x60>
2b42: ed45 bnez a0,2bfa <exitiputtest+0xd0>
2b44: 00004517 auipc a0,0x4
2b48: 27450513 addi a0,a0,628 # 6db8 <l_free+0x1350>
2b4c: 00003097 auipc ra,0x3
2b50: 9e8080e7 jalr -1560(ra) # 5534 <mkdir>
2b54: 04054963 bltz a0,2ba6 <exitiputtest+0x7c>
2b58: 00004517 auipc a0,0x4
2b5c: 26050513 addi a0,a0,608 # 6db8 <l_free+0x1350>
2b60: 00003097 auipc ra,0x3
2b64: 9dc080e7 jalr -1572(ra) # 553c <chdir>
2b68: 04054d63 bltz a0,2bc2 <exitiputtest+0x98>
2b6c: 00004517 auipc a0,0x4
2b70: 28c50513 addi a0,a0,652 # 6df8 <l_free+0x1390>
2b74: 00003097 auipc ra,0x3
2b78: 9a8080e7 jalr -1624(ra) # 551c <unlink>
2b7c: 06054163 bltz a0,2bde <exitiputtest+0xb4>
2b80: 4501 li a0,0
2b82: 00003097 auipc ra,0x3
2b86: 94a080e7 jalr -1718(ra) # 54cc <exit>
2b8a: 85a6 mv a1,s1
2b8c: 00004517 auipc a0,0x4
2b90: 9a450513 addi a0,a0,-1628 # 6530 <l_free+0xac8>
2b94: 00003097 auipc ra,0x3
2b98: cb2080e7 jalr -846(ra) # 5846 <printf>
2b9c: 4505 li a0,1
2b9e: 00003097 auipc ra,0x3
2ba2: 92e080e7 jalr -1746(ra) # 54cc <exit>
2ba6: 85a6 mv a1,s1
2ba8: 00004517 auipc a0,0x4
2bac: 21850513 addi a0,a0,536 # 6dc0 <l_free+0x1358>
2bb0: 00003097 auipc ra,0x3
2bb4: c96080e7 jalr -874(ra) # 5846 <printf>
2bb8: 4505 li a0,1
2bba: 00003097 auipc ra,0x3
2bbe: 912080e7 jalr -1774(ra) # 54cc <exit>
2bc2: 85a6 mv a1,s1
2bc4: 00004517 auipc a0,0x4
2bc8: 28450513 addi a0,a0,644 # 6e48 <l_free+0x13e0>
2bcc: 00003097 auipc ra,0x3
2bd0: c7a080e7 jalr -902(ra) # 5846 <printf>
2bd4: 4505 li a0,1
2bd6: 00003097 auipc ra,0x3
2bda: 8f6080e7 jalr -1802(ra) # 54cc <exit>
2bde: 85a6 mv a1,s1
2be0: 00004517 auipc a0,0x4
2be4: 22850513 addi a0,a0,552 # 6e08 <l_free+0x13a0>
2be8: 00003097 auipc ra,0x3
2bec: c5e080e7 jalr -930(ra) # 5846 <printf>
2bf0: 4505 li a0,1
2bf2: 00003097 auipc ra,0x3
2bf6: 8da080e7 jalr -1830(ra) # 54cc <exit>
2bfa: fdc40513 addi a0,s0,-36
2bfe: 00003097 auipc ra,0x3
2c02: 8d6080e7 jalr -1834(ra) # 54d4 <wait>
=======
pid = fork();
2b36: 00003097 auipc ra,0x3
2b3a: 98e080e7 jalr -1650(ra) # 54c4 <fork>
if (pid < 0) {
2b3e: 04054663 bltz a0,2b8a <exitiputtest+0x60>
if (pid == 0) {
2b42: ed45 bnez a0,2bfa <exitiputtest+0xd0>
if (mkdir("iputdir") < 0) {
2b44: 00004517 auipc a0,0x4
2b48: 27450513 addi a0,a0,628 # 6db8 <l_free+0x1352>
2b4c: 00003097 auipc ra,0x3
2b50: 9e8080e7 jalr -1560(ra) # 5534 <mkdir>
2b54: 04054963 bltz a0,2ba6 <exitiputtest+0x7c>
if (chdir("iputdir") < 0) {
2b58: 00004517 auipc a0,0x4
2b5c: 26050513 addi a0,a0,608 # 6db8 <l_free+0x1352>
2b60: 00003097 auipc ra,0x3
2b64: 9dc080e7 jalr -1572(ra) # 553c <chdir>
2b68: 04054d63 bltz a0,2bc2 <exitiputtest+0x98>
if (unlink("../iputdir") < 0) {
2b6c: 00004517 auipc a0,0x4
2b70: 28c50513 addi a0,a0,652 # 6df8 <l_free+0x1392>
2b74: 00003097 auipc ra,0x3
2b78: 9a8080e7 jalr -1624(ra) # 551c <unlink>
2b7c: 06054163 bltz a0,2bde <exitiputtest+0xb4>
exit(0);
2b80: 4501 li a0,0
2b82: 00003097 auipc ra,0x3
2b86: 94a080e7 jalr -1718(ra) # 54cc <exit>
printf("%s: fork failed\n", s);
2b8a: 85a6 mv a1,s1
2b8c: 00004517 auipc a0,0x4
2b90: 9a450513 addi a0,a0,-1628 # 6530 <l_free+0xaca>
2b94: 00003097 auipc ra,0x3
2b98: cb0080e7 jalr -848(ra) # 5844 <printf>
exit(1);
2b9c: 4505 li a0,1
2b9e: 00003097 auipc ra,0x3
2ba2: 92e080e7 jalr -1746(ra) # 54cc <exit>
printf("%s: mkdir failed\n", s);
2ba6: 85a6 mv a1,s1
2ba8: 00004517 auipc a0,0x4
2bac: 21850513 addi a0,a0,536 # 6dc0 <l_free+0x135a>
2bb0: 00003097 auipc ra,0x3
2bb4: c94080e7 jalr -876(ra) # 5844 <printf>
exit(1);
2bb8: 4505 li a0,1
2bba: 00003097 auipc ra,0x3
2bbe: 912080e7 jalr -1774(ra) # 54cc <exit>
printf("%s: child chdir failed\n", s);
2bc2: 85a6 mv a1,s1
2bc4: 00004517 auipc a0,0x4
2bc8: 28450513 addi a0,a0,644 # 6e48 <l_free+0x13e2>
2bcc: 00003097 auipc ra,0x3
2bd0: c78080e7 jalr -904(ra) # 5844 <printf>
exit(1);
2bd4: 4505 li a0,1
2bd6: 00003097 auipc ra,0x3
2bda: 8f6080e7 jalr -1802(ra) # 54cc <exit>
printf("%s: unlink ../iputdir failed\n", s);
2bde: 85a6 mv a1,s1
2be0: 00004517 auipc a0,0x4
2be4: 22850513 addi a0,a0,552 # 6e08 <l_free+0x13a2>
2be8: 00003097 auipc ra,0x3
2bec: c5c080e7 jalr -932(ra) # 5844 <printf>
exit(1);
2bf0: 4505 li a0,1
2bf2: 00003097 auipc ra,0x3
2bf6: 8da080e7 jalr -1830(ra) # 54cc <exit>
wait(&xstatus);
2bfa: fdc40513 addi a0,s0,-36
2bfe: 00003097 auipc ra,0x3
2c02: 8d6080e7 jalr -1834(ra) # 54d4 <wait>
exit(xstatus);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2c06: fdc42503 lw a0,-36(s0)
2c0a: 00003097 auipc ra,0x3
2c0e: 8c2080e7 jalr -1854(ra) # 54cc <exit>
0000000000002c12 <subdir>:
<<<<<<< HEAD
=======
void subdir(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2c12: 1101 addi sp,sp,-32
2c14: ec06 sd ra,24(sp)
2c16: e822 sd s0,16(sp)
2c18: e426 sd s1,8(sp)
2c1a: e04a sd s2,0(sp)
2c1c: 1000 addi s0,sp,32
2c1e: 892a mv s2,a0
<<<<<<< HEAD
2c20: 00004517 auipc a0,0x4
2c24: 37050513 addi a0,a0,880 # 6f90 <l_free+0x1528>
2c28: 00003097 auipc ra,0x3
2c2c: 8f4080e7 jalr -1804(ra) # 551c <unlink>
2c30: 00004517 auipc a0,0x4
2c34: 23050513 addi a0,a0,560 # 6e60 <l_free+0x13f8>
2c38: 00003097 auipc ra,0x3
2c3c: 8fc080e7 jalr -1796(ra) # 5534 <mkdir>
2c40: 38051663 bnez a0,2fcc <subdir+0x3ba>
2c44: 20200593 li a1,514
2c48: 00004517 auipc a0,0x4
2c4c: 23850513 addi a0,a0,568 # 6e80 <l_free+0x1418>
2c50: 00003097 auipc ra,0x3
2c54: 8bc080e7 jalr -1860(ra) # 550c <open>
2c58: 84aa mv s1,a0
2c5a: 38054763 bltz a0,2fe8 <subdir+0x3d6>
2c5e: 4609 li a2,2
2c60: 00004597 auipc a1,0x4
2c64: 33058593 addi a1,a1,816 # 6f90 <l_free+0x1528>
2c68: 00003097 auipc ra,0x3
2c6c: 884080e7 jalr -1916(ra) # 54ec <write>
2c70: 8526 mv a0,s1
2c72: 00003097 auipc ra,0x3
2c76: 882080e7 jalr -1918(ra) # 54f4 <close>
2c7a: 00004517 auipc a0,0x4
2c7e: 1e650513 addi a0,a0,486 # 6e60 <l_free+0x13f8>
2c82: 00003097 auipc ra,0x3
2c86: 89a080e7 jalr -1894(ra) # 551c <unlink>
2c8a: 36055d63 bgez a0,3004 <subdir+0x3f2>
2c8e: 00004517 auipc a0,0x4
2c92: 24a50513 addi a0,a0,586 # 6ed8 <l_free+0x1470>
2c96: 00003097 auipc ra,0x3
2c9a: 89e080e7 jalr -1890(ra) # 5534 <mkdir>
2c9e: 38051163 bnez a0,3020 <subdir+0x40e>
2ca2: 20200593 li a1,514
2ca6: 00004517 auipc a0,0x4
2caa: 25a50513 addi a0,a0,602 # 6f00 <l_free+0x1498>
2cae: 00003097 auipc ra,0x3
2cb2: 85e080e7 jalr -1954(ra) # 550c <open>
2cb6: 84aa mv s1,a0
2cb8: 38054263 bltz a0,303c <subdir+0x42a>
2cbc: 4609 li a2,2
2cbe: 00004597 auipc a1,0x4
2cc2: 27258593 addi a1,a1,626 # 6f30 <l_free+0x14c8>
2cc6: 00003097 auipc ra,0x3
2cca: 826080e7 jalr -2010(ra) # 54ec <write>
2cce: 8526 mv a0,s1
2cd0: 00003097 auipc ra,0x3
2cd4: 824080e7 jalr -2012(ra) # 54f4 <close>
2cd8: 4581 li a1,0
2cda: 00004517 auipc a0,0x4
2cde: 25e50513 addi a0,a0,606 # 6f38 <l_free+0x14d0>
2ce2: 00003097 auipc ra,0x3
2ce6: 82a080e7 jalr -2006(ra) # 550c <open>
2cea: 84aa mv s1,a0
2cec: 36054663 bltz a0,3058 <subdir+0x446>
2cf0: 660d lui a2,0x3
2cf2: 00009597 auipc a1,0x9
2cf6: d1e58593 addi a1,a1,-738 # ba10 <buf>
2cfa: 00002097 auipc ra,0x2
2cfe: 7ea080e7 jalr 2026(ra) # 54e4 <read>
2d02: 4789 li a5,2
2d04: 36f51863 bne a0,a5,3074 <subdir+0x462>
2d08: 00009717 auipc a4,0x9
2d0c: d0874703 lbu a4,-760(a4) # ba10 <buf>
2d10: 06600793 li a5,102
2d14: 36f71063 bne a4,a5,3074 <subdir+0x462>
2d18: 8526 mv a0,s1
2d1a: 00002097 auipc ra,0x2
2d1e: 7da080e7 jalr 2010(ra) # 54f4 <close>
2d22: 00004597 auipc a1,0x4
2d26: 26658593 addi a1,a1,614 # 6f88 <l_free+0x1520>
2d2a: 00004517 auipc a0,0x4
2d2e: 1d650513 addi a0,a0,470 # 6f00 <l_free+0x1498>
2d32: 00002097 auipc ra,0x2
2d36: 7fa080e7 jalr 2042(ra) # 552c <link>
2d3a: 34051b63 bnez a0,3090 <subdir+0x47e>
2d3e: 00004517 auipc a0,0x4
2d42: 1c250513 addi a0,a0,450 # 6f00 <l_free+0x1498>
2d46: 00002097 auipc ra,0x2
2d4a: 7d6080e7 jalr 2006(ra) # 551c <unlink>
2d4e: 34051f63 bnez a0,30ac <subdir+0x49a>
2d52: 4581 li a1,0
2d54: 00004517 auipc a0,0x4
2d58: 1ac50513 addi a0,a0,428 # 6f00 <l_free+0x1498>
2d5c: 00002097 auipc ra,0x2
2d60: 7b0080e7 jalr 1968(ra) # 550c <open>
2d64: 36055263 bgez a0,30c8 <subdir+0x4b6>
2d68: 00004517 auipc a0,0x4
2d6c: 0f850513 addi a0,a0,248 # 6e60 <l_free+0x13f8>
2d70: 00002097 auipc ra,0x2
2d74: 7cc080e7 jalr 1996(ra) # 553c <chdir>
2d78: 36051663 bnez a0,30e4 <subdir+0x4d2>
2d7c: 00004517 auipc a0,0x4
2d80: 2a450513 addi a0,a0,676 # 7020 <l_free+0x15b8>
2d84: 00002097 auipc ra,0x2
2d88: 7b8080e7 jalr 1976(ra) # 553c <chdir>
2d8c: 36051a63 bnez a0,3100 <subdir+0x4ee>
2d90: 00004517 auipc a0,0x4
2d94: 2c050513 addi a0,a0,704 # 7050 <l_free+0x15e8>
2d98: 00002097 auipc ra,0x2
2d9c: 7a4080e7 jalr 1956(ra) # 553c <chdir>
2da0: 36051e63 bnez a0,311c <subdir+0x50a>
2da4: 00004517 auipc a0,0x4
2da8: 2dc50513 addi a0,a0,732 # 7080 <l_free+0x1618>
2dac: 00002097 auipc ra,0x2
2db0: 790080e7 jalr 1936(ra) # 553c <chdir>
2db4: 38051263 bnez a0,3138 <subdir+0x526>
2db8: 4581 li a1,0
2dba: 00004517 auipc a0,0x4
2dbe: 1ce50513 addi a0,a0,462 # 6f88 <l_free+0x1520>
2dc2: 00002097 auipc ra,0x2
2dc6: 74a080e7 jalr 1866(ra) # 550c <open>
2dca: 84aa mv s1,a0
2dcc: 38054463 bltz a0,3154 <subdir+0x542>
2dd0: 660d lui a2,0x3
2dd2: 00009597 auipc a1,0x9
2dd6: c3e58593 addi a1,a1,-962 # ba10 <buf>
=======
unlink("ff");
2c20: 00004517 auipc a0,0x4
2c24: 37050513 addi a0,a0,880 # 6f90 <l_free+0x152a>
2c28: 00003097 auipc ra,0x3
2c2c: 8f4080e7 jalr -1804(ra) # 551c <unlink>
if (mkdir("dd") != 0) {
2c30: 00004517 auipc a0,0x4
2c34: 23050513 addi a0,a0,560 # 6e60 <l_free+0x13fa>
2c38: 00003097 auipc ra,0x3
2c3c: 8fc080e7 jalr -1796(ra) # 5534 <mkdir>
2c40: 38051663 bnez a0,2fcc <subdir+0x3ba>
fd = open("dd/ff", O_CREATE | O_RDWR);
2c44: 20200593 li a1,514
2c48: 00004517 auipc a0,0x4
2c4c: 23850513 addi a0,a0,568 # 6e80 <l_free+0x141a>
2c50: 00003097 auipc ra,0x3
2c54: 8bc080e7 jalr -1860(ra) # 550c <open>
2c58: 84aa mv s1,a0
if (fd < 0) {
2c5a: 38054763 bltz a0,2fe8 <subdir+0x3d6>
write(fd, "ff", 2);
2c5e: 4609 li a2,2
2c60: 00004597 auipc a1,0x4
2c64: 33058593 addi a1,a1,816 # 6f90 <l_free+0x152a>
2c68: 00003097 auipc ra,0x3
2c6c: 884080e7 jalr -1916(ra) # 54ec <write>
close(fd);
2c70: 8526 mv a0,s1
2c72: 00003097 auipc ra,0x3
2c76: 882080e7 jalr -1918(ra) # 54f4 <close>
if (unlink("dd") >= 0) {
2c7a: 00004517 auipc a0,0x4
2c7e: 1e650513 addi a0,a0,486 # 6e60 <l_free+0x13fa>
2c82: 00003097 auipc ra,0x3
2c86: 89a080e7 jalr -1894(ra) # 551c <unlink>
2c8a: 36055d63 bgez a0,3004 <subdir+0x3f2>
if (mkdir("/dd/dd") != 0) {
2c8e: 00004517 auipc a0,0x4
2c92: 24a50513 addi a0,a0,586 # 6ed8 <l_free+0x1472>
2c96: 00003097 auipc ra,0x3
2c9a: 89e080e7 jalr -1890(ra) # 5534 <mkdir>
2c9e: 38051163 bnez a0,3020 <subdir+0x40e>
fd = open("dd/dd/ff", O_CREATE | O_RDWR);
2ca2: 20200593 li a1,514
2ca6: 00004517 auipc a0,0x4
2caa: 25a50513 addi a0,a0,602 # 6f00 <l_free+0x149a>
2cae: 00003097 auipc ra,0x3
2cb2: 85e080e7 jalr -1954(ra) # 550c <open>
2cb6: 84aa mv s1,a0
if (fd < 0) {
2cb8: 38054263 bltz a0,303c <subdir+0x42a>
write(fd, "FF", 2);
2cbc: 4609 li a2,2
2cbe: 00004597 auipc a1,0x4
2cc2: 27258593 addi a1,a1,626 # 6f30 <l_free+0x14ca>
2cc6: 00003097 auipc ra,0x3
2cca: 826080e7 jalr -2010(ra) # 54ec <write>
close(fd);
2cce: 8526 mv a0,s1
2cd0: 00003097 auipc ra,0x3
2cd4: 824080e7 jalr -2012(ra) # 54f4 <close>
fd = open("dd/dd/../ff", 0);
2cd8: 4581 li a1,0
2cda: 00004517 auipc a0,0x4
2cde: 25e50513 addi a0,a0,606 # 6f38 <l_free+0x14d2>
2ce2: 00003097 auipc ra,0x3
2ce6: 82a080e7 jalr -2006(ra) # 550c <open>
2cea: 84aa mv s1,a0
if (fd < 0) {
2cec: 36054663 bltz a0,3058 <subdir+0x446>
cc = read(fd, buf, sizeof(buf));
2cf0: 660d lui a2,0x3
2cf2: 00009597 auipc a1,0x9
2cf6: cc658593 addi a1,a1,-826 # b9b8 <buf>
2cfa: 00002097 auipc ra,0x2
2cfe: 7ea080e7 jalr 2026(ra) # 54e4 <read>
if (cc != 2 || buf[0] != 'f') {
2d02: 4789 li a5,2
2d04: 36f51863 bne a0,a5,3074 <subdir+0x462>
2d08: 00009717 auipc a4,0x9
2d0c: cb074703 lbu a4,-848(a4) # b9b8 <buf>
2d10: 06600793 li a5,102
2d14: 36f71063 bne a4,a5,3074 <subdir+0x462>
close(fd);
2d18: 8526 mv a0,s1
2d1a: 00002097 auipc ra,0x2
2d1e: 7da080e7 jalr 2010(ra) # 54f4 <close>
if (link("dd/dd/ff", "dd/dd/ffff") != 0) {
2d22: 00004597 auipc a1,0x4
2d26: 26658593 addi a1,a1,614 # 6f88 <l_free+0x1522>
2d2a: 00004517 auipc a0,0x4
2d2e: 1d650513 addi a0,a0,470 # 6f00 <l_free+0x149a>
2d32: 00002097 auipc ra,0x2
2d36: 7fa080e7 jalr 2042(ra) # 552c <link>
2d3a: 34051b63 bnez a0,3090 <subdir+0x47e>
if (unlink("dd/dd/ff") != 0) {
2d3e: 00004517 auipc a0,0x4
2d42: 1c250513 addi a0,a0,450 # 6f00 <l_free+0x149a>
2d46: 00002097 auipc ra,0x2
2d4a: 7d6080e7 jalr 2006(ra) # 551c <unlink>
2d4e: 34051f63 bnez a0,30ac <subdir+0x49a>
if (open("dd/dd/ff", O_RDONLY) >= 0) {
2d52: 4581 li a1,0
2d54: 00004517 auipc a0,0x4
2d58: 1ac50513 addi a0,a0,428 # 6f00 <l_free+0x149a>
2d5c: 00002097 auipc ra,0x2
2d60: 7b0080e7 jalr 1968(ra) # 550c <open>
2d64: 36055263 bgez a0,30c8 <subdir+0x4b6>
if (chdir("dd") != 0) {
2d68: 00004517 auipc a0,0x4
2d6c: 0f850513 addi a0,a0,248 # 6e60 <l_free+0x13fa>
2d70: 00002097 auipc ra,0x2
2d74: 7cc080e7 jalr 1996(ra) # 553c <chdir>
2d78: 36051663 bnez a0,30e4 <subdir+0x4d2>
if (chdir("dd/../../dd") != 0) {
2d7c: 00004517 auipc a0,0x4
2d80: 2a450513 addi a0,a0,676 # 7020 <l_free+0x15ba>
2d84: 00002097 auipc ra,0x2
2d88: 7b8080e7 jalr 1976(ra) # 553c <chdir>
2d8c: 36051a63 bnez a0,3100 <subdir+0x4ee>
if (chdir("dd/../../../dd") != 0) {
2d90: 00004517 auipc a0,0x4
2d94: 2c050513 addi a0,a0,704 # 7050 <l_free+0x15ea>
2d98: 00002097 auipc ra,0x2
2d9c: 7a4080e7 jalr 1956(ra) # 553c <chdir>
2da0: 36051e63 bnez a0,311c <subdir+0x50a>
if (chdir("./..") != 0) {
2da4: 00004517 auipc a0,0x4
2da8: 2dc50513 addi a0,a0,732 # 7080 <l_free+0x161a>
2dac: 00002097 auipc ra,0x2
2db0: 790080e7 jalr 1936(ra) # 553c <chdir>
2db4: 38051263 bnez a0,3138 <subdir+0x526>
fd = open("dd/dd/ffff", 0);
2db8: 4581 li a1,0
2dba: 00004517 auipc a0,0x4
2dbe: 1ce50513 addi a0,a0,462 # 6f88 <l_free+0x1522>
2dc2: 00002097 auipc ra,0x2
2dc6: 74a080e7 jalr 1866(ra) # 550c <open>
2dca: 84aa mv s1,a0
if (fd < 0) {
2dcc: 38054463 bltz a0,3154 <subdir+0x542>
if (read(fd, buf, sizeof(buf)) != 2) {
2dd0: 660d lui a2,0x3
2dd2: 00009597 auipc a1,0x9
2dd6: be658593 addi a1,a1,-1050 # b9b8 <buf>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2dda: 00002097 auipc ra,0x2
2dde: 70a080e7 jalr 1802(ra) # 54e4 <read>
2de2: 4789 li a5,2
2de4: 38f51663 bne a0,a5,3170 <subdir+0x55e>
<<<<<<< HEAD
2de8: 8526 mv a0,s1
2dea: 00002097 auipc ra,0x2
2dee: 70a080e7 jalr 1802(ra) # 54f4 <close>
2df2: 4581 li a1,0
2df4: 00004517 auipc a0,0x4
2df8: 10c50513 addi a0,a0,268 # 6f00 <l_free+0x1498>
2dfc: 00002097 auipc ra,0x2
2e00: 710080e7 jalr 1808(ra) # 550c <open>
2e04: 38055463 bgez a0,318c <subdir+0x57a>
2e08: 20200593 li a1,514
2e0c: 00004517 auipc a0,0x4
2e10: 30450513 addi a0,a0,772 # 7110 <l_free+0x16a8>
2e14: 00002097 auipc ra,0x2
2e18: 6f8080e7 jalr 1784(ra) # 550c <open>
2e1c: 38055663 bgez a0,31a8 <subdir+0x596>
2e20: 20200593 li a1,514
2e24: 00004517 auipc a0,0x4
2e28: 31c50513 addi a0,a0,796 # 7140 <l_free+0x16d8>
2e2c: 00002097 auipc ra,0x2
2e30: 6e0080e7 jalr 1760(ra) # 550c <open>
2e34: 38055863 bgez a0,31c4 <subdir+0x5b2>
2e38: 20000593 li a1,512
2e3c: 00004517 auipc a0,0x4
2e40: 02450513 addi a0,a0,36 # 6e60 <l_free+0x13f8>
2e44: 00002097 auipc ra,0x2
2e48: 6c8080e7 jalr 1736(ra) # 550c <open>
2e4c: 38055a63 bgez a0,31e0 <subdir+0x5ce>
2e50: 4589 li a1,2
2e52: 00004517 auipc a0,0x4
2e56: 00e50513 addi a0,a0,14 # 6e60 <l_free+0x13f8>
2e5a: 00002097 auipc ra,0x2
2e5e: 6b2080e7 jalr 1714(ra) # 550c <open>
2e62: 38055d63 bgez a0,31fc <subdir+0x5ea>
2e66: 4585 li a1,1
2e68: 00004517 auipc a0,0x4
2e6c: ff850513 addi a0,a0,-8 # 6e60 <l_free+0x13f8>
2e70: 00002097 auipc ra,0x2
2e74: 69c080e7 jalr 1692(ra) # 550c <open>
2e78: 3a055063 bgez a0,3218 <subdir+0x606>
2e7c: 00004597 auipc a1,0x4
2e80: 35458593 addi a1,a1,852 # 71d0 <l_free+0x1768>
2e84: 00004517 auipc a0,0x4
2e88: 28c50513 addi a0,a0,652 # 7110 <l_free+0x16a8>
2e8c: 00002097 auipc ra,0x2
2e90: 6a0080e7 jalr 1696(ra) # 552c <link>
2e94: 3a050063 beqz a0,3234 <subdir+0x622>
2e98: 00004597 auipc a1,0x4
2e9c: 33858593 addi a1,a1,824 # 71d0 <l_free+0x1768>
2ea0: 00004517 auipc a0,0x4
2ea4: 2a050513 addi a0,a0,672 # 7140 <l_free+0x16d8>
2ea8: 00002097 auipc ra,0x2
2eac: 684080e7 jalr 1668(ra) # 552c <link>
2eb0: 3a050063 beqz a0,3250 <subdir+0x63e>
2eb4: 00004597 auipc a1,0x4
2eb8: 0d458593 addi a1,a1,212 # 6f88 <l_free+0x1520>
2ebc: 00004517 auipc a0,0x4
2ec0: fc450513 addi a0,a0,-60 # 6e80 <l_free+0x1418>
2ec4: 00002097 auipc ra,0x2
2ec8: 668080e7 jalr 1640(ra) # 552c <link>
2ecc: 3a050063 beqz a0,326c <subdir+0x65a>
2ed0: 00004517 auipc a0,0x4
2ed4: 24050513 addi a0,a0,576 # 7110 <l_free+0x16a8>
2ed8: 00002097 auipc ra,0x2
2edc: 65c080e7 jalr 1628(ra) # 5534 <mkdir>
2ee0: 3a050463 beqz a0,3288 <subdir+0x676>
2ee4: 00004517 auipc a0,0x4
2ee8: 25c50513 addi a0,a0,604 # 7140 <l_free+0x16d8>
2eec: 00002097 auipc ra,0x2
2ef0: 648080e7 jalr 1608(ra) # 5534 <mkdir>
2ef4: 3a050863 beqz a0,32a4 <subdir+0x692>
2ef8: 00004517 auipc a0,0x4
2efc: 09050513 addi a0,a0,144 # 6f88 <l_free+0x1520>
2f00: 00002097 auipc ra,0x2
2f04: 634080e7 jalr 1588(ra) # 5534 <mkdir>
2f08: 3a050c63 beqz a0,32c0 <subdir+0x6ae>
2f0c: 00004517 auipc a0,0x4
2f10: 23450513 addi a0,a0,564 # 7140 <l_free+0x16d8>
2f14: 00002097 auipc ra,0x2
2f18: 608080e7 jalr 1544(ra) # 551c <unlink>
2f1c: 3c050063 beqz a0,32dc <subdir+0x6ca>
2f20: 00004517 auipc a0,0x4
2f24: 1f050513 addi a0,a0,496 # 7110 <l_free+0x16a8>
2f28: 00002097 auipc ra,0x2
2f2c: 5f4080e7 jalr 1524(ra) # 551c <unlink>
2f30: 3c050463 beqz a0,32f8 <subdir+0x6e6>
2f34: 00004517 auipc a0,0x4
2f38: f4c50513 addi a0,a0,-180 # 6e80 <l_free+0x1418>
2f3c: 00002097 auipc ra,0x2
2f40: 600080e7 jalr 1536(ra) # 553c <chdir>
2f44: 3c050863 beqz a0,3314 <subdir+0x702>
2f48: 00004517 auipc a0,0x4
2f4c: 3d850513 addi a0,a0,984 # 7320 <l_free+0x18b8>
2f50: 00002097 auipc ra,0x2
2f54: 5ec080e7 jalr 1516(ra) # 553c <chdir>
2f58: 3c050c63 beqz a0,3330 <subdir+0x71e>
2f5c: 00004517 auipc a0,0x4
2f60: 02c50513 addi a0,a0,44 # 6f88 <l_free+0x1520>
2f64: 00002097 auipc ra,0x2
2f68: 5b8080e7 jalr 1464(ra) # 551c <unlink>
2f6c: 3e051063 bnez a0,334c <subdir+0x73a>
2f70: 00004517 auipc a0,0x4
2f74: f1050513 addi a0,a0,-240 # 6e80 <l_free+0x1418>
2f78: 00002097 auipc ra,0x2
2f7c: 5a4080e7 jalr 1444(ra) # 551c <unlink>
2f80: 3e051463 bnez a0,3368 <subdir+0x756>
2f84: 00004517 auipc a0,0x4
2f88: edc50513 addi a0,a0,-292 # 6e60 <l_free+0x13f8>
2f8c: 00002097 auipc ra,0x2
2f90: 590080e7 jalr 1424(ra) # 551c <unlink>
2f94: 3e050863 beqz a0,3384 <subdir+0x772>
2f98: 00004517 auipc a0,0x4
2f9c: 3f850513 addi a0,a0,1016 # 7390 <l_free+0x1928>
2fa0: 00002097 auipc ra,0x2
2fa4: 57c080e7 jalr 1404(ra) # 551c <unlink>
2fa8: 3e054c63 bltz a0,33a0 <subdir+0x78e>
2fac: 00004517 auipc a0,0x4
2fb0: eb450513 addi a0,a0,-332 # 6e60 <l_free+0x13f8>
2fb4: 00002097 auipc ra,0x2
2fb8: 568080e7 jalr 1384(ra) # 551c <unlink>
2fbc: 40054063 bltz a0,33bc <subdir+0x7aa>
=======
close(fd);
2de8: 8526 mv a0,s1
2dea: 00002097 auipc ra,0x2
2dee: 70a080e7 jalr 1802(ra) # 54f4 <close>
if (open("dd/dd/ff", O_RDONLY) >= 0) {
2df2: 4581 li a1,0
2df4: 00004517 auipc a0,0x4
2df8: 10c50513 addi a0,a0,268 # 6f00 <l_free+0x149a>
2dfc: 00002097 auipc ra,0x2
2e00: 710080e7 jalr 1808(ra) # 550c <open>
2e04: 38055463 bgez a0,318c <subdir+0x57a>
if (open("dd/ff/ff", O_CREATE | O_RDWR) >= 0) {
2e08: 20200593 li a1,514
2e0c: 00004517 auipc a0,0x4
2e10: 30450513 addi a0,a0,772 # 7110 <l_free+0x16aa>
2e14: 00002097 auipc ra,0x2
2e18: 6f8080e7 jalr 1784(ra) # 550c <open>
2e1c: 38055663 bgez a0,31a8 <subdir+0x596>
if (open("dd/xx/ff", O_CREATE | O_RDWR) >= 0) {
2e20: 20200593 li a1,514
2e24: 00004517 auipc a0,0x4
2e28: 31c50513 addi a0,a0,796 # 7140 <l_free+0x16da>
2e2c: 00002097 auipc ra,0x2
2e30: 6e0080e7 jalr 1760(ra) # 550c <open>
2e34: 38055863 bgez a0,31c4 <subdir+0x5b2>
if (open("dd", O_CREATE) >= 0) {
2e38: 20000593 li a1,512
2e3c: 00004517 auipc a0,0x4
2e40: 02450513 addi a0,a0,36 # 6e60 <l_free+0x13fa>
2e44: 00002097 auipc ra,0x2
2e48: 6c8080e7 jalr 1736(ra) # 550c <open>
2e4c: 38055a63 bgez a0,31e0 <subdir+0x5ce>
if (open("dd", O_RDWR) >= 0) {
2e50: 4589 li a1,2
2e52: 00004517 auipc a0,0x4
2e56: 00e50513 addi a0,a0,14 # 6e60 <l_free+0x13fa>
2e5a: 00002097 auipc ra,0x2
2e5e: 6b2080e7 jalr 1714(ra) # 550c <open>
2e62: 38055d63 bgez a0,31fc <subdir+0x5ea>
if (open("dd", O_WRONLY) >= 0) {
2e66: 4585 li a1,1
2e68: 00004517 auipc a0,0x4
2e6c: ff850513 addi a0,a0,-8 # 6e60 <l_free+0x13fa>
2e70: 00002097 auipc ra,0x2
2e74: 69c080e7 jalr 1692(ra) # 550c <open>
2e78: 3a055063 bgez a0,3218 <subdir+0x606>
if (link("dd/ff/ff", "dd/dd/xx") == 0) {
2e7c: 00004597 auipc a1,0x4
2e80: 35458593 addi a1,a1,852 # 71d0 <l_free+0x176a>
2e84: 00004517 auipc a0,0x4
2e88: 28c50513 addi a0,a0,652 # 7110 <l_free+0x16aa>
2e8c: 00002097 auipc ra,0x2
2e90: 6a0080e7 jalr 1696(ra) # 552c <link>
2e94: 3a050063 beqz a0,3234 <subdir+0x622>
if (link("dd/xx/ff", "dd/dd/xx") == 0) {
2e98: 00004597 auipc a1,0x4
2e9c: 33858593 addi a1,a1,824 # 71d0 <l_free+0x176a>
2ea0: 00004517 auipc a0,0x4
2ea4: 2a050513 addi a0,a0,672 # 7140 <l_free+0x16da>
2ea8: 00002097 auipc ra,0x2
2eac: 684080e7 jalr 1668(ra) # 552c <link>
2eb0: 3a050063 beqz a0,3250 <subdir+0x63e>
if (link("dd/ff", "dd/dd/ffff") == 0) {
2eb4: 00004597 auipc a1,0x4
2eb8: 0d458593 addi a1,a1,212 # 6f88 <l_free+0x1522>
2ebc: 00004517 auipc a0,0x4
2ec0: fc450513 addi a0,a0,-60 # 6e80 <l_free+0x141a>
2ec4: 00002097 auipc ra,0x2
2ec8: 668080e7 jalr 1640(ra) # 552c <link>
2ecc: 3a050063 beqz a0,326c <subdir+0x65a>
if (mkdir("dd/ff/ff") == 0) {
2ed0: 00004517 auipc a0,0x4
2ed4: 24050513 addi a0,a0,576 # 7110 <l_free+0x16aa>
2ed8: 00002097 auipc ra,0x2
2edc: 65c080e7 jalr 1628(ra) # 5534 <mkdir>
2ee0: 3a050463 beqz a0,3288 <subdir+0x676>
if (mkdir("dd/xx/ff") == 0) {
2ee4: 00004517 auipc a0,0x4
2ee8: 25c50513 addi a0,a0,604 # 7140 <l_free+0x16da>
2eec: 00002097 auipc ra,0x2
2ef0: 648080e7 jalr 1608(ra) # 5534 <mkdir>
2ef4: 3a050863 beqz a0,32a4 <subdir+0x692>
if (mkdir("dd/dd/ffff") == 0) {
2ef8: 00004517 auipc a0,0x4
2efc: 09050513 addi a0,a0,144 # 6f88 <l_free+0x1522>
2f00: 00002097 auipc ra,0x2
2f04: 634080e7 jalr 1588(ra) # 5534 <mkdir>
2f08: 3a050c63 beqz a0,32c0 <subdir+0x6ae>
if (unlink("dd/xx/ff") == 0) {
2f0c: 00004517 auipc a0,0x4
2f10: 23450513 addi a0,a0,564 # 7140 <l_free+0x16da>
2f14: 00002097 auipc ra,0x2
2f18: 608080e7 jalr 1544(ra) # 551c <unlink>
2f1c: 3c050063 beqz a0,32dc <subdir+0x6ca>
if (unlink("dd/ff/ff") == 0) {
2f20: 00004517 auipc a0,0x4
2f24: 1f050513 addi a0,a0,496 # 7110 <l_free+0x16aa>
2f28: 00002097 auipc ra,0x2
2f2c: 5f4080e7 jalr 1524(ra) # 551c <unlink>
2f30: 3c050463 beqz a0,32f8 <subdir+0x6e6>
if (chdir("dd/ff") == 0) {
2f34: 00004517 auipc a0,0x4
2f38: f4c50513 addi a0,a0,-180 # 6e80 <l_free+0x141a>
2f3c: 00002097 auipc ra,0x2
2f40: 600080e7 jalr 1536(ra) # 553c <chdir>
2f44: 3c050863 beqz a0,3314 <subdir+0x702>
if (chdir("dd/xx") == 0) {
2f48: 00004517 auipc a0,0x4
2f4c: 3d850513 addi a0,a0,984 # 7320 <l_free+0x18ba>
2f50: 00002097 auipc ra,0x2
2f54: 5ec080e7 jalr 1516(ra) # 553c <chdir>
2f58: 3c050c63 beqz a0,3330 <subdir+0x71e>
if (unlink("dd/dd/ffff") != 0) {
2f5c: 00004517 auipc a0,0x4
2f60: 02c50513 addi a0,a0,44 # 6f88 <l_free+0x1522>
2f64: 00002097 auipc ra,0x2
2f68: 5b8080e7 jalr 1464(ra) # 551c <unlink>
2f6c: 3e051063 bnez a0,334c <subdir+0x73a>
if (unlink("dd/ff") != 0) {
2f70: 00004517 auipc a0,0x4
2f74: f1050513 addi a0,a0,-240 # 6e80 <l_free+0x141a>
2f78: 00002097 auipc ra,0x2
2f7c: 5a4080e7 jalr 1444(ra) # 551c <unlink>
2f80: 3e051463 bnez a0,3368 <subdir+0x756>
if (unlink("dd") == 0) {
2f84: 00004517 auipc a0,0x4
2f88: edc50513 addi a0,a0,-292 # 6e60 <l_free+0x13fa>
2f8c: 00002097 auipc ra,0x2
2f90: 590080e7 jalr 1424(ra) # 551c <unlink>
2f94: 3e050863 beqz a0,3384 <subdir+0x772>
if (unlink("dd/dd") < 0) {
2f98: 00004517 auipc a0,0x4
2f9c: 3f850513 addi a0,a0,1016 # 7390 <l_free+0x192a>
2fa0: 00002097 auipc ra,0x2
2fa4: 57c080e7 jalr 1404(ra) # 551c <unlink>
2fa8: 3e054c63 bltz a0,33a0 <subdir+0x78e>
if (unlink("dd") < 0) {
2fac: 00004517 auipc a0,0x4
2fb0: eb450513 addi a0,a0,-332 # 6e60 <l_free+0x13fa>
2fb4: 00002097 auipc ra,0x2
2fb8: 568080e7 jalr 1384(ra) # 551c <unlink>
2fbc: 40054063 bltz a0,33bc <subdir+0x7aa>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
2fc0: 60e2 ld ra,24(sp)
2fc2: 6442 ld s0,16(sp)
2fc4: 64a2 ld s1,8(sp)
2fc6: 6902 ld s2,0(sp)
2fc8: 6105 addi sp,sp,32
2fca: 8082 ret
<<<<<<< HEAD
2fcc: 85ca mv a1,s2
2fce: 00004517 auipc a0,0x4
2fd2: e9a50513 addi a0,a0,-358 # 6e68 <l_free+0x1400>
2fd6: 00003097 auipc ra,0x3
2fda: 870080e7 jalr -1936(ra) # 5846 <printf>
2fde: 4505 li a0,1
2fe0: 00002097 auipc ra,0x2
2fe4: 4ec080e7 jalr 1260(ra) # 54cc <exit>
2fe8: 85ca mv a1,s2
2fea: 00004517 auipc a0,0x4
2fee: e9e50513 addi a0,a0,-354 # 6e88 <l_free+0x1420>
2ff2: 00003097 auipc ra,0x3
2ff6: 854080e7 jalr -1964(ra) # 5846 <printf>
2ffa: 4505 li a0,1
2ffc: 00002097 auipc ra,0x2
3000: 4d0080e7 jalr 1232(ra) # 54cc <exit>
3004: 85ca mv a1,s2
3006: 00004517 auipc a0,0x4
300a: ea250513 addi a0,a0,-350 # 6ea8 <l_free+0x1440>
300e: 00003097 auipc ra,0x3
3012: 838080e7 jalr -1992(ra) # 5846 <printf>
3016: 4505 li a0,1
3018: 00002097 auipc ra,0x2
301c: 4b4080e7 jalr 1204(ra) # 54cc <exit>
3020: 85ca mv a1,s2
3022: 00004517 auipc a0,0x4
3026: ebe50513 addi a0,a0,-322 # 6ee0 <l_free+0x1478>
302a: 00003097 auipc ra,0x3
302e: 81c080e7 jalr -2020(ra) # 5846 <printf>
3032: 4505 li a0,1
3034: 00002097 auipc ra,0x2
3038: 498080e7 jalr 1176(ra) # 54cc <exit>
303c: 85ca mv a1,s2
303e: 00004517 auipc a0,0x4
3042: ed250513 addi a0,a0,-302 # 6f10 <l_free+0x14a8>
3046: 00003097 auipc ra,0x3
304a: 800080e7 jalr -2048(ra) # 5846 <printf>
304e: 4505 li a0,1
3050: 00002097 auipc ra,0x2
3054: 47c080e7 jalr 1148(ra) # 54cc <exit>
3058: 85ca mv a1,s2
305a: 00004517 auipc a0,0x4
305e: eee50513 addi a0,a0,-274 # 6f48 <l_free+0x14e0>
3062: 00002097 auipc ra,0x2
3066: 7e4080e7 jalr 2020(ra) # 5846 <printf>
306a: 4505 li a0,1
306c: 00002097 auipc ra,0x2
3070: 460080e7 jalr 1120(ra) # 54cc <exit>
3074: 85ca mv a1,s2
3076: 00004517 auipc a0,0x4
307a: ef250513 addi a0,a0,-270 # 6f68 <l_free+0x1500>
307e: 00002097 auipc ra,0x2
3082: 7c8080e7 jalr 1992(ra) # 5846 <printf>
3086: 4505 li a0,1
3088: 00002097 auipc ra,0x2
308c: 444080e7 jalr 1092(ra) # 54cc <exit>
3090: 85ca mv a1,s2
3092: 00004517 auipc a0,0x4
3096: f0650513 addi a0,a0,-250 # 6f98 <l_free+0x1530>
309a: 00002097 auipc ra,0x2
309e: 7ac080e7 jalr 1964(ra) # 5846 <printf>
30a2: 4505 li a0,1
30a4: 00002097 auipc ra,0x2
30a8: 428080e7 jalr 1064(ra) # 54cc <exit>
30ac: 85ca mv a1,s2
30ae: 00004517 auipc a0,0x4
30b2: f1250513 addi a0,a0,-238 # 6fc0 <l_free+0x1558>
30b6: 00002097 auipc ra,0x2
30ba: 790080e7 jalr 1936(ra) # 5846 <printf>
30be: 4505 li a0,1
30c0: 00002097 auipc ra,0x2
30c4: 40c080e7 jalr 1036(ra) # 54cc <exit>
30c8: 85ca mv a1,s2
30ca: 00004517 auipc a0,0x4
30ce: f1650513 addi a0,a0,-234 # 6fe0 <l_free+0x1578>
30d2: 00002097 auipc ra,0x2
30d6: 774080e7 jalr 1908(ra) # 5846 <printf>
30da: 4505 li a0,1
30dc: 00002097 auipc ra,0x2
30e0: 3f0080e7 jalr 1008(ra) # 54cc <exit>
30e4: 85ca mv a1,s2
30e6: 00004517 auipc a0,0x4
30ea: f2250513 addi a0,a0,-222 # 7008 <l_free+0x15a0>
30ee: 00002097 auipc ra,0x2
30f2: 758080e7 jalr 1880(ra) # 5846 <printf>
30f6: 4505 li a0,1
30f8: 00002097 auipc ra,0x2
30fc: 3d4080e7 jalr 980(ra) # 54cc <exit>
3100: 85ca mv a1,s2
3102: 00004517 auipc a0,0x4
3106: f2e50513 addi a0,a0,-210 # 7030 <l_free+0x15c8>
310a: 00002097 auipc ra,0x2
310e: 73c080e7 jalr 1852(ra) # 5846 <printf>
3112: 4505 li a0,1
3114: 00002097 auipc ra,0x2
3118: 3b8080e7 jalr 952(ra) # 54cc <exit>
311c: 85ca mv a1,s2
311e: 00004517 auipc a0,0x4
3122: f4250513 addi a0,a0,-190 # 7060 <l_free+0x15f8>
3126: 00002097 auipc ra,0x2
312a: 720080e7 jalr 1824(ra) # 5846 <printf>
312e: 4505 li a0,1
3130: 00002097 auipc ra,0x2
3134: 39c080e7 jalr 924(ra) # 54cc <exit>
3138: 85ca mv a1,s2
313a: 00004517 auipc a0,0x4
313e: f4e50513 addi a0,a0,-178 # 7088 <l_free+0x1620>
3142: 00002097 auipc ra,0x2
3146: 704080e7 jalr 1796(ra) # 5846 <printf>
314a: 4505 li a0,1
314c: 00002097 auipc ra,0x2
3150: 380080e7 jalr 896(ra) # 54cc <exit>
3154: 85ca mv a1,s2
3156: 00004517 auipc a0,0x4
315a: f4a50513 addi a0,a0,-182 # 70a0 <l_free+0x1638>
315e: 00002097 auipc ra,0x2
3162: 6e8080e7 jalr 1768(ra) # 5846 <printf>
3166: 4505 li a0,1
3168: 00002097 auipc ra,0x2
316c: 364080e7 jalr 868(ra) # 54cc <exit>
3170: 85ca mv a1,s2
3172: 00004517 auipc a0,0x4
3176: f4e50513 addi a0,a0,-178 # 70c0 <l_free+0x1658>
317a: 00002097 auipc ra,0x2
317e: 6cc080e7 jalr 1740(ra) # 5846 <printf>
3182: 4505 li a0,1
3184: 00002097 auipc ra,0x2
3188: 348080e7 jalr 840(ra) # 54cc <exit>
318c: 85ca mv a1,s2
318e: 00004517 auipc a0,0x4
3192: f5250513 addi a0,a0,-174 # 70e0 <l_free+0x1678>
3196: 00002097 auipc ra,0x2
319a: 6b0080e7 jalr 1712(ra) # 5846 <printf>
319e: 4505 li a0,1
31a0: 00002097 auipc ra,0x2
31a4: 32c080e7 jalr 812(ra) # 54cc <exit>
31a8: 85ca mv a1,s2
31aa: 00004517 auipc a0,0x4
31ae: f7650513 addi a0,a0,-138 # 7120 <l_free+0x16b8>
31b2: 00002097 auipc ra,0x2
31b6: 694080e7 jalr 1684(ra) # 5846 <printf>
31ba: 4505 li a0,1
31bc: 00002097 auipc ra,0x2
31c0: 310080e7 jalr 784(ra) # 54cc <exit>
31c4: 85ca mv a1,s2
31c6: 00004517 auipc a0,0x4
31ca: f8a50513 addi a0,a0,-118 # 7150 <l_free+0x16e8>
31ce: 00002097 auipc ra,0x2
31d2: 678080e7 jalr 1656(ra) # 5846 <printf>
31d6: 4505 li a0,1
31d8: 00002097 auipc ra,0x2
31dc: 2f4080e7 jalr 756(ra) # 54cc <exit>
31e0: 85ca mv a1,s2
31e2: 00004517 auipc a0,0x4
31e6: f8e50513 addi a0,a0,-114 # 7170 <l_free+0x1708>
31ea: 00002097 auipc ra,0x2
31ee: 65c080e7 jalr 1628(ra) # 5846 <printf>
31f2: 4505 li a0,1
31f4: 00002097 auipc ra,0x2
31f8: 2d8080e7 jalr 728(ra) # 54cc <exit>
31fc: 85ca mv a1,s2
31fe: 00004517 auipc a0,0x4
3202: f9250513 addi a0,a0,-110 # 7190 <l_free+0x1728>
3206: 00002097 auipc ra,0x2
320a: 640080e7 jalr 1600(ra) # 5846 <printf>
320e: 4505 li a0,1
3210: 00002097 auipc ra,0x2
3214: 2bc080e7 jalr 700(ra) # 54cc <exit>
3218: 85ca mv a1,s2
321a: 00004517 auipc a0,0x4
321e: f9650513 addi a0,a0,-106 # 71b0 <l_free+0x1748>
3222: 00002097 auipc ra,0x2
3226: 624080e7 jalr 1572(ra) # 5846 <printf>
322a: 4505 li a0,1
322c: 00002097 auipc ra,0x2
3230: 2a0080e7 jalr 672(ra) # 54cc <exit>
3234: 85ca mv a1,s2
3236: 00004517 auipc a0,0x4
323a: faa50513 addi a0,a0,-86 # 71e0 <l_free+0x1778>
323e: 00002097 auipc ra,0x2
3242: 608080e7 jalr 1544(ra) # 5846 <printf>
3246: 4505 li a0,1
3248: 00002097 auipc ra,0x2
324c: 284080e7 jalr 644(ra) # 54cc <exit>
3250: 85ca mv a1,s2
3252: 00004517 auipc a0,0x4
3256: fb650513 addi a0,a0,-74 # 7208 <l_free+0x17a0>
325a: 00002097 auipc ra,0x2
325e: 5ec080e7 jalr 1516(ra) # 5846 <printf>
3262: 4505 li a0,1
3264: 00002097 auipc ra,0x2
3268: 268080e7 jalr 616(ra) # 54cc <exit>
326c: 85ca mv a1,s2
326e: 00004517 auipc a0,0x4
3272: fc250513 addi a0,a0,-62 # 7230 <l_free+0x17c8>
3276: 00002097 auipc ra,0x2
327a: 5d0080e7 jalr 1488(ra) # 5846 <printf>
327e: 4505 li a0,1
3280: 00002097 auipc ra,0x2
3284: 24c080e7 jalr 588(ra) # 54cc <exit>
3288: 85ca mv a1,s2
328a: 00004517 auipc a0,0x4
328e: fce50513 addi a0,a0,-50 # 7258 <l_free+0x17f0>
3292: 00002097 auipc ra,0x2
3296: 5b4080e7 jalr 1460(ra) # 5846 <printf>
329a: 4505 li a0,1
329c: 00002097 auipc ra,0x2
32a0: 230080e7 jalr 560(ra) # 54cc <exit>
32a4: 85ca mv a1,s2
32a6: 00004517 auipc a0,0x4
32aa: fd250513 addi a0,a0,-46 # 7278 <l_free+0x1810>
32ae: 00002097 auipc ra,0x2
32b2: 598080e7 jalr 1432(ra) # 5846 <printf>
32b6: 4505 li a0,1
32b8: 00002097 auipc ra,0x2
32bc: 214080e7 jalr 532(ra) # 54cc <exit>
32c0: 85ca mv a1,s2
32c2: 00004517 auipc a0,0x4
32c6: fd650513 addi a0,a0,-42 # 7298 <l_free+0x1830>
32ca: 00002097 auipc ra,0x2
32ce: 57c080e7 jalr 1404(ra) # 5846 <printf>
32d2: 4505 li a0,1
32d4: 00002097 auipc ra,0x2
32d8: 1f8080e7 jalr 504(ra) # 54cc <exit>
32dc: 85ca mv a1,s2
32de: 00004517 auipc a0,0x4
32e2: fe250513 addi a0,a0,-30 # 72c0 <l_free+0x1858>
32e6: 00002097 auipc ra,0x2
32ea: 560080e7 jalr 1376(ra) # 5846 <printf>
32ee: 4505 li a0,1
32f0: 00002097 auipc ra,0x2
32f4: 1dc080e7 jalr 476(ra) # 54cc <exit>
32f8: 85ca mv a1,s2
32fa: 00004517 auipc a0,0x4
32fe: fe650513 addi a0,a0,-26 # 72e0 <l_free+0x1878>
3302: 00002097 auipc ra,0x2
3306: 544080e7 jalr 1348(ra) # 5846 <printf>
330a: 4505 li a0,1
330c: 00002097 auipc ra,0x2
3310: 1c0080e7 jalr 448(ra) # 54cc <exit>
3314: 85ca mv a1,s2
3316: 00004517 auipc a0,0x4
331a: fea50513 addi a0,a0,-22 # 7300 <l_free+0x1898>
331e: 00002097 auipc ra,0x2
3322: 528080e7 jalr 1320(ra) # 5846 <printf>
3326: 4505 li a0,1
3328: 00002097 auipc ra,0x2
332c: 1a4080e7 jalr 420(ra) # 54cc <exit>
3330: 85ca mv a1,s2
3332: 00004517 auipc a0,0x4
3336: ff650513 addi a0,a0,-10 # 7328 <l_free+0x18c0>
333a: 00002097 auipc ra,0x2
333e: 50c080e7 jalr 1292(ra) # 5846 <printf>
3342: 4505 li a0,1
3344: 00002097 auipc ra,0x2
3348: 188080e7 jalr 392(ra) # 54cc <exit>
334c: 85ca mv a1,s2
334e: 00004517 auipc a0,0x4
3352: c7250513 addi a0,a0,-910 # 6fc0 <l_free+0x1558>
3356: 00002097 auipc ra,0x2
335a: 4f0080e7 jalr 1264(ra) # 5846 <printf>
335e: 4505 li a0,1
3360: 00002097 auipc ra,0x2
3364: 16c080e7 jalr 364(ra) # 54cc <exit>
3368: 85ca mv a1,s2
336a: 00004517 auipc a0,0x4
336e: fde50513 addi a0,a0,-34 # 7348 <l_free+0x18e0>
3372: 00002097 auipc ra,0x2
3376: 4d4080e7 jalr 1236(ra) # 5846 <printf>
337a: 4505 li a0,1
337c: 00002097 auipc ra,0x2
3380: 150080e7 jalr 336(ra) # 54cc <exit>
3384: 85ca mv a1,s2
3386: 00004517 auipc a0,0x4
338a: fe250513 addi a0,a0,-30 # 7368 <l_free+0x1900>
338e: 00002097 auipc ra,0x2
3392: 4b8080e7 jalr 1208(ra) # 5846 <printf>
3396: 4505 li a0,1
3398: 00002097 auipc ra,0x2
339c: 134080e7 jalr 308(ra) # 54cc <exit>
33a0: 85ca mv a1,s2
33a2: 00004517 auipc a0,0x4
33a6: ff650513 addi a0,a0,-10 # 7398 <l_free+0x1930>
33aa: 00002097 auipc ra,0x2
33ae: 49c080e7 jalr 1180(ra) # 5846 <printf>
33b2: 4505 li a0,1
33b4: 00002097 auipc ra,0x2
33b8: 118080e7 jalr 280(ra) # 54cc <exit>
33bc: 85ca mv a1,s2
33be: 00004517 auipc a0,0x4
33c2: ffa50513 addi a0,a0,-6 # 73b8 <l_free+0x1950>
33c6: 00002097 auipc ra,0x2
33ca: 480080e7 jalr 1152(ra) # 5846 <printf>
=======
printf("%s: mkdir dd failed\n", s);
2fcc: 85ca mv a1,s2
2fce: 00004517 auipc a0,0x4
2fd2: e9a50513 addi a0,a0,-358 # 6e68 <l_free+0x1402>
2fd6: 00003097 auipc ra,0x3
2fda: 86e080e7 jalr -1938(ra) # 5844 <printf>
exit(1);
2fde: 4505 li a0,1
2fe0: 00002097 auipc ra,0x2
2fe4: 4ec080e7 jalr 1260(ra) # 54cc <exit>
printf("%s: create dd/ff failed\n", s);
2fe8: 85ca mv a1,s2
2fea: 00004517 auipc a0,0x4
2fee: e9e50513 addi a0,a0,-354 # 6e88 <l_free+0x1422>
2ff2: 00003097 auipc ra,0x3
2ff6: 852080e7 jalr -1966(ra) # 5844 <printf>
exit(1);
2ffa: 4505 li a0,1
2ffc: 00002097 auipc ra,0x2
3000: 4d0080e7 jalr 1232(ra) # 54cc <exit>
printf("%s: unlink dd (non-empty dir) succeeded!\n", s);
3004: 85ca mv a1,s2
3006: 00004517 auipc a0,0x4
300a: ea250513 addi a0,a0,-350 # 6ea8 <l_free+0x1442>
300e: 00003097 auipc ra,0x3
3012: 836080e7 jalr -1994(ra) # 5844 <printf>
exit(1);
3016: 4505 li a0,1
3018: 00002097 auipc ra,0x2
301c: 4b4080e7 jalr 1204(ra) # 54cc <exit>
printf("subdir mkdir dd/dd failed\n", s);
3020: 85ca mv a1,s2
3022: 00004517 auipc a0,0x4
3026: ebe50513 addi a0,a0,-322 # 6ee0 <l_free+0x147a>
302a: 00003097 auipc ra,0x3
302e: 81a080e7 jalr -2022(ra) # 5844 <printf>
exit(1);
3032: 4505 li a0,1
3034: 00002097 auipc ra,0x2
3038: 498080e7 jalr 1176(ra) # 54cc <exit>
printf("%s: create dd/dd/ff failed\n", s);
303c: 85ca mv a1,s2
303e: 00004517 auipc a0,0x4
3042: ed250513 addi a0,a0,-302 # 6f10 <l_free+0x14aa>
3046: 00002097 auipc ra,0x2
304a: 7fe080e7 jalr 2046(ra) # 5844 <printf>
exit(1);
304e: 4505 li a0,1
3050: 00002097 auipc ra,0x2
3054: 47c080e7 jalr 1148(ra) # 54cc <exit>
printf("%s: open dd/dd/../ff failed\n", s);
3058: 85ca mv a1,s2
305a: 00004517 auipc a0,0x4
305e: eee50513 addi a0,a0,-274 # 6f48 <l_free+0x14e2>
3062: 00002097 auipc ra,0x2
3066: 7e2080e7 jalr 2018(ra) # 5844 <printf>
exit(1);
306a: 4505 li a0,1
306c: 00002097 auipc ra,0x2
3070: 460080e7 jalr 1120(ra) # 54cc <exit>
printf("%s: dd/dd/../ff wrong content\n", s);
3074: 85ca mv a1,s2
3076: 00004517 auipc a0,0x4
307a: ef250513 addi a0,a0,-270 # 6f68 <l_free+0x1502>
307e: 00002097 auipc ra,0x2
3082: 7c6080e7 jalr 1990(ra) # 5844 <printf>
exit(1);
3086: 4505 li a0,1
3088: 00002097 auipc ra,0x2
308c: 444080e7 jalr 1092(ra) # 54cc <exit>
printf("link dd/dd/ff dd/dd/ffff failed\n", s);
3090: 85ca mv a1,s2
3092: 00004517 auipc a0,0x4
3096: f0650513 addi a0,a0,-250 # 6f98 <l_free+0x1532>
309a: 00002097 auipc ra,0x2
309e: 7aa080e7 jalr 1962(ra) # 5844 <printf>
exit(1);
30a2: 4505 li a0,1
30a4: 00002097 auipc ra,0x2
30a8: 428080e7 jalr 1064(ra) # 54cc <exit>
printf("%s: unlink dd/dd/ff failed\n", s);
30ac: 85ca mv a1,s2
30ae: 00004517 auipc a0,0x4
30b2: f1250513 addi a0,a0,-238 # 6fc0 <l_free+0x155a>
30b6: 00002097 auipc ra,0x2
30ba: 78e080e7 jalr 1934(ra) # 5844 <printf>
exit(1);
30be: 4505 li a0,1
30c0: 00002097 auipc ra,0x2
30c4: 40c080e7 jalr 1036(ra) # 54cc <exit>
printf("%s: open (unlinked) dd/dd/ff succeeded\n", s);
30c8: 85ca mv a1,s2
30ca: 00004517 auipc a0,0x4
30ce: f1650513 addi a0,a0,-234 # 6fe0 <l_free+0x157a>
30d2: 00002097 auipc ra,0x2
30d6: 772080e7 jalr 1906(ra) # 5844 <printf>
exit(1);
30da: 4505 li a0,1
30dc: 00002097 auipc ra,0x2
30e0: 3f0080e7 jalr 1008(ra) # 54cc <exit>
printf("%s: chdir dd failed\n", s);
30e4: 85ca mv a1,s2
30e6: 00004517 auipc a0,0x4
30ea: f2250513 addi a0,a0,-222 # 7008 <l_free+0x15a2>
30ee: 00002097 auipc ra,0x2
30f2: 756080e7 jalr 1878(ra) # 5844 <printf>
exit(1);
30f6: 4505 li a0,1
30f8: 00002097 auipc ra,0x2
30fc: 3d4080e7 jalr 980(ra) # 54cc <exit>
printf("%s: chdir dd/../../dd failed\n", s);
3100: 85ca mv a1,s2
3102: 00004517 auipc a0,0x4
3106: f2e50513 addi a0,a0,-210 # 7030 <l_free+0x15ca>
310a: 00002097 auipc ra,0x2
310e: 73a080e7 jalr 1850(ra) # 5844 <printf>
exit(1);
3112: 4505 li a0,1
3114: 00002097 auipc ra,0x2
3118: 3b8080e7 jalr 952(ra) # 54cc <exit>
printf("chdir dd/../../dd failed\n", s);
311c: 85ca mv a1,s2
311e: 00004517 auipc a0,0x4
3122: f4250513 addi a0,a0,-190 # 7060 <l_free+0x15fa>
3126: 00002097 auipc ra,0x2
312a: 71e080e7 jalr 1822(ra) # 5844 <printf>
exit(1);
312e: 4505 li a0,1
3130: 00002097 auipc ra,0x2
3134: 39c080e7 jalr 924(ra) # 54cc <exit>
printf("%s: chdir ./.. failed\n", s);
3138: 85ca mv a1,s2
313a: 00004517 auipc a0,0x4
313e: f4e50513 addi a0,a0,-178 # 7088 <l_free+0x1622>
3142: 00002097 auipc ra,0x2
3146: 702080e7 jalr 1794(ra) # 5844 <printf>
exit(1);
314a: 4505 li a0,1
314c: 00002097 auipc ra,0x2
3150: 380080e7 jalr 896(ra) # 54cc <exit>
printf("%s: open dd/dd/ffff failed\n", s);
3154: 85ca mv a1,s2
3156: 00004517 auipc a0,0x4
315a: f4a50513 addi a0,a0,-182 # 70a0 <l_free+0x163a>
315e: 00002097 auipc ra,0x2
3162: 6e6080e7 jalr 1766(ra) # 5844 <printf>
exit(1);
3166: 4505 li a0,1
3168: 00002097 auipc ra,0x2
316c: 364080e7 jalr 868(ra) # 54cc <exit>
printf("%s: read dd/dd/ffff wrong len\n", s);
3170: 85ca mv a1,s2
3172: 00004517 auipc a0,0x4
3176: f4e50513 addi a0,a0,-178 # 70c0 <l_free+0x165a>
317a: 00002097 auipc ra,0x2
317e: 6ca080e7 jalr 1738(ra) # 5844 <printf>
exit(1);
3182: 4505 li a0,1
3184: 00002097 auipc ra,0x2
3188: 348080e7 jalr 840(ra) # 54cc <exit>
printf("%s: open (unlinked) dd/dd/ff succeeded!\n", s);
318c: 85ca mv a1,s2
318e: 00004517 auipc a0,0x4
3192: f5250513 addi a0,a0,-174 # 70e0 <l_free+0x167a>
3196: 00002097 auipc ra,0x2
319a: 6ae080e7 jalr 1710(ra) # 5844 <printf>
exit(1);
319e: 4505 li a0,1
31a0: 00002097 auipc ra,0x2
31a4: 32c080e7 jalr 812(ra) # 54cc <exit>
printf("%s: create dd/ff/ff succeeded!\n", s);
31a8: 85ca mv a1,s2
31aa: 00004517 auipc a0,0x4
31ae: f7650513 addi a0,a0,-138 # 7120 <l_free+0x16ba>
31b2: 00002097 auipc ra,0x2
31b6: 692080e7 jalr 1682(ra) # 5844 <printf>
exit(1);
31ba: 4505 li a0,1
31bc: 00002097 auipc ra,0x2
31c0: 310080e7 jalr 784(ra) # 54cc <exit>
printf("%s: create dd/xx/ff succeeded!\n", s);
31c4: 85ca mv a1,s2
31c6: 00004517 auipc a0,0x4
31ca: f8a50513 addi a0,a0,-118 # 7150 <l_free+0x16ea>
31ce: 00002097 auipc ra,0x2
31d2: 676080e7 jalr 1654(ra) # 5844 <printf>
exit(1);
31d6: 4505 li a0,1
31d8: 00002097 auipc ra,0x2
31dc: 2f4080e7 jalr 756(ra) # 54cc <exit>
printf("%s: create dd succeeded!\n", s);
31e0: 85ca mv a1,s2
31e2: 00004517 auipc a0,0x4
31e6: f8e50513 addi a0,a0,-114 # 7170 <l_free+0x170a>
31ea: 00002097 auipc ra,0x2
31ee: 65a080e7 jalr 1626(ra) # 5844 <printf>
exit(1);
31f2: 4505 li a0,1
31f4: 00002097 auipc ra,0x2
31f8: 2d8080e7 jalr 728(ra) # 54cc <exit>
printf("%s: open dd rdwr succeeded!\n", s);
31fc: 85ca mv a1,s2
31fe: 00004517 auipc a0,0x4
3202: f9250513 addi a0,a0,-110 # 7190 <l_free+0x172a>
3206: 00002097 auipc ra,0x2
320a: 63e080e7 jalr 1598(ra) # 5844 <printf>
exit(1);
320e: 4505 li a0,1
3210: 00002097 auipc ra,0x2
3214: 2bc080e7 jalr 700(ra) # 54cc <exit>
printf("%s: open dd wronly succeeded!\n", s);
3218: 85ca mv a1,s2
321a: 00004517 auipc a0,0x4
321e: f9650513 addi a0,a0,-106 # 71b0 <l_free+0x174a>
3222: 00002097 auipc ra,0x2
3226: 622080e7 jalr 1570(ra) # 5844 <printf>
exit(1);
322a: 4505 li a0,1
322c: 00002097 auipc ra,0x2
3230: 2a0080e7 jalr 672(ra) # 54cc <exit>
printf("%s: link dd/ff/ff dd/dd/xx succeeded!\n", s);
3234: 85ca mv a1,s2
3236: 00004517 auipc a0,0x4
323a: faa50513 addi a0,a0,-86 # 71e0 <l_free+0x177a>
323e: 00002097 auipc ra,0x2
3242: 606080e7 jalr 1542(ra) # 5844 <printf>
exit(1);
3246: 4505 li a0,1
3248: 00002097 auipc ra,0x2
324c: 284080e7 jalr 644(ra) # 54cc <exit>
printf("%s: link dd/xx/ff dd/dd/xx succeeded!\n", s);
3250: 85ca mv a1,s2
3252: 00004517 auipc a0,0x4
3256: fb650513 addi a0,a0,-74 # 7208 <l_free+0x17a2>
325a: 00002097 auipc ra,0x2
325e: 5ea080e7 jalr 1514(ra) # 5844 <printf>
exit(1);
3262: 4505 li a0,1
3264: 00002097 auipc ra,0x2
3268: 268080e7 jalr 616(ra) # 54cc <exit>
printf("%s: link dd/ff dd/dd/ffff succeeded!\n", s);
326c: 85ca mv a1,s2
326e: 00004517 auipc a0,0x4
3272: fc250513 addi a0,a0,-62 # 7230 <l_free+0x17ca>
3276: 00002097 auipc ra,0x2
327a: 5ce080e7 jalr 1486(ra) # 5844 <printf>
exit(1);
327e: 4505 li a0,1
3280: 00002097 auipc ra,0x2
3284: 24c080e7 jalr 588(ra) # 54cc <exit>
printf("%s: mkdir dd/ff/ff succeeded!\n", s);
3288: 85ca mv a1,s2
328a: 00004517 auipc a0,0x4
328e: fce50513 addi a0,a0,-50 # 7258 <l_free+0x17f2>
3292: 00002097 auipc ra,0x2
3296: 5b2080e7 jalr 1458(ra) # 5844 <printf>
exit(1);
329a: 4505 li a0,1
329c: 00002097 auipc ra,0x2
32a0: 230080e7 jalr 560(ra) # 54cc <exit>
printf("%s: mkdir dd/xx/ff succeeded!\n", s);
32a4: 85ca mv a1,s2
32a6: 00004517 auipc a0,0x4
32aa: fd250513 addi a0,a0,-46 # 7278 <l_free+0x1812>
32ae: 00002097 auipc ra,0x2
32b2: 596080e7 jalr 1430(ra) # 5844 <printf>
exit(1);
32b6: 4505 li a0,1
32b8: 00002097 auipc ra,0x2
32bc: 214080e7 jalr 532(ra) # 54cc <exit>
printf("%s: mkdir dd/dd/ffff succeeded!\n", s);
32c0: 85ca mv a1,s2
32c2: 00004517 auipc a0,0x4
32c6: fd650513 addi a0,a0,-42 # 7298 <l_free+0x1832>
32ca: 00002097 auipc ra,0x2
32ce: 57a080e7 jalr 1402(ra) # 5844 <printf>
exit(1);
32d2: 4505 li a0,1
32d4: 00002097 auipc ra,0x2
32d8: 1f8080e7 jalr 504(ra) # 54cc <exit>
printf("%s: unlink dd/xx/ff succeeded!\n", s);
32dc: 85ca mv a1,s2
32de: 00004517 auipc a0,0x4
32e2: fe250513 addi a0,a0,-30 # 72c0 <l_free+0x185a>
32e6: 00002097 auipc ra,0x2
32ea: 55e080e7 jalr 1374(ra) # 5844 <printf>
exit(1);
32ee: 4505 li a0,1
32f0: 00002097 auipc ra,0x2
32f4: 1dc080e7 jalr 476(ra) # 54cc <exit>
printf("%s: unlink dd/ff/ff succeeded!\n", s);
32f8: 85ca mv a1,s2
32fa: 00004517 auipc a0,0x4
32fe: fe650513 addi a0,a0,-26 # 72e0 <l_free+0x187a>
3302: 00002097 auipc ra,0x2
3306: 542080e7 jalr 1346(ra) # 5844 <printf>
exit(1);
330a: 4505 li a0,1
330c: 00002097 auipc ra,0x2
3310: 1c0080e7 jalr 448(ra) # 54cc <exit>
printf("%s: chdir dd/ff succeeded!\n", s);
3314: 85ca mv a1,s2
3316: 00004517 auipc a0,0x4
331a: fea50513 addi a0,a0,-22 # 7300 <l_free+0x189a>
331e: 00002097 auipc ra,0x2
3322: 526080e7 jalr 1318(ra) # 5844 <printf>
exit(1);
3326: 4505 li a0,1
3328: 00002097 auipc ra,0x2
332c: 1a4080e7 jalr 420(ra) # 54cc <exit>
printf("%s: chdir dd/xx succeeded!\n", s);
3330: 85ca mv a1,s2
3332: 00004517 auipc a0,0x4
3336: ff650513 addi a0,a0,-10 # 7328 <l_free+0x18c2>
333a: 00002097 auipc ra,0x2
333e: 50a080e7 jalr 1290(ra) # 5844 <printf>
exit(1);
3342: 4505 li a0,1
3344: 00002097 auipc ra,0x2
3348: 188080e7 jalr 392(ra) # 54cc <exit>
printf("%s: unlink dd/dd/ff failed\n", s);
334c: 85ca mv a1,s2
334e: 00004517 auipc a0,0x4
3352: c7250513 addi a0,a0,-910 # 6fc0 <l_free+0x155a>
3356: 00002097 auipc ra,0x2
335a: 4ee080e7 jalr 1262(ra) # 5844 <printf>
exit(1);
335e: 4505 li a0,1
3360: 00002097 auipc ra,0x2
3364: 16c080e7 jalr 364(ra) # 54cc <exit>
printf("%s: unlink dd/ff failed\n", s);
3368: 85ca mv a1,s2
336a: 00004517 auipc a0,0x4
336e: fde50513 addi a0,a0,-34 # 7348 <l_free+0x18e2>
3372: 00002097 auipc ra,0x2
3376: 4d2080e7 jalr 1234(ra) # 5844 <printf>
exit(1);
337a: 4505 li a0,1
337c: 00002097 auipc ra,0x2
3380: 150080e7 jalr 336(ra) # 54cc <exit>
printf("%s: unlink non-empty dd succeeded!\n", s);
3384: 85ca mv a1,s2
3386: 00004517 auipc a0,0x4
338a: fe250513 addi a0,a0,-30 # 7368 <l_free+0x1902>
338e: 00002097 auipc ra,0x2
3392: 4b6080e7 jalr 1206(ra) # 5844 <printf>
exit(1);
3396: 4505 li a0,1
3398: 00002097 auipc ra,0x2
339c: 134080e7 jalr 308(ra) # 54cc <exit>
printf("%s: unlink dd/dd failed\n", s);
33a0: 85ca mv a1,s2
33a2: 00004517 auipc a0,0x4
33a6: ff650513 addi a0,a0,-10 # 7398 <l_free+0x1932>
33aa: 00002097 auipc ra,0x2
33ae: 49a080e7 jalr 1178(ra) # 5844 <printf>
exit(1);
33b2: 4505 li a0,1
33b4: 00002097 auipc ra,0x2
33b8: 118080e7 jalr 280(ra) # 54cc <exit>
printf("%s: unlink dd failed\n", s);
33bc: 85ca mv a1,s2
33be: 00004517 auipc a0,0x4
33c2: ffa50513 addi a0,a0,-6 # 73b8 <l_free+0x1952>
33c6: 00002097 auipc ra,0x2
33ca: 47e080e7 jalr 1150(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
33ce: 4505 li a0,1
33d0: 00002097 auipc ra,0x2
33d4: 0fc080e7 jalr 252(ra) # 54cc <exit>
00000000000033d8 <rmdot>:
<<<<<<< HEAD
=======
void rmdot(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
33d8: 1101 addi sp,sp,-32
33da: ec06 sd ra,24(sp)
33dc: e822 sd s0,16(sp)
33de: e426 sd s1,8(sp)
33e0: 1000 addi s0,sp,32
33e2: 84aa mv s1,a0
<<<<<<< HEAD
33e4: 00004517 auipc a0,0x4
33e8: fec50513 addi a0,a0,-20 # 73d0 <l_free+0x1968>
33ec: 00002097 auipc ra,0x2
33f0: 148080e7 jalr 328(ra) # 5534 <mkdir>
33f4: e549 bnez a0,347e <rmdot+0xa6>
33f6: 00004517 auipc a0,0x4
33fa: fda50513 addi a0,a0,-38 # 73d0 <l_free+0x1968>
33fe: 00002097 auipc ra,0x2
3402: 13e080e7 jalr 318(ra) # 553c <chdir>
3406: e951 bnez a0,349a <rmdot+0xc2>
3408: 00003517 auipc a0,0x3
340c: f8850513 addi a0,a0,-120 # 6390 <l_free+0x928>
3410: 00002097 auipc ra,0x2
3414: 10c080e7 jalr 268(ra) # 551c <unlink>
3418: cd59 beqz a0,34b6 <rmdot+0xde>
341a: 00004517 auipc a0,0x4
341e: 00650513 addi a0,a0,6 # 7420 <l_free+0x19b8>
3422: 00002097 auipc ra,0x2
3426: 0fa080e7 jalr 250(ra) # 551c <unlink>
342a: c545 beqz a0,34d2 <rmdot+0xfa>
342c: 00004517 auipc a0,0x4
3430: 9fc50513 addi a0,a0,-1540 # 6e28 <l_free+0x13c0>
3434: 00002097 auipc ra,0x2
3438: 108080e7 jalr 264(ra) # 553c <chdir>
343c: e94d bnez a0,34ee <rmdot+0x116>
343e: 00004517 auipc a0,0x4
3442: 00250513 addi a0,a0,2 # 7440 <l_free+0x19d8>
3446: 00002097 auipc ra,0x2
344a: 0d6080e7 jalr 214(ra) # 551c <unlink>
344e: cd55 beqz a0,350a <rmdot+0x132>
3450: 00004517 auipc a0,0x4
3454: 01850513 addi a0,a0,24 # 7468 <l_free+0x1a00>
3458: 00002097 auipc ra,0x2
345c: 0c4080e7 jalr 196(ra) # 551c <unlink>
3460: c179 beqz a0,3526 <rmdot+0x14e>
3462: 00004517 auipc a0,0x4
3466: f6e50513 addi a0,a0,-146 # 73d0 <l_free+0x1968>
346a: 00002097 auipc ra,0x2
346e: 0b2080e7 jalr 178(ra) # 551c <unlink>
3472: e961 bnez a0,3542 <rmdot+0x16a>
=======
if (mkdir("dots") != 0) {
33e4: 00004517 auipc a0,0x4
33e8: fec50513 addi a0,a0,-20 # 73d0 <l_free+0x196a>
33ec: 00002097 auipc ra,0x2
33f0: 148080e7 jalr 328(ra) # 5534 <mkdir>
33f4: e549 bnez a0,347e <rmdot+0xa6>
if (chdir("dots") != 0) {
33f6: 00004517 auipc a0,0x4
33fa: fda50513 addi a0,a0,-38 # 73d0 <l_free+0x196a>
33fe: 00002097 auipc ra,0x2
3402: 13e080e7 jalr 318(ra) # 553c <chdir>
3406: e951 bnez a0,349a <rmdot+0xc2>
if (unlink(".") == 0) {
3408: 00003517 auipc a0,0x3
340c: f8850513 addi a0,a0,-120 # 6390 <l_free+0x92a>
3410: 00002097 auipc ra,0x2
3414: 10c080e7 jalr 268(ra) # 551c <unlink>
3418: cd59 beqz a0,34b6 <rmdot+0xde>
if (unlink("..") == 0) {
341a: 00004517 auipc a0,0x4
341e: 00650513 addi a0,a0,6 # 7420 <l_free+0x19ba>
3422: 00002097 auipc ra,0x2
3426: 0fa080e7 jalr 250(ra) # 551c <unlink>
342a: c545 beqz a0,34d2 <rmdot+0xfa>
if (chdir("/") != 0) {
342c: 00004517 auipc a0,0x4
3430: 9fc50513 addi a0,a0,-1540 # 6e28 <l_free+0x13c2>
3434: 00002097 auipc ra,0x2
3438: 108080e7 jalr 264(ra) # 553c <chdir>
343c: e94d bnez a0,34ee <rmdot+0x116>
if (unlink("dots/.") == 0) {
343e: 00004517 auipc a0,0x4
3442: 00250513 addi a0,a0,2 # 7440 <l_free+0x19da>
3446: 00002097 auipc ra,0x2
344a: 0d6080e7 jalr 214(ra) # 551c <unlink>
344e: cd55 beqz a0,350a <rmdot+0x132>
if (unlink("dots/..") == 0) {
3450: 00004517 auipc a0,0x4
3454: 01850513 addi a0,a0,24 # 7468 <l_free+0x1a02>
3458: 00002097 auipc ra,0x2
345c: 0c4080e7 jalr 196(ra) # 551c <unlink>
3460: c179 beqz a0,3526 <rmdot+0x14e>
if (unlink("dots") != 0) {
3462: 00004517 auipc a0,0x4
3466: f6e50513 addi a0,a0,-146 # 73d0 <l_free+0x196a>
346a: 00002097 auipc ra,0x2
346e: 0b2080e7 jalr 178(ra) # 551c <unlink>
3472: e961 bnez a0,3542 <rmdot+0x16a>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3474: 60e2 ld ra,24(sp)
3476: 6442 ld s0,16(sp)
3478: 64a2 ld s1,8(sp)
347a: 6105 addi sp,sp,32
347c: 8082 ret
<<<<<<< HEAD
347e: 85a6 mv a1,s1
3480: 00004517 auipc a0,0x4
3484: f5850513 addi a0,a0,-168 # 73d8 <l_free+0x1970>
3488: 00002097 auipc ra,0x2
348c: 3be080e7 jalr 958(ra) # 5846 <printf>
3490: 4505 li a0,1
3492: 00002097 auipc ra,0x2
3496: 03a080e7 jalr 58(ra) # 54cc <exit>
349a: 85a6 mv a1,s1
349c: 00004517 auipc a0,0x4
34a0: f5450513 addi a0,a0,-172 # 73f0 <l_free+0x1988>
34a4: 00002097 auipc ra,0x2
34a8: 3a2080e7 jalr 930(ra) # 5846 <printf>
34ac: 4505 li a0,1
34ae: 00002097 auipc ra,0x2
34b2: 01e080e7 jalr 30(ra) # 54cc <exit>
34b6: 85a6 mv a1,s1
34b8: 00004517 auipc a0,0x4
34bc: f5050513 addi a0,a0,-176 # 7408 <l_free+0x19a0>
34c0: 00002097 auipc ra,0x2
34c4: 386080e7 jalr 902(ra) # 5846 <printf>
34c8: 4505 li a0,1
34ca: 00002097 auipc ra,0x2
34ce: 002080e7 jalr 2(ra) # 54cc <exit>
34d2: 85a6 mv a1,s1
34d4: 00004517 auipc a0,0x4
34d8: f5450513 addi a0,a0,-172 # 7428 <l_free+0x19c0>
34dc: 00002097 auipc ra,0x2
34e0: 36a080e7 jalr 874(ra) # 5846 <printf>
34e4: 4505 li a0,1
34e6: 00002097 auipc ra,0x2
34ea: fe6080e7 jalr -26(ra) # 54cc <exit>
34ee: 85a6 mv a1,s1
34f0: 00004517 auipc a0,0x4
34f4: 94050513 addi a0,a0,-1728 # 6e30 <l_free+0x13c8>
34f8: 00002097 auipc ra,0x2
34fc: 34e080e7 jalr 846(ra) # 5846 <printf>
3500: 4505 li a0,1
3502: 00002097 auipc ra,0x2
3506: fca080e7 jalr -54(ra) # 54cc <exit>
350a: 85a6 mv a1,s1
350c: 00004517 auipc a0,0x4
3510: f3c50513 addi a0,a0,-196 # 7448 <l_free+0x19e0>
3514: 00002097 auipc ra,0x2
3518: 332080e7 jalr 818(ra) # 5846 <printf>
351c: 4505 li a0,1
351e: 00002097 auipc ra,0x2
3522: fae080e7 jalr -82(ra) # 54cc <exit>
3526: 85a6 mv a1,s1
3528: 00004517 auipc a0,0x4
352c: f4850513 addi a0,a0,-184 # 7470 <l_free+0x1a08>
3530: 00002097 auipc ra,0x2
3534: 316080e7 jalr 790(ra) # 5846 <printf>
3538: 4505 li a0,1
353a: 00002097 auipc ra,0x2
353e: f92080e7 jalr -110(ra) # 54cc <exit>
3542: 85a6 mv a1,s1
3544: 00004517 auipc a0,0x4
3548: f4c50513 addi a0,a0,-180 # 7490 <l_free+0x1a28>
354c: 00002097 auipc ra,0x2
3550: 2fa080e7 jalr 762(ra) # 5846 <printf>
=======
printf("%s: mkdir dots failed\n", s);
347e: 85a6 mv a1,s1
3480: 00004517 auipc a0,0x4
3484: f5850513 addi a0,a0,-168 # 73d8 <l_free+0x1972>
3488: 00002097 auipc ra,0x2
348c: 3bc080e7 jalr 956(ra) # 5844 <printf>
exit(1);
3490: 4505 li a0,1
3492: 00002097 auipc ra,0x2
3496: 03a080e7 jalr 58(ra) # 54cc <exit>
printf("%s: chdir dots failed\n", s);
349a: 85a6 mv a1,s1
349c: 00004517 auipc a0,0x4
34a0: f5450513 addi a0,a0,-172 # 73f0 <l_free+0x198a>
34a4: 00002097 auipc ra,0x2
34a8: 3a0080e7 jalr 928(ra) # 5844 <printf>
exit(1);
34ac: 4505 li a0,1
34ae: 00002097 auipc ra,0x2
34b2: 01e080e7 jalr 30(ra) # 54cc <exit>
printf("%s: rm . worked!\n", s);
34b6: 85a6 mv a1,s1
34b8: 00004517 auipc a0,0x4
34bc: f5050513 addi a0,a0,-176 # 7408 <l_free+0x19a2>
34c0: 00002097 auipc ra,0x2
34c4: 384080e7 jalr 900(ra) # 5844 <printf>
exit(1);
34c8: 4505 li a0,1
34ca: 00002097 auipc ra,0x2
34ce: 002080e7 jalr 2(ra) # 54cc <exit>
printf("%s: rm .. worked!\n", s);
34d2: 85a6 mv a1,s1
34d4: 00004517 auipc a0,0x4
34d8: f5450513 addi a0,a0,-172 # 7428 <l_free+0x19c2>
34dc: 00002097 auipc ra,0x2
34e0: 368080e7 jalr 872(ra) # 5844 <printf>
exit(1);
34e4: 4505 li a0,1
34e6: 00002097 auipc ra,0x2
34ea: fe6080e7 jalr -26(ra) # 54cc <exit>
printf("%s: chdir / failed\n", s);
34ee: 85a6 mv a1,s1
34f0: 00004517 auipc a0,0x4
34f4: 94050513 addi a0,a0,-1728 # 6e30 <l_free+0x13ca>
34f8: 00002097 auipc ra,0x2
34fc: 34c080e7 jalr 844(ra) # 5844 <printf>
exit(1);
3500: 4505 li a0,1
3502: 00002097 auipc ra,0x2
3506: fca080e7 jalr -54(ra) # 54cc <exit>
printf("%s: unlink dots/. worked!\n", s);
350a: 85a6 mv a1,s1
350c: 00004517 auipc a0,0x4
3510: f3c50513 addi a0,a0,-196 # 7448 <l_free+0x19e2>
3514: 00002097 auipc ra,0x2
3518: 330080e7 jalr 816(ra) # 5844 <printf>
exit(1);
351c: 4505 li a0,1
351e: 00002097 auipc ra,0x2
3522: fae080e7 jalr -82(ra) # 54cc <exit>
printf("%s: unlink dots/.. worked!\n", s);
3526: 85a6 mv a1,s1
3528: 00004517 auipc a0,0x4
352c: f4850513 addi a0,a0,-184 # 7470 <l_free+0x1a0a>
3530: 00002097 auipc ra,0x2
3534: 314080e7 jalr 788(ra) # 5844 <printf>
exit(1);
3538: 4505 li a0,1
353a: 00002097 auipc ra,0x2
353e: f92080e7 jalr -110(ra) # 54cc <exit>
printf("%s: unlink dots failed!\n", s);
3542: 85a6 mv a1,s1
3544: 00004517 auipc a0,0x4
3548: f4c50513 addi a0,a0,-180 # 7490 <l_free+0x1a2a>
354c: 00002097 auipc ra,0x2
3550: 2f8080e7 jalr 760(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3554: 4505 li a0,1
3556: 00002097 auipc ra,0x2
355a: f76080e7 jalr -138(ra) # 54cc <exit>
000000000000355e <dirfile>:
<<<<<<< HEAD
=======
void dirfile(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
355e: 1101 addi sp,sp,-32
3560: ec06 sd ra,24(sp)
3562: e822 sd s0,16(sp)
3564: e426 sd s1,8(sp)
3566: e04a sd s2,0(sp)
3568: 1000 addi s0,sp,32
356a: 892a mv s2,a0
<<<<<<< HEAD
356c: 20000593 li a1,512
3570: 00002517 auipc a0,0x2
3574: 7e850513 addi a0,a0,2024 # 5d58 <l_free+0x2f0>
3578: 00002097 auipc ra,0x2
357c: f94080e7 jalr -108(ra) # 550c <open>
3580: 0e054d63 bltz a0,367a <dirfile+0x11c>
3584: 00002097 auipc ra,0x2
3588: f70080e7 jalr -144(ra) # 54f4 <close>
358c: 00002517 auipc a0,0x2
3590: 7cc50513 addi a0,a0,1996 # 5d58 <l_free+0x2f0>
3594: 00002097 auipc ra,0x2
3598: fa8080e7 jalr -88(ra) # 553c <chdir>
359c: cd6d beqz a0,3696 <dirfile+0x138>
359e: 4581 li a1,0
35a0: 00004517 auipc a0,0x4
35a4: f5050513 addi a0,a0,-176 # 74f0 <l_free+0x1a88>
35a8: 00002097 auipc ra,0x2
35ac: f64080e7 jalr -156(ra) # 550c <open>
35b0: 10055163 bgez a0,36b2 <dirfile+0x154>
35b4: 20000593 li a1,512
35b8: 00004517 auipc a0,0x4
35bc: f3850513 addi a0,a0,-200 # 74f0 <l_free+0x1a88>
35c0: 00002097 auipc ra,0x2
35c4: f4c080e7 jalr -180(ra) # 550c <open>
35c8: 10055363 bgez a0,36ce <dirfile+0x170>
35cc: 00004517 auipc a0,0x4
35d0: f2450513 addi a0,a0,-220 # 74f0 <l_free+0x1a88>
35d4: 00002097 auipc ra,0x2
35d8: f60080e7 jalr -160(ra) # 5534 <mkdir>
35dc: 10050763 beqz a0,36ea <dirfile+0x18c>
35e0: 00004517 auipc a0,0x4
35e4: f1050513 addi a0,a0,-240 # 74f0 <l_free+0x1a88>
35e8: 00002097 auipc ra,0x2
35ec: f34080e7 jalr -204(ra) # 551c <unlink>
35f0: 10050b63 beqz a0,3706 <dirfile+0x1a8>
35f4: 00004597 auipc a1,0x4
35f8: efc58593 addi a1,a1,-260 # 74f0 <l_free+0x1a88>
35fc: 00003517 auipc a0,0x3
3600: 98450513 addi a0,a0,-1660 # 5f80 <l_free+0x518>
3604: 00002097 auipc ra,0x2
3608: f28080e7 jalr -216(ra) # 552c <link>
360c: 10050b63 beqz a0,3722 <dirfile+0x1c4>
3610: 00002517 auipc a0,0x2
3614: 74850513 addi a0,a0,1864 # 5d58 <l_free+0x2f0>
3618: 00002097 auipc ra,0x2
361c: f04080e7 jalr -252(ra) # 551c <unlink>
3620: 10051f63 bnez a0,373e <dirfile+0x1e0>
3624: 4589 li a1,2
3626: 00003517 auipc a0,0x3
362a: d6a50513 addi a0,a0,-662 # 6390 <l_free+0x928>
362e: 00002097 auipc ra,0x2
3632: ede080e7 jalr -290(ra) # 550c <open>
3636: 12055263 bgez a0,375a <dirfile+0x1fc>
363a: 4581 li a1,0
363c: 00003517 auipc a0,0x3
3640: d5450513 addi a0,a0,-684 # 6390 <l_free+0x928>
3644: 00002097 auipc ra,0x2
3648: ec8080e7 jalr -312(ra) # 550c <open>
364c: 84aa mv s1,a0
364e: 4605 li a2,1
3650: 00002597 auipc a1,0x2
3654: 7d858593 addi a1,a1,2008 # 5e28 <l_free+0x3c0>
3658: 00002097 auipc ra,0x2
365c: e94080e7 jalr -364(ra) # 54ec <write>
3660: 10a04b63 bgtz a0,3776 <dirfile+0x218>
3664: 8526 mv a0,s1
3666: 00002097 auipc ra,0x2
366a: e8e080e7 jalr -370(ra) # 54f4 <close>
=======
fd = open("dirfile", O_CREATE);
356c: 20000593 li a1,512
3570: 00002517 auipc a0,0x2
3574: 7e850513 addi a0,a0,2024 # 5d58 <l_free+0x2f2>
3578: 00002097 auipc ra,0x2
357c: f94080e7 jalr -108(ra) # 550c <open>
if (fd < 0) {
3580: 0e054d63 bltz a0,367a <dirfile+0x11c>
close(fd);
3584: 00002097 auipc ra,0x2
3588: f70080e7 jalr -144(ra) # 54f4 <close>
if (chdir("dirfile") == 0) {
358c: 00002517 auipc a0,0x2
3590: 7cc50513 addi a0,a0,1996 # 5d58 <l_free+0x2f2>
3594: 00002097 auipc ra,0x2
3598: fa8080e7 jalr -88(ra) # 553c <chdir>
359c: cd6d beqz a0,3696 <dirfile+0x138>
fd = open("dirfile/xx", 0);
359e: 4581 li a1,0
35a0: 00004517 auipc a0,0x4
35a4: f5050513 addi a0,a0,-176 # 74f0 <l_free+0x1a8a>
35a8: 00002097 auipc ra,0x2
35ac: f64080e7 jalr -156(ra) # 550c <open>
if (fd >= 0) {
35b0: 10055163 bgez a0,36b2 <dirfile+0x154>
fd = open("dirfile/xx", O_CREATE);
35b4: 20000593 li a1,512
35b8: 00004517 auipc a0,0x4
35bc: f3850513 addi a0,a0,-200 # 74f0 <l_free+0x1a8a>
35c0: 00002097 auipc ra,0x2
35c4: f4c080e7 jalr -180(ra) # 550c <open>
if (fd >= 0) {
35c8: 10055363 bgez a0,36ce <dirfile+0x170>
if (mkdir("dirfile/xx") == 0) {
35cc: 00004517 auipc a0,0x4
35d0: f2450513 addi a0,a0,-220 # 74f0 <l_free+0x1a8a>
35d4: 00002097 auipc ra,0x2
35d8: f60080e7 jalr -160(ra) # 5534 <mkdir>
35dc: 10050763 beqz a0,36ea <dirfile+0x18c>
if (unlink("dirfile/xx") == 0) {
35e0: 00004517 auipc a0,0x4
35e4: f1050513 addi a0,a0,-240 # 74f0 <l_free+0x1a8a>
35e8: 00002097 auipc ra,0x2
35ec: f34080e7 jalr -204(ra) # 551c <unlink>
35f0: 10050b63 beqz a0,3706 <dirfile+0x1a8>
if (link("README", "dirfile/xx") == 0) {
35f4: 00004597 auipc a1,0x4
35f8: efc58593 addi a1,a1,-260 # 74f0 <l_free+0x1a8a>
35fc: 00003517 auipc a0,0x3
3600: 98450513 addi a0,a0,-1660 # 5f80 <l_free+0x51a>
3604: 00002097 auipc ra,0x2
3608: f28080e7 jalr -216(ra) # 552c <link>
360c: 10050b63 beqz a0,3722 <dirfile+0x1c4>
if (unlink("dirfile") != 0) {
3610: 00002517 auipc a0,0x2
3614: 74850513 addi a0,a0,1864 # 5d58 <l_free+0x2f2>
3618: 00002097 auipc ra,0x2
361c: f04080e7 jalr -252(ra) # 551c <unlink>
3620: 10051f63 bnez a0,373e <dirfile+0x1e0>
fd = open(".", O_RDWR);
3624: 4589 li a1,2
3626: 00003517 auipc a0,0x3
362a: d6a50513 addi a0,a0,-662 # 6390 <l_free+0x92a>
362e: 00002097 auipc ra,0x2
3632: ede080e7 jalr -290(ra) # 550c <open>
if (fd >= 0) {
3636: 12055263 bgez a0,375a <dirfile+0x1fc>
fd = open(".", 0);
363a: 4581 li a1,0
363c: 00003517 auipc a0,0x3
3640: d5450513 addi a0,a0,-684 # 6390 <l_free+0x92a>
3644: 00002097 auipc ra,0x2
3648: ec8080e7 jalr -312(ra) # 550c <open>
364c: 84aa mv s1,a0
if (write(fd, "x", 1) > 0) {
364e: 4605 li a2,1
3650: 00002597 auipc a1,0x2
3654: 7d858593 addi a1,a1,2008 # 5e28 <l_free+0x3c2>
3658: 00002097 auipc ra,0x2
365c: e94080e7 jalr -364(ra) # 54ec <write>
3660: 10a04b63 bgtz a0,3776 <dirfile+0x218>
close(fd);
3664: 8526 mv a0,s1
3666: 00002097 auipc ra,0x2
366a: e8e080e7 jalr -370(ra) # 54f4 <close>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
366e: 60e2 ld ra,24(sp)
3670: 6442 ld s0,16(sp)
3672: 64a2 ld s1,8(sp)
3674: 6902 ld s2,0(sp)
3676: 6105 addi sp,sp,32
3678: 8082 ret
<<<<<<< HEAD
367a: 85ca mv a1,s2
367c: 00004517 auipc a0,0x4
3680: e3450513 addi a0,a0,-460 # 74b0 <l_free+0x1a48>
3684: 00002097 auipc ra,0x2
3688: 1c2080e7 jalr 450(ra) # 5846 <printf>
368c: 4505 li a0,1
368e: 00002097 auipc ra,0x2
3692: e3e080e7 jalr -450(ra) # 54cc <exit>
3696: 85ca mv a1,s2
3698: 00004517 auipc a0,0x4
369c: e3850513 addi a0,a0,-456 # 74d0 <l_free+0x1a68>
36a0: 00002097 auipc ra,0x2
36a4: 1a6080e7 jalr 422(ra) # 5846 <printf>
36a8: 4505 li a0,1
36aa: 00002097 auipc ra,0x2
36ae: e22080e7 jalr -478(ra) # 54cc <exit>
36b2: 85ca mv a1,s2
36b4: 00004517 auipc a0,0x4
36b8: e4c50513 addi a0,a0,-436 # 7500 <l_free+0x1a98>
36bc: 00002097 auipc ra,0x2
36c0: 18a080e7 jalr 394(ra) # 5846 <printf>
36c4: 4505 li a0,1
36c6: 00002097 auipc ra,0x2
36ca: e06080e7 jalr -506(ra) # 54cc <exit>
36ce: 85ca mv a1,s2
36d0: 00004517 auipc a0,0x4
36d4: e3050513 addi a0,a0,-464 # 7500 <l_free+0x1a98>
36d8: 00002097 auipc ra,0x2
36dc: 16e080e7 jalr 366(ra) # 5846 <printf>
36e0: 4505 li a0,1
36e2: 00002097 auipc ra,0x2
36e6: dea080e7 jalr -534(ra) # 54cc <exit>
36ea: 85ca mv a1,s2
36ec: 00004517 auipc a0,0x4
36f0: e3c50513 addi a0,a0,-452 # 7528 <l_free+0x1ac0>
36f4: 00002097 auipc ra,0x2
36f8: 152080e7 jalr 338(ra) # 5846 <printf>
36fc: 4505 li a0,1
36fe: 00002097 auipc ra,0x2
3702: dce080e7 jalr -562(ra) # 54cc <exit>
3706: 85ca mv a1,s2
3708: 00004517 auipc a0,0x4
370c: e4850513 addi a0,a0,-440 # 7550 <l_free+0x1ae8>
3710: 00002097 auipc ra,0x2
3714: 136080e7 jalr 310(ra) # 5846 <printf>
3718: 4505 li a0,1
371a: 00002097 auipc ra,0x2
371e: db2080e7 jalr -590(ra) # 54cc <exit>
3722: 85ca mv a1,s2
3724: 00004517 auipc a0,0x4
3728: e5450513 addi a0,a0,-428 # 7578 <l_free+0x1b10>
372c: 00002097 auipc ra,0x2
3730: 11a080e7 jalr 282(ra) # 5846 <printf>
3734: 4505 li a0,1
3736: 00002097 auipc ra,0x2
373a: d96080e7 jalr -618(ra) # 54cc <exit>
373e: 85ca mv a1,s2
3740: 00004517 auipc a0,0x4
3744: e6050513 addi a0,a0,-416 # 75a0 <l_free+0x1b38>
3748: 00002097 auipc ra,0x2
374c: 0fe080e7 jalr 254(ra) # 5846 <printf>
3750: 4505 li a0,1
3752: 00002097 auipc ra,0x2
3756: d7a080e7 jalr -646(ra) # 54cc <exit>
375a: 85ca mv a1,s2
375c: 00004517 auipc a0,0x4
3760: e6450513 addi a0,a0,-412 # 75c0 <l_free+0x1b58>
3764: 00002097 auipc ra,0x2
3768: 0e2080e7 jalr 226(ra) # 5846 <printf>
376c: 4505 li a0,1
376e: 00002097 auipc ra,0x2
3772: d5e080e7 jalr -674(ra) # 54cc <exit>
3776: 85ca mv a1,s2
3778: 00004517 auipc a0,0x4
377c: e7050513 addi a0,a0,-400 # 75e8 <l_free+0x1b80>
3780: 00002097 auipc ra,0x2
3784: 0c6080e7 jalr 198(ra) # 5846 <printf>
=======
printf("%s: create dirfile failed\n", s);
367a: 85ca mv a1,s2
367c: 00004517 auipc a0,0x4
3680: e3450513 addi a0,a0,-460 # 74b0 <l_free+0x1a4a>
3684: 00002097 auipc ra,0x2
3688: 1c0080e7 jalr 448(ra) # 5844 <printf>
exit(1);
368c: 4505 li a0,1
368e: 00002097 auipc ra,0x2
3692: e3e080e7 jalr -450(ra) # 54cc <exit>
printf("%s: chdir dirfile succeeded!\n", s);
3696: 85ca mv a1,s2
3698: 00004517 auipc a0,0x4
369c: e3850513 addi a0,a0,-456 # 74d0 <l_free+0x1a6a>
36a0: 00002097 auipc ra,0x2
36a4: 1a4080e7 jalr 420(ra) # 5844 <printf>
exit(1);
36a8: 4505 li a0,1
36aa: 00002097 auipc ra,0x2
36ae: e22080e7 jalr -478(ra) # 54cc <exit>
printf("%s: create dirfile/xx succeeded!\n", s);
36b2: 85ca mv a1,s2
36b4: 00004517 auipc a0,0x4
36b8: e4c50513 addi a0,a0,-436 # 7500 <l_free+0x1a9a>
36bc: 00002097 auipc ra,0x2
36c0: 188080e7 jalr 392(ra) # 5844 <printf>
exit(1);
36c4: 4505 li a0,1
36c6: 00002097 auipc ra,0x2
36ca: e06080e7 jalr -506(ra) # 54cc <exit>
printf("%s: create dirfile/xx succeeded!\n", s);
36ce: 85ca mv a1,s2
36d0: 00004517 auipc a0,0x4
36d4: e3050513 addi a0,a0,-464 # 7500 <l_free+0x1a9a>
36d8: 00002097 auipc ra,0x2
36dc: 16c080e7 jalr 364(ra) # 5844 <printf>
exit(1);
36e0: 4505 li a0,1
36e2: 00002097 auipc ra,0x2
36e6: dea080e7 jalr -534(ra) # 54cc <exit>
printf("%s: mkdir dirfile/xx succeeded!\n", s);
36ea: 85ca mv a1,s2
36ec: 00004517 auipc a0,0x4
36f0: e3c50513 addi a0,a0,-452 # 7528 <l_free+0x1ac2>
36f4: 00002097 auipc ra,0x2
36f8: 150080e7 jalr 336(ra) # 5844 <printf>
exit(1);
36fc: 4505 li a0,1
36fe: 00002097 auipc ra,0x2
3702: dce080e7 jalr -562(ra) # 54cc <exit>
printf("%s: unlink dirfile/xx succeeded!\n", s);
3706: 85ca mv a1,s2
3708: 00004517 auipc a0,0x4
370c: e4850513 addi a0,a0,-440 # 7550 <l_free+0x1aea>
3710: 00002097 auipc ra,0x2
3714: 134080e7 jalr 308(ra) # 5844 <printf>
exit(1);
3718: 4505 li a0,1
371a: 00002097 auipc ra,0x2
371e: db2080e7 jalr -590(ra) # 54cc <exit>
printf("%s: link to dirfile/xx succeeded!\n", s);
3722: 85ca mv a1,s2
3724: 00004517 auipc a0,0x4
3728: e5450513 addi a0,a0,-428 # 7578 <l_free+0x1b12>
372c: 00002097 auipc ra,0x2
3730: 118080e7 jalr 280(ra) # 5844 <printf>
exit(1);
3734: 4505 li a0,1
3736: 00002097 auipc ra,0x2
373a: d96080e7 jalr -618(ra) # 54cc <exit>
printf("%s: unlink dirfile failed!\n", s);
373e: 85ca mv a1,s2
3740: 00004517 auipc a0,0x4
3744: e6050513 addi a0,a0,-416 # 75a0 <l_free+0x1b3a>
3748: 00002097 auipc ra,0x2
374c: 0fc080e7 jalr 252(ra) # 5844 <printf>
exit(1);
3750: 4505 li a0,1
3752: 00002097 auipc ra,0x2
3756: d7a080e7 jalr -646(ra) # 54cc <exit>
printf("%s: open . for writing succeeded!\n", s);
375a: 85ca mv a1,s2
375c: 00004517 auipc a0,0x4
3760: e6450513 addi a0,a0,-412 # 75c0 <l_free+0x1b5a>
3764: 00002097 auipc ra,0x2
3768: 0e0080e7 jalr 224(ra) # 5844 <printf>
exit(1);
376c: 4505 li a0,1
376e: 00002097 auipc ra,0x2
3772: d5e080e7 jalr -674(ra) # 54cc <exit>
printf("%s: write . succeeded!\n", s);
3776: 85ca mv a1,s2
3778: 00004517 auipc a0,0x4
377c: e7050513 addi a0,a0,-400 # 75e8 <l_free+0x1b82>
3780: 00002097 auipc ra,0x2
3784: 0c4080e7 jalr 196(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3788: 4505 li a0,1
378a: 00002097 auipc ra,0x2
378e: d42080e7 jalr -702(ra) # 54cc <exit>
0000000000003792 <iref>:
<<<<<<< HEAD
=======
void iref(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3792: 7139 addi sp,sp,-64
3794: fc06 sd ra,56(sp)
3796: f822 sd s0,48(sp)
3798: f426 sd s1,40(sp)
379a: f04a sd s2,32(sp)
379c: ec4e sd s3,24(sp)
379e: e852 sd s4,16(sp)
37a0: e456 sd s5,8(sp)
37a2: e05a sd s6,0(sp)
37a4: 0080 addi s0,sp,64
37a6: 8b2a mv s6,a0
37a8: 03300913 li s2,51
<<<<<<< HEAD
37ac: 00004a17 auipc s4,0x4
37b0: e54a0a13 addi s4,s4,-428 # 7600 <l_free+0x1b98>
37b4: 00004497 auipc s1,0x4
37b8: 95448493 addi s1,s1,-1708 # 7108 <l_free+0x16a0>
37bc: 00002a97 auipc s5,0x2
37c0: 7c4a8a93 addi s5,s5,1988 # 5f80 <l_free+0x518>
37c4: 00004997 auipc s3,0x4
37c8: d3498993 addi s3,s3,-716 # 74f8 <l_free+0x1a90>
37cc: a891 j 3820 <iref+0x8e>
37ce: 85da mv a1,s6
37d0: 00004517 auipc a0,0x4
37d4: e3850513 addi a0,a0,-456 # 7608 <l_free+0x1ba0>
37d8: 00002097 auipc ra,0x2
37dc: 06e080e7 jalr 110(ra) # 5846 <printf>
37e0: 4505 li a0,1
37e2: 00002097 auipc ra,0x2
37e6: cea080e7 jalr -790(ra) # 54cc <exit>
37ea: 85da mv a1,s6
37ec: 00004517 auipc a0,0x4
37f0: e3450513 addi a0,a0,-460 # 7620 <l_free+0x1bb8>
37f4: 00002097 auipc ra,0x2
37f8: 052080e7 jalr 82(ra) # 5846 <printf>
37fc: 4505 li a0,1
37fe: 00002097 auipc ra,0x2
3802: cce080e7 jalr -818(ra) # 54cc <exit>
3806: 00002097 auipc ra,0x2
380a: cee080e7 jalr -786(ra) # 54f4 <close>
380e: a889 j 3860 <iref+0xce>
3810: 854e mv a0,s3
3812: 00002097 auipc ra,0x2
3816: d0a080e7 jalr -758(ra) # 551c <unlink>
381a: 397d addiw s2,s2,-1
381c: 06090063 beqz s2,387c <iref+0xea>
=======
if (mkdir("irefd") != 0) {
37ac: 00004a17 auipc s4,0x4
37b0: e54a0a13 addi s4,s4,-428 # 7600 <l_free+0x1b9a>
mkdir("");
37b4: 00004497 auipc s1,0x4
37b8: 95448493 addi s1,s1,-1708 # 7108 <l_free+0x16a2>
link("README", "");
37bc: 00002a97 auipc s5,0x2
37c0: 7c4a8a93 addi s5,s5,1988 # 5f80 <l_free+0x51a>
fd = open("xx", O_CREATE);
37c4: 00004997 auipc s3,0x4
37c8: d3498993 addi s3,s3,-716 # 74f8 <l_free+0x1a92>
37cc: a891 j 3820 <iref+0x8e>
printf("%s: mkdir irefd failed\n", s);
37ce: 85da mv a1,s6
37d0: 00004517 auipc a0,0x4
37d4: e3850513 addi a0,a0,-456 # 7608 <l_free+0x1ba2>
37d8: 00002097 auipc ra,0x2
37dc: 06c080e7 jalr 108(ra) # 5844 <printf>
exit(1);
37e0: 4505 li a0,1
37e2: 00002097 auipc ra,0x2
37e6: cea080e7 jalr -790(ra) # 54cc <exit>
printf("%s: chdir irefd failed\n", s);
37ea: 85da mv a1,s6
37ec: 00004517 auipc a0,0x4
37f0: e3450513 addi a0,a0,-460 # 7620 <l_free+0x1bba>
37f4: 00002097 auipc ra,0x2
37f8: 050080e7 jalr 80(ra) # 5844 <printf>
exit(1);
37fc: 4505 li a0,1
37fe: 00002097 auipc ra,0x2
3802: cce080e7 jalr -818(ra) # 54cc <exit>
close(fd);
3806: 00002097 auipc ra,0x2
380a: cee080e7 jalr -786(ra) # 54f4 <close>
380e: a889 j 3860 <iref+0xce>
unlink("xx");
3810: 854e mv a0,s3
3812: 00002097 auipc ra,0x2
3816: d0a080e7 jalr -758(ra) # 551c <unlink>
for (i = 0; i < NINODE + 1; i++) {
381a: 397d addiw s2,s2,-1
381c: 06090063 beqz s2,387c <iref+0xea>
if (mkdir("irefd") != 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3820: 8552 mv a0,s4
3822: 00002097 auipc ra,0x2
3826: d12080e7 jalr -750(ra) # 5534 <mkdir>
382a: f155 bnez a0,37ce <iref+0x3c>
<<<<<<< HEAD
=======
if (chdir("irefd") != 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
382c: 8552 mv a0,s4
382e: 00002097 auipc ra,0x2
3832: d0e080e7 jalr -754(ra) # 553c <chdir>
3836: f955 bnez a0,37ea <iref+0x58>
<<<<<<< HEAD
3838: 8526 mv a0,s1
383a: 00002097 auipc ra,0x2
383e: cfa080e7 jalr -774(ra) # 5534 <mkdir>
=======
mkdir("");
3838: 8526 mv a0,s1
383a: 00002097 auipc ra,0x2
383e: cfa080e7 jalr -774(ra) # 5534 <mkdir>
link("README", "");
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3842: 85a6 mv a1,s1
3844: 8556 mv a0,s5
3846: 00002097 auipc ra,0x2
384a: ce6080e7 jalr -794(ra) # 552c <link>
<<<<<<< HEAD
=======
fd = open("", O_CREATE);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
384e: 20000593 li a1,512
3852: 8526 mv a0,s1
3854: 00002097 auipc ra,0x2
3858: cb8080e7 jalr -840(ra) # 550c <open>
<<<<<<< HEAD
385c: fa0555e3 bgez a0,3806 <iref+0x74>
=======
if (fd >= 0)
385c: fa0555e3 bgez a0,3806 <iref+0x74>
fd = open("xx", O_CREATE);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3860: 20000593 li a1,512
3864: 854e mv a0,s3
3866: 00002097 auipc ra,0x2
386a: ca6080e7 jalr -858(ra) # 550c <open>
<<<<<<< HEAD
386e: fa0541e3 bltz a0,3810 <iref+0x7e>
=======
if (fd >= 0)
386e: fa0541e3 bltz a0,3810 <iref+0x7e>
close(fd);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3872: 00002097 auipc ra,0x2
3876: c82080e7 jalr -894(ra) # 54f4 <close>
387a: bf59 j 3810 <iref+0x7e>
387c: 03300493 li s1,51
<<<<<<< HEAD
3880: 00004997 auipc s3,0x4
3884: ba098993 addi s3,s3,-1120 # 7420 <l_free+0x19b8>
3888: 00004917 auipc s2,0x4
388c: d7890913 addi s2,s2,-648 # 7600 <l_free+0x1b98>
3890: 854e mv a0,s3
3892: 00002097 auipc ra,0x2
3896: caa080e7 jalr -854(ra) # 553c <chdir>
389a: 854a mv a0,s2
389c: 00002097 auipc ra,0x2
38a0: c80080e7 jalr -896(ra) # 551c <unlink>
38a4: 34fd addiw s1,s1,-1
38a6: f4ed bnez s1,3890 <iref+0xfe>
38a8: 00003517 auipc a0,0x3
38ac: 58050513 addi a0,a0,1408 # 6e28 <l_free+0x13c0>
38b0: 00002097 auipc ra,0x2
38b4: c8c080e7 jalr -884(ra) # 553c <chdir>
=======
chdir("..");
3880: 00004997 auipc s3,0x4
3884: ba098993 addi s3,s3,-1120 # 7420 <l_free+0x19ba>
unlink("irefd");
3888: 00004917 auipc s2,0x4
388c: d7890913 addi s2,s2,-648 # 7600 <l_free+0x1b9a>
chdir("..");
3890: 854e mv a0,s3
3892: 00002097 auipc ra,0x2
3896: caa080e7 jalr -854(ra) # 553c <chdir>
unlink("irefd");
389a: 854a mv a0,s2
389c: 00002097 auipc ra,0x2
38a0: c80080e7 jalr -896(ra) # 551c <unlink>
for (i = 0; i < NINODE + 1; i++) {
38a4: 34fd addiw s1,s1,-1
38a6: f4ed bnez s1,3890 <iref+0xfe>
chdir("/");
38a8: 00003517 auipc a0,0x3
38ac: 58050513 addi a0,a0,1408 # 6e28 <l_free+0x13c2>
38b0: 00002097 auipc ra,0x2
38b4: c8c080e7 jalr -884(ra) # 553c <chdir>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
38b8: 70e2 ld ra,56(sp)
38ba: 7442 ld s0,48(sp)
38bc: 74a2 ld s1,40(sp)
38be: 7902 ld s2,32(sp)
38c0: 69e2 ld s3,24(sp)
38c2: 6a42 ld s4,16(sp)
38c4: 6aa2 ld s5,8(sp)
38c6: 6b02 ld s6,0(sp)
38c8: 6121 addi sp,sp,64
38ca: 8082 ret
00000000000038cc <openiputtest>:
<<<<<<< HEAD
=======
void openiputtest(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
38cc: 7179 addi sp,sp,-48
38ce: f406 sd ra,40(sp)
38d0: f022 sd s0,32(sp)
38d2: ec26 sd s1,24(sp)
38d4: 1800 addi s0,sp,48
38d6: 84aa mv s1,a0
<<<<<<< HEAD
38d8: 00004517 auipc a0,0x4
38dc: d6050513 addi a0,a0,-672 # 7638 <l_free+0x1bd0>
38e0: 00002097 auipc ra,0x2
38e4: c54080e7 jalr -940(ra) # 5534 <mkdir>
38e8: 04054263 bltz a0,392c <openiputtest+0x60>
38ec: 00002097 auipc ra,0x2
38f0: bd8080e7 jalr -1064(ra) # 54c4 <fork>
38f4: 04054a63 bltz a0,3948 <openiputtest+0x7c>
38f8: e93d bnez a0,396e <openiputtest+0xa2>
38fa: 4589 li a1,2
38fc: 00004517 auipc a0,0x4
3900: d3c50513 addi a0,a0,-708 # 7638 <l_free+0x1bd0>
3904: 00002097 auipc ra,0x2
3908: c08080e7 jalr -1016(ra) # 550c <open>
390c: 04054c63 bltz a0,3964 <openiputtest+0x98>
3910: 85a6 mv a1,s1
3912: 00004517 auipc a0,0x4
3916: d4650513 addi a0,a0,-698 # 7658 <l_free+0x1bf0>
391a: 00002097 auipc ra,0x2
391e: f2c080e7 jalr -212(ra) # 5846 <printf>
3922: 4505 li a0,1
3924: 00002097 auipc ra,0x2
3928: ba8080e7 jalr -1112(ra) # 54cc <exit>
392c: 85a6 mv a1,s1
392e: 00004517 auipc a0,0x4
3932: d1250513 addi a0,a0,-750 # 7640 <l_free+0x1bd8>
3936: 00002097 auipc ra,0x2
393a: f10080e7 jalr -240(ra) # 5846 <printf>
393e: 4505 li a0,1
3940: 00002097 auipc ra,0x2
3944: b8c080e7 jalr -1140(ra) # 54cc <exit>
3948: 85a6 mv a1,s1
394a: 00003517 auipc a0,0x3
394e: be650513 addi a0,a0,-1050 # 6530 <l_free+0xac8>
3952: 00002097 auipc ra,0x2
3956: ef4080e7 jalr -268(ra) # 5846 <printf>
395a: 4505 li a0,1
395c: 00002097 auipc ra,0x2
3960: b70080e7 jalr -1168(ra) # 54cc <exit>
3964: 4501 li a0,0
3966: 00002097 auipc ra,0x2
396a: b66080e7 jalr -1178(ra) # 54cc <exit>
396e: 4505 li a0,1
3970: 00002097 auipc ra,0x2
3974: bec080e7 jalr -1044(ra) # 555c <sleep>
3978: 00004517 auipc a0,0x4
397c: cc050513 addi a0,a0,-832 # 7638 <l_free+0x1bd0>
3980: 00002097 auipc ra,0x2
3984: b9c080e7 jalr -1124(ra) # 551c <unlink>
3988: cd19 beqz a0,39a6 <openiputtest+0xda>
398a: 85a6 mv a1,s1
398c: 00003517 auipc a0,0x3
3990: d9450513 addi a0,a0,-620 # 6720 <l_free+0xcb8>
3994: 00002097 auipc ra,0x2
3998: eb2080e7 jalr -334(ra) # 5846 <printf>
399c: 4505 li a0,1
399e: 00002097 auipc ra,0x2
39a2: b2e080e7 jalr -1234(ra) # 54cc <exit>
39a6: fdc40513 addi a0,s0,-36
39aa: 00002097 auipc ra,0x2
39ae: b2a080e7 jalr -1238(ra) # 54d4 <wait>
=======
if (mkdir("oidir") < 0) {
38d8: 00004517 auipc a0,0x4
38dc: d6050513 addi a0,a0,-672 # 7638 <l_free+0x1bd2>
38e0: 00002097 auipc ra,0x2
38e4: c54080e7 jalr -940(ra) # 5534 <mkdir>
38e8: 04054263 bltz a0,392c <openiputtest+0x60>
pid = fork();
38ec: 00002097 auipc ra,0x2
38f0: bd8080e7 jalr -1064(ra) # 54c4 <fork>
if (pid < 0) {
38f4: 04054a63 bltz a0,3948 <openiputtest+0x7c>
if (pid == 0) {
38f8: e93d bnez a0,396e <openiputtest+0xa2>
int fd = open("oidir", O_RDWR);
38fa: 4589 li a1,2
38fc: 00004517 auipc a0,0x4
3900: d3c50513 addi a0,a0,-708 # 7638 <l_free+0x1bd2>
3904: 00002097 auipc ra,0x2
3908: c08080e7 jalr -1016(ra) # 550c <open>
if (fd >= 0) {
390c: 04054c63 bltz a0,3964 <openiputtest+0x98>
printf("%s: open directory for write succeeded\n", s);
3910: 85a6 mv a1,s1
3912: 00004517 auipc a0,0x4
3916: d4650513 addi a0,a0,-698 # 7658 <l_free+0x1bf2>
391a: 00002097 auipc ra,0x2
391e: f2a080e7 jalr -214(ra) # 5844 <printf>
exit(1);
3922: 4505 li a0,1
3924: 00002097 auipc ra,0x2
3928: ba8080e7 jalr -1112(ra) # 54cc <exit>
printf("%s: mkdir oidir failed\n", s);
392c: 85a6 mv a1,s1
392e: 00004517 auipc a0,0x4
3932: d1250513 addi a0,a0,-750 # 7640 <l_free+0x1bda>
3936: 00002097 auipc ra,0x2
393a: f0e080e7 jalr -242(ra) # 5844 <printf>
exit(1);
393e: 4505 li a0,1
3940: 00002097 auipc ra,0x2
3944: b8c080e7 jalr -1140(ra) # 54cc <exit>
printf("%s: fork failed\n", s);
3948: 85a6 mv a1,s1
394a: 00003517 auipc a0,0x3
394e: be650513 addi a0,a0,-1050 # 6530 <l_free+0xaca>
3952: 00002097 auipc ra,0x2
3956: ef2080e7 jalr -270(ra) # 5844 <printf>
exit(1);
395a: 4505 li a0,1
395c: 00002097 auipc ra,0x2
3960: b70080e7 jalr -1168(ra) # 54cc <exit>
exit(0);
3964: 4501 li a0,0
3966: 00002097 auipc ra,0x2
396a: b66080e7 jalr -1178(ra) # 54cc <exit>
sleep(1);
396e: 4505 li a0,1
3970: 00002097 auipc ra,0x2
3974: bec080e7 jalr -1044(ra) # 555c <sleep>
if (unlink("oidir") != 0) {
3978: 00004517 auipc a0,0x4
397c: cc050513 addi a0,a0,-832 # 7638 <l_free+0x1bd2>
3980: 00002097 auipc ra,0x2
3984: b9c080e7 jalr -1124(ra) # 551c <unlink>
3988: cd19 beqz a0,39a6 <openiputtest+0xda>
printf("%s: unlink failed\n", s);
398a: 85a6 mv a1,s1
398c: 00003517 auipc a0,0x3
3990: d9450513 addi a0,a0,-620 # 6720 <l_free+0xcba>
3994: 00002097 auipc ra,0x2
3998: eb0080e7 jalr -336(ra) # 5844 <printf>
exit(1);
399c: 4505 li a0,1
399e: 00002097 auipc ra,0x2
39a2: b2e080e7 jalr -1234(ra) # 54cc <exit>
wait(&xstatus);
39a6: fdc40513 addi a0,s0,-36
39aa: 00002097 auipc ra,0x2
39ae: b2a080e7 jalr -1238(ra) # 54d4 <wait>
exit(xstatus);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
39b2: fdc42503 lw a0,-36(s0)
39b6: 00002097 auipc ra,0x2
39ba: b16080e7 jalr -1258(ra) # 54cc <exit>
00000000000039be <forkforkfork>:
<<<<<<< HEAD
=======
void forkforkfork(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
39be: 1101 addi sp,sp,-32
39c0: ec06 sd ra,24(sp)
39c2: e822 sd s0,16(sp)
39c4: e426 sd s1,8(sp)
39c6: 1000 addi s0,sp,32
39c8: 84aa mv s1,a0
<<<<<<< HEAD
39ca: 00004517 auipc a0,0x4
39ce: cb650513 addi a0,a0,-842 # 7680 <l_free+0x1c18>
39d2: 00002097 auipc ra,0x2
39d6: b4a080e7 jalr -1206(ra) # 551c <unlink>
39da: 00002097 auipc ra,0x2
39de: aea080e7 jalr -1302(ra) # 54c4 <fork>
39e2: 04054563 bltz a0,3a2c <forkforkfork+0x6e>
39e6: c12d beqz a0,3a48 <forkforkfork+0x8a>
39e8: 4551 li a0,20
39ea: 00002097 auipc ra,0x2
39ee: b72080e7 jalr -1166(ra) # 555c <sleep>
39f2: 20200593 li a1,514
39f6: 00004517 auipc a0,0x4
39fa: c8a50513 addi a0,a0,-886 # 7680 <l_free+0x1c18>
=======
unlink("stopforking");
39ca: 00004517 auipc a0,0x4
39ce: cb650513 addi a0,a0,-842 # 7680 <l_free+0x1c1a>
39d2: 00002097 auipc ra,0x2
39d6: b4a080e7 jalr -1206(ra) # 551c <unlink>
int pid = fork();
39da: 00002097 auipc ra,0x2
39de: aea080e7 jalr -1302(ra) # 54c4 <fork>
if (pid < 0) {
39e2: 04054563 bltz a0,3a2c <forkforkfork+0x6e>
if (pid == 0) {
39e6: c12d beqz a0,3a48 <forkforkfork+0x8a>
sleep(20); // two seconds
39e8: 4551 li a0,20
39ea: 00002097 auipc ra,0x2
39ee: b72080e7 jalr -1166(ra) # 555c <sleep>
close(open("stopforking", O_CREATE | O_RDWR));
39f2: 20200593 li a1,514
39f6: 00004517 auipc a0,0x4
39fa: c8a50513 addi a0,a0,-886 # 7680 <l_free+0x1c1a>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
39fe: 00002097 auipc ra,0x2
3a02: b0e080e7 jalr -1266(ra) # 550c <open>
3a06: 00002097 auipc ra,0x2
3a0a: aee080e7 jalr -1298(ra) # 54f4 <close>
<<<<<<< HEAD
3a0e: 4501 li a0,0
3a10: 00002097 auipc ra,0x2
3a14: ac4080e7 jalr -1340(ra) # 54d4 <wait>
3a18: 4529 li a0,10
3a1a: 00002097 auipc ra,0x2
3a1e: b42080e7 jalr -1214(ra) # 555c <sleep>
=======
wait(0);
3a0e: 4501 li a0,0
3a10: 00002097 auipc ra,0x2
3a14: ac4080e7 jalr -1340(ra) # 54d4 <wait>
sleep(10); // one second
3a18: 4529 li a0,10
3a1a: 00002097 auipc ra,0x2
3a1e: b42080e7 jalr -1214(ra) # 555c <sleep>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3a22: 60e2 ld ra,24(sp)
3a24: 6442 ld s0,16(sp)
3a26: 64a2 ld s1,8(sp)
3a28: 6105 addi sp,sp,32
3a2a: 8082 ret
<<<<<<< HEAD
3a2c: 85a6 mv a1,s1
3a2e: 00003517 auipc a0,0x3
3a32: cc250513 addi a0,a0,-830 # 66f0 <l_free+0xc88>
3a36: 00002097 auipc ra,0x2
3a3a: e10080e7 jalr -496(ra) # 5846 <printf>
3a3e: 4505 li a0,1
3a40: 00002097 auipc ra,0x2
3a44: a8c080e7 jalr -1396(ra) # 54cc <exit>
3a48: 00004497 auipc s1,0x4
3a4c: c3848493 addi s1,s1,-968 # 7680 <l_free+0x1c18>
=======
printf("%s: fork failed", s);
3a2c: 85a6 mv a1,s1
3a2e: 00003517 auipc a0,0x3
3a32: cc250513 addi a0,a0,-830 # 66f0 <l_free+0xc8a>
3a36: 00002097 auipc ra,0x2
3a3a: e0e080e7 jalr -498(ra) # 5844 <printf>
exit(1);
3a3e: 4505 li a0,1
3a40: 00002097 auipc ra,0x2
3a44: a8c080e7 jalr -1396(ra) # 54cc <exit>
int fd = open("stopforking", 0);
3a48: 00004497 auipc s1,0x4
3a4c: c3848493 addi s1,s1,-968 # 7680 <l_free+0x1c1a>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3a50: 4581 li a1,0
3a52: 8526 mv a0,s1
3a54: 00002097 auipc ra,0x2
3a58: ab8080e7 jalr -1352(ra) # 550c <open>
<<<<<<< HEAD
3a5c: 02055463 bgez a0,3a84 <forkforkfork+0xc6>
3a60: 00002097 auipc ra,0x2
3a64: a64080e7 jalr -1436(ra) # 54c4 <fork>
3a68: fe0554e3 bgez a0,3a50 <forkforkfork+0x92>
=======
if (fd >= 0) {
3a5c: 02055463 bgez a0,3a84 <forkforkfork+0xc6>
if (fork() < 0) {
3a60: 00002097 auipc ra,0x2
3a64: a64080e7 jalr -1436(ra) # 54c4 <fork>
3a68: fe0554e3 bgez a0,3a50 <forkforkfork+0x92>
close(open("stopforking", O_CREATE | O_RDWR));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3a6c: 20200593 li a1,514
3a70: 8526 mv a0,s1
3a72: 00002097 auipc ra,0x2
3a76: a9a080e7 jalr -1382(ra) # 550c <open>
3a7a: 00002097 auipc ra,0x2
3a7e: a7a080e7 jalr -1414(ra) # 54f4 <close>
3a82: b7f9 j 3a50 <forkforkfork+0x92>
<<<<<<< HEAD
=======
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3a84: 4501 li a0,0
3a86: 00002097 auipc ra,0x2
3a8a: a46080e7 jalr -1466(ra) # 54cc <exit>
0000000000003a8e <sbrkbasic>:
<<<<<<< HEAD
=======
void sbrkbasic(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3a8e: 7139 addi sp,sp,-64
3a90: fc06 sd ra,56(sp)
3a92: f822 sd s0,48(sp)
3a94: f426 sd s1,40(sp)
3a96: f04a sd s2,32(sp)
3a98: ec4e sd s3,24(sp)
3a9a: e852 sd s4,16(sp)
3a9c: 0080 addi s0,sp,64
3a9e: 8a2a mv s4,a0
<<<<<<< HEAD
3aa0: 00002097 auipc ra,0x2
3aa4: a24080e7 jalr -1500(ra) # 54c4 <fork>
3aa8: 02054c63 bltz a0,3ae0 <sbrkbasic+0x52>
3aac: ed21 bnez a0,3b04 <sbrkbasic+0x76>
3aae: 40000537 lui a0,0x40000
3ab2: 00002097 auipc ra,0x2
3ab6: aa2080e7 jalr -1374(ra) # 5554 <sbrk>
3aba: 57fd li a5,-1
3abc: 02f50f63 beq a0,a5,3afa <sbrkbasic+0x6c>
3ac0: 400007b7 lui a5,0x40000
3ac4: 97aa add a5,a5,a0
3ac6: 06300693 li a3,99
3aca: 6705 lui a4,0x1
3acc: 00d50023 sb a3,0(a0) # 40000000 <__BSS_END__+0x3fff15e0>
3ad0: 953a add a0,a0,a4
3ad2: fef51de3 bne a0,a5,3acc <sbrkbasic+0x3e>
3ad6: 4505 li a0,1
3ad8: 00002097 auipc ra,0x2
3adc: 9f4080e7 jalr -1548(ra) # 54cc <exit>
3ae0: 00004517 auipc a0,0x4
3ae4: bb050513 addi a0,a0,-1104 # 7690 <l_free+0x1c28>
3ae8: 00002097 auipc ra,0x2
3aec: d5e080e7 jalr -674(ra) # 5846 <printf>
3af0: 4505 li a0,1
3af2: 00002097 auipc ra,0x2
3af6: 9da080e7 jalr -1574(ra) # 54cc <exit>
3afa: 4501 li a0,0
3afc: 00002097 auipc ra,0x2
3b00: 9d0080e7 jalr -1584(ra) # 54cc <exit>
3b04: 4529 li a0,10
3b06: 00002097 auipc ra,0x2
3b0a: a56080e7 jalr -1450(ra) # 555c <sleep>
3b0e: fcc40513 addi a0,s0,-52
3b12: 00002097 auipc ra,0x2
3b16: 9c2080e7 jalr -1598(ra) # 54d4 <wait>
3b1a: fcc42703 lw a4,-52(s0)
3b1e: 4785 li a5,1
3b20: 02f70563 beq a4,a5,3b4a <sbrkbasic+0xbc>
3b24: 6505 lui a0,0x1
3b26: 00002097 auipc ra,0x2
3b2a: a2e080e7 jalr -1490(ra) # 5554 <sbrk>
3b2e: 47a9 li a5,10
3b30: 00f50023 sb a5,0(a0) # 1000 <bigdir+0x134>
=======
pid = fork();
3aa0: 00002097 auipc ra,0x2
3aa4: a24080e7 jalr -1500(ra) # 54c4 <fork>
if (pid < 0) {
3aa8: 02054c63 bltz a0,3ae0 <sbrkbasic+0x52>
if (pid == 0) {
3aac: ed21 bnez a0,3b04 <sbrkbasic+0x76>
a = sbrk(TOOMUCH);
3aae: 40000537 lui a0,0x40000
3ab2: 00002097 auipc ra,0x2
3ab6: aa2080e7 jalr -1374(ra) # 5554 <sbrk>
if (a == (char *)0xffffffffffffffffL) {
3aba: 57fd li a5,-1
3abc: 02f50f63 beq a0,a5,3afa <sbrkbasic+0x6c>
for (b = a; b < a + TOOMUCH; b += 4096) {
3ac0: 400007b7 lui a5,0x40000
3ac4: 97aa add a5,a5,a0
*b = 99;
3ac6: 06300693 li a3,99
for (b = a; b < a + TOOMUCH; b += 4096) {
3aca: 6705 lui a4,0x1
*b = 99;
3acc: 00d50023 sb a3,0(a0) # 40000000 <__BSS_END__+0x3fff1638>
for (b = a; b < a + TOOMUCH; b += 4096) {
3ad0: 953a add a0,a0,a4
3ad2: fef51de3 bne a0,a5,3acc <sbrkbasic+0x3e>
exit(1);
3ad6: 4505 li a0,1
3ad8: 00002097 auipc ra,0x2
3adc: 9f4080e7 jalr -1548(ra) # 54cc <exit>
printf("fork failed in sbrkbasic\n");
3ae0: 00004517 auipc a0,0x4
3ae4: bb050513 addi a0,a0,-1104 # 7690 <l_free+0x1c2a>
3ae8: 00002097 auipc ra,0x2
3aec: d5c080e7 jalr -676(ra) # 5844 <printf>
exit(1);
3af0: 4505 li a0,1
3af2: 00002097 auipc ra,0x2
3af6: 9da080e7 jalr -1574(ra) # 54cc <exit>
exit(0);
3afa: 4501 li a0,0
3afc: 00002097 auipc ra,0x2
3b00: 9d0080e7 jalr -1584(ra) # 54cc <exit>
sleep(10);
3b04: 4529 li a0,10
3b06: 00002097 auipc ra,0x2
3b0a: a56080e7 jalr -1450(ra) # 555c <sleep>
wait(&xstatus);
3b0e: fcc40513 addi a0,s0,-52
3b12: 00002097 auipc ra,0x2
3b16: 9c2080e7 jalr -1598(ra) # 54d4 <wait>
if (xstatus == 1) {
3b1a: fcc42703 lw a4,-52(s0)
3b1e: 4785 li a5,1
3b20: 02f70563 beq a4,a5,3b4a <sbrkbasic+0xbc>
char *ss = sbrk(4096);
3b24: 6505 lui a0,0x1
3b26: 00002097 auipc ra,0x2
3b2a: a2e080e7 jalr -1490(ra) # 5554 <sbrk>
*ss = 10;
3b2e: 47a9 li a5,10
3b30: 00f50023 sb a5,0(a0) # 1000 <bigdir+0x134>
a = sbrk(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3b34: 4501 li a0,0
3b36: 00002097 auipc ra,0x2
3b3a: a1e080e7 jalr -1506(ra) # 5554 <sbrk>
3b3e: 84aa mv s1,a0
<<<<<<< HEAD
=======
for (i = 0; i < 5000; i++) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3b40: 4901 li s2,0
3b42: 6985 lui s3,0x1
3b44: 38898993 addi s3,s3,904 # 1388 <truncate3+0x76>
3b48: a005 j 3b68 <sbrkbasic+0xda>
<<<<<<< HEAD
3b4a: 85d2 mv a1,s4
3b4c: 00004517 auipc a0,0x4
3b50: b6450513 addi a0,a0,-1180 # 76b0 <l_free+0x1c48>
3b54: 00002097 auipc ra,0x2
3b58: cf2080e7 jalr -782(ra) # 5846 <printf>
3b5c: 4505 li a0,1
3b5e: 00002097 auipc ra,0x2
3b62: 96e080e7 jalr -1682(ra) # 54cc <exit>
3b66: 84be mv s1,a5
3b68: 4505 li a0,1
3b6a: 00002097 auipc ra,0x2
3b6e: 9ea080e7 jalr -1558(ra) # 5554 <sbrk>
3b72: 04951c63 bne a0,s1,3bca <sbrkbasic+0x13c>
3b76: 4785 li a5,1
3b78: 00f48023 sb a5,0(s1)
3b7c: 00148793 addi a5,s1,1
3b80: 2905 addiw s2,s2,1
3b82: ff3912e3 bne s2,s3,3b66 <sbrkbasic+0xd8>
3b86: 00002097 auipc ra,0x2
3b8a: 93e080e7 jalr -1730(ra) # 54c4 <fork>
3b8e: 892a mv s2,a0
3b90: 04054d63 bltz a0,3bea <sbrkbasic+0x15c>
3b94: 4505 li a0,1
3b96: 00002097 auipc ra,0x2
3b9a: 9be080e7 jalr -1602(ra) # 5554 <sbrk>
3b9e: 4505 li a0,1
3ba0: 00002097 auipc ra,0x2
3ba4: 9b4080e7 jalr -1612(ra) # 5554 <sbrk>
3ba8: 0489 addi s1,s1,2
3baa: 04a48e63 beq s1,a0,3c06 <sbrkbasic+0x178>
3bae: 85d2 mv a1,s4
3bb0: 00004517 auipc a0,0x4
3bb4: b6050513 addi a0,a0,-1184 # 7710 <l_free+0x1ca8>
3bb8: 00002097 auipc ra,0x2
3bbc: c8e080e7 jalr -882(ra) # 5846 <printf>
3bc0: 4505 li a0,1
3bc2: 00002097 auipc ra,0x2
3bc6: 90a080e7 jalr -1782(ra) # 54cc <exit>
=======
printf("%s: too much memory allocated!\n", s);
3b4a: 85d2 mv a1,s4
3b4c: 00004517 auipc a0,0x4
3b50: b6450513 addi a0,a0,-1180 # 76b0 <l_free+0x1c4a>
3b54: 00002097 auipc ra,0x2
3b58: cf0080e7 jalr -784(ra) # 5844 <printf>
exit(1);
3b5c: 4505 li a0,1
3b5e: 00002097 auipc ra,0x2
3b62: 96e080e7 jalr -1682(ra) # 54cc <exit>
a = b + 1;
3b66: 84be mv s1,a5
b = sbrk(1);
3b68: 4505 li a0,1
3b6a: 00002097 auipc ra,0x2
3b6e: 9ea080e7 jalr -1558(ra) # 5554 <sbrk>
if (b != a) {
3b72: 04951c63 bne a0,s1,3bca <sbrkbasic+0x13c>
*b = 1;
3b76: 4785 li a5,1
3b78: 00f48023 sb a5,0(s1)
a = b + 1;
3b7c: 00148793 addi a5,s1,1
for (i = 0; i < 5000; i++) {
3b80: 2905 addiw s2,s2,1
3b82: ff3912e3 bne s2,s3,3b66 <sbrkbasic+0xd8>
pid = fork();
3b86: 00002097 auipc ra,0x2
3b8a: 93e080e7 jalr -1730(ra) # 54c4 <fork>
3b8e: 892a mv s2,a0
if (pid < 0) {
3b90: 04054d63 bltz a0,3bea <sbrkbasic+0x15c>
c = sbrk(1);
3b94: 4505 li a0,1
3b96: 00002097 auipc ra,0x2
3b9a: 9be080e7 jalr -1602(ra) # 5554 <sbrk>
c = sbrk(1);
3b9e: 4505 li a0,1
3ba0: 00002097 auipc ra,0x2
3ba4: 9b4080e7 jalr -1612(ra) # 5554 <sbrk>
if (c != a + 1) {
3ba8: 0489 addi s1,s1,2
3baa: 04a48e63 beq s1,a0,3c06 <sbrkbasic+0x178>
printf("%s: sbrk test failed post-fork\n", s);
3bae: 85d2 mv a1,s4
3bb0: 00004517 auipc a0,0x4
3bb4: b6050513 addi a0,a0,-1184 # 7710 <l_free+0x1caa>
3bb8: 00002097 auipc ra,0x2
3bbc: c8c080e7 jalr -884(ra) # 5844 <printf>
exit(1);
3bc0: 4505 li a0,1
3bc2: 00002097 auipc ra,0x2
3bc6: 90a080e7 jalr -1782(ra) # 54cc <exit>
printf("%s: sbrk test failed %d %x %x\n", i, a, b);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3bca: 86aa mv a3,a0
3bcc: 8626 mv a2,s1
3bce: 85ca mv a1,s2
3bd0: 00004517 auipc a0,0x4
<<<<<<< HEAD
3bd4: b0050513 addi a0,a0,-1280 # 76d0 <l_free+0x1c68>
3bd8: 00002097 auipc ra,0x2
3bdc: c6e080e7 jalr -914(ra) # 5846 <printf>
3be0: 4505 li a0,1
3be2: 00002097 auipc ra,0x2
3be6: 8ea080e7 jalr -1814(ra) # 54cc <exit>
3bea: 85d2 mv a1,s4
3bec: 00004517 auipc a0,0x4
3bf0: b0450513 addi a0,a0,-1276 # 76f0 <l_free+0x1c88>
3bf4: 00002097 auipc ra,0x2
3bf8: c52080e7 jalr -942(ra) # 5846 <printf>
3bfc: 4505 li a0,1
3bfe: 00002097 auipc ra,0x2
3c02: 8ce080e7 jalr -1842(ra) # 54cc <exit>
3c06: 00091763 bnez s2,3c14 <sbrkbasic+0x186>
3c0a: 4501 li a0,0
3c0c: 00002097 auipc ra,0x2
3c10: 8c0080e7 jalr -1856(ra) # 54cc <exit>
3c14: fcc40513 addi a0,s0,-52
3c18: 00002097 auipc ra,0x2
3c1c: 8bc080e7 jalr -1860(ra) # 54d4 <wait>
=======
3bd4: b0050513 addi a0,a0,-1280 # 76d0 <l_free+0x1c6a>
3bd8: 00002097 auipc ra,0x2
3bdc: c6c080e7 jalr -916(ra) # 5844 <printf>
exit(1);
3be0: 4505 li a0,1
3be2: 00002097 auipc ra,0x2
3be6: 8ea080e7 jalr -1814(ra) # 54cc <exit>
printf("%s: sbrk test fork failed\n", s);
3bea: 85d2 mv a1,s4
3bec: 00004517 auipc a0,0x4
3bf0: b0450513 addi a0,a0,-1276 # 76f0 <l_free+0x1c8a>
3bf4: 00002097 auipc ra,0x2
3bf8: c50080e7 jalr -944(ra) # 5844 <printf>
exit(1);
3bfc: 4505 li a0,1
3bfe: 00002097 auipc ra,0x2
3c02: 8ce080e7 jalr -1842(ra) # 54cc <exit>
if (pid == 0)
3c06: 00091763 bnez s2,3c14 <sbrkbasic+0x186>
exit(0);
3c0a: 4501 li a0,0
3c0c: 00002097 auipc ra,0x2
3c10: 8c0080e7 jalr -1856(ra) # 54cc <exit>
wait(&xstatus);
3c14: fcc40513 addi a0,s0,-52
3c18: 00002097 auipc ra,0x2
3c1c: 8bc080e7 jalr -1860(ra) # 54d4 <wait>
exit(xstatus);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3c20: fcc42503 lw a0,-52(s0)
3c24: 00002097 auipc ra,0x2
3c28: 8a8080e7 jalr -1880(ra) # 54cc <exit>
0000000000003c2c <preempt>:
<<<<<<< HEAD
=======
void preempt(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3c2c: 7139 addi sp,sp,-64
3c2e: fc06 sd ra,56(sp)
3c30: f822 sd s0,48(sp)
3c32: f426 sd s1,40(sp)
3c34: f04a sd s2,32(sp)
3c36: ec4e sd s3,24(sp)
3c38: e852 sd s4,16(sp)
3c3a: 0080 addi s0,sp,64
3c3c: 892a mv s2,a0
<<<<<<< HEAD
3c3e: 00002097 auipc ra,0x2
3c42: 886080e7 jalr -1914(ra) # 54c4 <fork>
3c46: 00054563 bltz a0,3c50 <preempt+0x24>
3c4a: 84aa mv s1,a0
3c4c: ed19 bnez a0,3c6a <preempt+0x3e>
3c4e: a001 j 3c4e <preempt+0x22>
3c50: 00003517 auipc a0,0x3
3c54: aa050513 addi a0,a0,-1376 # 66f0 <l_free+0xc88>
3c58: 00002097 auipc ra,0x2
3c5c: bee080e7 jalr -1042(ra) # 5846 <printf>
3c60: 4505 li a0,1
3c62: 00002097 auipc ra,0x2
3c66: 86a080e7 jalr -1942(ra) # 54cc <exit>
3c6a: 00002097 auipc ra,0x2
3c6e: 85a080e7 jalr -1958(ra) # 54c4 <fork>
3c72: 89aa mv s3,a0
3c74: 00054463 bltz a0,3c7c <preempt+0x50>
3c78: e105 bnez a0,3c98 <preempt+0x6c>
3c7a: a001 j 3c7a <preempt+0x4e>
3c7c: 85ca mv a1,s2
3c7e: 00003517 auipc a0,0x3
3c82: 8b250513 addi a0,a0,-1870 # 6530 <l_free+0xac8>
3c86: 00002097 auipc ra,0x2
3c8a: bc0080e7 jalr -1088(ra) # 5846 <printf>
3c8e: 4505 li a0,1
3c90: 00002097 auipc ra,0x2
3c94: 83c080e7 jalr -1988(ra) # 54cc <exit>
3c98: fc840513 addi a0,s0,-56
3c9c: 00002097 auipc ra,0x2
3ca0: 840080e7 jalr -1984(ra) # 54dc <pipe>
3ca4: 00002097 auipc ra,0x2
3ca8: 820080e7 jalr -2016(ra) # 54c4 <fork>
3cac: 8a2a mv s4,a0
3cae: 02054e63 bltz a0,3cea <preempt+0xbe>
3cb2: e13d bnez a0,3d18 <preempt+0xec>
3cb4: fc842503 lw a0,-56(s0)
3cb8: 00002097 auipc ra,0x2
3cbc: 83c080e7 jalr -1988(ra) # 54f4 <close>
3cc0: 4605 li a2,1
3cc2: 00002597 auipc a1,0x2
3cc6: 16658593 addi a1,a1,358 # 5e28 <l_free+0x3c0>
=======
pid1 = fork();
3c3e: 00002097 auipc ra,0x2
3c42: 886080e7 jalr -1914(ra) # 54c4 <fork>
if (pid1 < 0) {
3c46: 00054563 bltz a0,3c50 <preempt+0x24>
3c4a: 84aa mv s1,a0
if (pid1 == 0)
3c4c: ed19 bnez a0,3c6a <preempt+0x3e>
for (;;)
3c4e: a001 j 3c4e <preempt+0x22>
printf("%s: fork failed");
3c50: 00003517 auipc a0,0x3
3c54: aa050513 addi a0,a0,-1376 # 66f0 <l_free+0xc8a>
3c58: 00002097 auipc ra,0x2
3c5c: bec080e7 jalr -1044(ra) # 5844 <printf>
exit(1);
3c60: 4505 li a0,1
3c62: 00002097 auipc ra,0x2
3c66: 86a080e7 jalr -1942(ra) # 54cc <exit>
pid2 = fork();
3c6a: 00002097 auipc ra,0x2
3c6e: 85a080e7 jalr -1958(ra) # 54c4 <fork>
3c72: 89aa mv s3,a0
if (pid2 < 0) {
3c74: 00054463 bltz a0,3c7c <preempt+0x50>
if (pid2 == 0)
3c78: e105 bnez a0,3c98 <preempt+0x6c>
for (;;)
3c7a: a001 j 3c7a <preempt+0x4e>
printf("%s: fork failed\n", s);
3c7c: 85ca mv a1,s2
3c7e: 00003517 auipc a0,0x3
3c82: 8b250513 addi a0,a0,-1870 # 6530 <l_free+0xaca>
3c86: 00002097 auipc ra,0x2
3c8a: bbe080e7 jalr -1090(ra) # 5844 <printf>
exit(1);
3c8e: 4505 li a0,1
3c90: 00002097 auipc ra,0x2
3c94: 83c080e7 jalr -1988(ra) # 54cc <exit>
pipe(pfds);
3c98: fc840513 addi a0,s0,-56
3c9c: 00002097 auipc ra,0x2
3ca0: 840080e7 jalr -1984(ra) # 54dc <pipe>
pid3 = fork();
3ca4: 00002097 auipc ra,0x2
3ca8: 820080e7 jalr -2016(ra) # 54c4 <fork>
3cac: 8a2a mv s4,a0
if (pid3 < 0) {
3cae: 02054e63 bltz a0,3cea <preempt+0xbe>
if (pid3 == 0) {
3cb2: e13d bnez a0,3d18 <preempt+0xec>
close(pfds[0]);
3cb4: fc842503 lw a0,-56(s0)
3cb8: 00002097 auipc ra,0x2
3cbc: 83c080e7 jalr -1988(ra) # 54f4 <close>
if (write(pfds[1], "x", 1) != 1)
3cc0: 4605 li a2,1
3cc2: 00002597 auipc a1,0x2
3cc6: 16658593 addi a1,a1,358 # 5e28 <l_free+0x3c2>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3cca: fcc42503 lw a0,-52(s0)
3cce: 00002097 auipc ra,0x2
3cd2: 81e080e7 jalr -2018(ra) # 54ec <write>
3cd6: 4785 li a5,1
3cd8: 02f51763 bne a0,a5,3d06 <preempt+0xda>
<<<<<<< HEAD
3cdc: fcc42503 lw a0,-52(s0)
3ce0: 00002097 auipc ra,0x2
3ce4: 814080e7 jalr -2028(ra) # 54f4 <close>
3ce8: a001 j 3ce8 <preempt+0xbc>
3cea: 85ca mv a1,s2
3cec: 00003517 auipc a0,0x3
3cf0: 84450513 addi a0,a0,-1980 # 6530 <l_free+0xac8>
3cf4: 00002097 auipc ra,0x2
3cf8: b52080e7 jalr -1198(ra) # 5846 <printf>
3cfc: 4505 li a0,1
3cfe: 00001097 auipc ra,0x1
3d02: 7ce080e7 jalr 1998(ra) # 54cc <exit>
3d06: 00004517 auipc a0,0x4
3d0a: a2a50513 addi a0,a0,-1494 # 7730 <l_free+0x1cc8>
3d0e: 00002097 auipc ra,0x2
3d12: b38080e7 jalr -1224(ra) # 5846 <printf>
3d16: b7d9 j 3cdc <preempt+0xb0>
3d18: fcc42503 lw a0,-52(s0)
3d1c: 00001097 auipc ra,0x1
3d20: 7d8080e7 jalr 2008(ra) # 54f4 <close>
3d24: 660d lui a2,0x3
3d26: 00008597 auipc a1,0x8
3d2a: cea58593 addi a1,a1,-790 # ba10 <buf>
=======
close(pfds[1]);
3cdc: fcc42503 lw a0,-52(s0)
3ce0: 00002097 auipc ra,0x2
3ce4: 814080e7 jalr -2028(ra) # 54f4 <close>
for (;;)
3ce8: a001 j 3ce8 <preempt+0xbc>
printf("%s: fork failed\n", s);
3cea: 85ca mv a1,s2
3cec: 00003517 auipc a0,0x3
3cf0: 84450513 addi a0,a0,-1980 # 6530 <l_free+0xaca>
3cf4: 00002097 auipc ra,0x2
3cf8: b50080e7 jalr -1200(ra) # 5844 <printf>
exit(1);
3cfc: 4505 li a0,1
3cfe: 00001097 auipc ra,0x1
3d02: 7ce080e7 jalr 1998(ra) # 54cc <exit>
printf("%s: preempt write error");
3d06: 00004517 auipc a0,0x4
3d0a: a2a50513 addi a0,a0,-1494 # 7730 <l_free+0x1cca>
3d0e: 00002097 auipc ra,0x2
3d12: b36080e7 jalr -1226(ra) # 5844 <printf>
3d16: b7d9 j 3cdc <preempt+0xb0>
close(pfds[1]);
3d18: fcc42503 lw a0,-52(s0)
3d1c: 00001097 auipc ra,0x1
3d20: 7d8080e7 jalr 2008(ra) # 54f4 <close>
if (read(pfds[0], buf, sizeof(buf)) != 1) {
3d24: 660d lui a2,0x3
3d26: 00008597 auipc a1,0x8
3d2a: c9258593 addi a1,a1,-878 # b9b8 <buf>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3d2e: fc842503 lw a0,-56(s0)
3d32: 00001097 auipc ra,0x1
3d36: 7b2080e7 jalr 1970(ra) # 54e4 <read>
3d3a: 4785 li a5,1
3d3c: 02f50263 beq a0,a5,3d60 <preempt+0x134>
<<<<<<< HEAD
3d40: 00004517 auipc a0,0x4
3d44: a0850513 addi a0,a0,-1528 # 7748 <l_free+0x1ce0>
3d48: 00002097 auipc ra,0x2
3d4c: afe080e7 jalr -1282(ra) # 5846 <printf>
=======
printf("%s: preempt read error");
3d40: 00004517 auipc a0,0x4
3d44: a0850513 addi a0,a0,-1528 # 7748 <l_free+0x1ce2>
3d48: 00002097 auipc ra,0x2
3d4c: afc080e7 jalr -1284(ra) # 5844 <printf>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3d50: 70e2 ld ra,56(sp)
3d52: 7442 ld s0,48(sp)
3d54: 74a2 ld s1,40(sp)
3d56: 7902 ld s2,32(sp)
3d58: 69e2 ld s3,24(sp)
3d5a: 6a42 ld s4,16(sp)
3d5c: 6121 addi sp,sp,64
3d5e: 8082 ret
<<<<<<< HEAD
3d60: fc842503 lw a0,-56(s0)
3d64: 00001097 auipc ra,0x1
3d68: 790080e7 jalr 1936(ra) # 54f4 <close>
3d6c: 00004517 auipc a0,0x4
3d70: 9f450513 addi a0,a0,-1548 # 7760 <l_free+0x1cf8>
3d74: 00002097 auipc ra,0x2
3d78: ad2080e7 jalr -1326(ra) # 5846 <printf>
3d7c: 8526 mv a0,s1
3d7e: 00001097 auipc ra,0x1
3d82: 77e080e7 jalr 1918(ra) # 54fc <kill>
3d86: 854e mv a0,s3
3d88: 00001097 auipc ra,0x1
3d8c: 774080e7 jalr 1908(ra) # 54fc <kill>
3d90: 8552 mv a0,s4
3d92: 00001097 auipc ra,0x1
3d96: 76a080e7 jalr 1898(ra) # 54fc <kill>
3d9a: 00004517 auipc a0,0x4
3d9e: 9d650513 addi a0,a0,-1578 # 7770 <l_free+0x1d08>
3da2: 00002097 auipc ra,0x2
3da6: aa4080e7 jalr -1372(ra) # 5846 <printf>
3daa: 4501 li a0,0
3dac: 00001097 auipc ra,0x1
3db0: 728080e7 jalr 1832(ra) # 54d4 <wait>
3db4: 4501 li a0,0
3db6: 00001097 auipc ra,0x1
3dba: 71e080e7 jalr 1822(ra) # 54d4 <wait>
=======
close(pfds[0]);
3d60: fc842503 lw a0,-56(s0)
3d64: 00001097 auipc ra,0x1
3d68: 790080e7 jalr 1936(ra) # 54f4 <close>
printf("kill... ");
3d6c: 00004517 auipc a0,0x4
3d70: 9f450513 addi a0,a0,-1548 # 7760 <l_free+0x1cfa>
3d74: 00002097 auipc ra,0x2
3d78: ad0080e7 jalr -1328(ra) # 5844 <printf>
kill(pid1);
3d7c: 8526 mv a0,s1
3d7e: 00001097 auipc ra,0x1
3d82: 77e080e7 jalr 1918(ra) # 54fc <kill>
kill(pid2);
3d86: 854e mv a0,s3
3d88: 00001097 auipc ra,0x1
3d8c: 774080e7 jalr 1908(ra) # 54fc <kill>
kill(pid3);
3d90: 8552 mv a0,s4
3d92: 00001097 auipc ra,0x1
3d96: 76a080e7 jalr 1898(ra) # 54fc <kill>
printf("wait... ");
3d9a: 00004517 auipc a0,0x4
3d9e: 9d650513 addi a0,a0,-1578 # 7770 <l_free+0x1d0a>
3da2: 00002097 auipc ra,0x2
3da6: aa2080e7 jalr -1374(ra) # 5844 <printf>
wait(0);
3daa: 4501 li a0,0
3dac: 00001097 auipc ra,0x1
3db0: 728080e7 jalr 1832(ra) # 54d4 <wait>
wait(0);
3db4: 4501 li a0,0
3db6: 00001097 auipc ra,0x1
3dba: 71e080e7 jalr 1822(ra) # 54d4 <wait>
wait(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3dbe: 4501 li a0,0
3dc0: 00001097 auipc ra,0x1
3dc4: 714080e7 jalr 1812(ra) # 54d4 <wait>
3dc8: b761 j 3d50 <preempt+0x124>
0000000000003dca <sbrkfail>:
<<<<<<< HEAD
=======
void sbrkfail(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3dca: 7119 addi sp,sp,-128
3dcc: fc86 sd ra,120(sp)
3dce: f8a2 sd s0,112(sp)
3dd0: f4a6 sd s1,104(sp)
3dd2: f0ca sd s2,96(sp)
3dd4: ecce sd s3,88(sp)
3dd6: e8d2 sd s4,80(sp)
3dd8: e4d6 sd s5,72(sp)
3dda: 0100 addi s0,sp,128
3ddc: 8aaa mv s5,a0
<<<<<<< HEAD
=======
if (pipe(fds) != 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3dde: fb040513 addi a0,s0,-80
3de2: 00001097 auipc ra,0x1
3de6: 6fa080e7 jalr 1786(ra) # 54dc <pipe>
3dea: e901 bnez a0,3dfa <sbrkfail+0x30>
3dec: f8040493 addi s1,s0,-128
3df0: fa840993 addi s3,s0,-88
3df4: 8926 mv s2,s1
<<<<<<< HEAD
3df6: 5a7d li s4,-1
3df8: a085 j 3e58 <sbrkfail+0x8e>
3dfa: 85d6 mv a1,s5
3dfc: 00003517 auipc a0,0x3
3e00: 83c50513 addi a0,a0,-1988 # 6638 <l_free+0xbd0>
3e04: 00002097 auipc ra,0x2
3e08: a42080e7 jalr -1470(ra) # 5846 <printf>
3e0c: 4505 li a0,1
3e0e: 00001097 auipc ra,0x1
3e12: 6be080e7 jalr 1726(ra) # 54cc <exit>
=======
if (pids[i] != -1)
3df6: 5a7d li s4,-1
3df8: a085 j 3e58 <sbrkfail+0x8e>
printf("%s: pipe() failed\n", s);
3dfa: 85d6 mv a1,s5
3dfc: 00003517 auipc a0,0x3
3e00: 83c50513 addi a0,a0,-1988 # 6638 <l_free+0xbd2>
3e04: 00002097 auipc ra,0x2
3e08: a40080e7 jalr -1472(ra) # 5844 <printf>
exit(1);
3e0c: 4505 li a0,1
3e0e: 00001097 auipc ra,0x1
3e12: 6be080e7 jalr 1726(ra) # 54cc <exit>
sbrk(BIG - (uint64)sbrk(0));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3e16: 00001097 auipc ra,0x1
3e1a: 73e080e7 jalr 1854(ra) # 5554 <sbrk>
3e1e: 064007b7 lui a5,0x6400
3e22: 40a7853b subw a0,a5,a0
3e26: 00001097 auipc ra,0x1
3e2a: 72e080e7 jalr 1838(ra) # 5554 <sbrk>
<<<<<<< HEAD
3e2e: 4605 li a2,1
3e30: 00002597 auipc a1,0x2
3e34: ff858593 addi a1,a1,-8 # 5e28 <l_free+0x3c0>
3e38: fb442503 lw a0,-76(s0)
3e3c: 00001097 auipc ra,0x1
3e40: 6b0080e7 jalr 1712(ra) # 54ec <write>
3e44: 3e800513 li a0,1000
3e48: 00001097 auipc ra,0x1
3e4c: 714080e7 jalr 1812(ra) # 555c <sleep>
3e50: bfd5 j 3e44 <sbrkfail+0x7a>
3e52: 0911 addi s2,s2,4
3e54: 03390563 beq s2,s3,3e7e <sbrkfail+0xb4>
=======
write(fds[1], "x", 1);
3e2e: 4605 li a2,1
3e30: 00002597 auipc a1,0x2
3e34: ff858593 addi a1,a1,-8 # 5e28 <l_free+0x3c2>
3e38: fb442503 lw a0,-76(s0)
3e3c: 00001097 auipc ra,0x1
3e40: 6b0080e7 jalr 1712(ra) # 54ec <write>
sleep(1000);
3e44: 3e800513 li a0,1000
3e48: 00001097 auipc ra,0x1
3e4c: 714080e7 jalr 1812(ra) # 555c <sleep>
for (;;)
3e50: bfd5 j 3e44 <sbrkfail+0x7a>
for (i = 0; i < sizeof(pids) / sizeof(pids[0]); i++) {
3e52: 0911 addi s2,s2,4
3e54: 03390563 beq s2,s3,3e7e <sbrkfail+0xb4>
if ((pids[i] = fork()) == 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3e58: 00001097 auipc ra,0x1
3e5c: 66c080e7 jalr 1644(ra) # 54c4 <fork>
3e60: 00a92023 sw a0,0(s2)
3e64: d94d beqz a0,3e16 <sbrkfail+0x4c>
<<<<<<< HEAD
3e66: ff4506e3 beq a0,s4,3e52 <sbrkfail+0x88>
=======
if (pids[i] != -1)
3e66: ff4506e3 beq a0,s4,3e52 <sbrkfail+0x88>
read(fds[0], &scratch, 1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3e6a: 4605 li a2,1
3e6c: faf40593 addi a1,s0,-81
3e70: fb042503 lw a0,-80(s0)
3e74: 00001097 auipc ra,0x1
3e78: 670080e7 jalr 1648(ra) # 54e4 <read>
3e7c: bfd9 j 3e52 <sbrkfail+0x88>
<<<<<<< HEAD
=======
c = sbrk(PGSIZE);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3e7e: 6505 lui a0,0x1
3e80: 00001097 auipc ra,0x1
3e84: 6d4080e7 jalr 1748(ra) # 5554 <sbrk>
3e88: 8a2a mv s4,a0
<<<<<<< HEAD
3e8a: 597d li s2,-1
3e8c: a021 j 3e94 <sbrkfail+0xca>
3e8e: 0491 addi s1,s1,4
3e90: 01348f63 beq s1,s3,3eae <sbrkfail+0xe4>
3e94: 4088 lw a0,0(s1)
3e96: ff250ce3 beq a0,s2,3e8e <sbrkfail+0xc4>
3e9a: 00001097 auipc ra,0x1
3e9e: 662080e7 jalr 1634(ra) # 54fc <kill>
=======
if (pids[i] == -1)
3e8a: 597d li s2,-1
3e8c: a021 j 3e94 <sbrkfail+0xca>
for (i = 0; i < sizeof(pids) / sizeof(pids[0]); i++) {
3e8e: 0491 addi s1,s1,4
3e90: 01348f63 beq s1,s3,3eae <sbrkfail+0xe4>
if (pids[i] == -1)
3e94: 4088 lw a0,0(s1)
3e96: ff250ce3 beq a0,s2,3e8e <sbrkfail+0xc4>
kill(pids[i]);
3e9a: 00001097 auipc ra,0x1
3e9e: 662080e7 jalr 1634(ra) # 54fc <kill>
wait(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3ea2: 4501 li a0,0
3ea4: 00001097 auipc ra,0x1
3ea8: 630080e7 jalr 1584(ra) # 54d4 <wait>
3eac: b7cd j 3e8e <sbrkfail+0xc4>
<<<<<<< HEAD
3eae: 57fd li a5,-1
3eb0: 04fa0163 beq s4,a5,3ef2 <sbrkfail+0x128>
3eb4: 00001097 auipc ra,0x1
3eb8: 610080e7 jalr 1552(ra) # 54c4 <fork>
3ebc: 84aa mv s1,a0
3ebe: 04054863 bltz a0,3f0e <sbrkfail+0x144>
3ec2: c525 beqz a0,3f2a <sbrkfail+0x160>
3ec4: fbc40513 addi a0,s0,-68
3ec8: 00001097 auipc ra,0x1
3ecc: 60c080e7 jalr 1548(ra) # 54d4 <wait>
=======
if (c == (char *)0xffffffffffffffffL) {
3eae: 57fd li a5,-1
3eb0: 04fa0163 beq s4,a5,3ef2 <sbrkfail+0x128>
pid = fork();
3eb4: 00001097 auipc ra,0x1
3eb8: 610080e7 jalr 1552(ra) # 54c4 <fork>
3ebc: 84aa mv s1,a0
if (pid < 0) {
3ebe: 04054863 bltz a0,3f0e <sbrkfail+0x144>
if (pid == 0) {
3ec2: c525 beqz a0,3f2a <sbrkfail+0x160>
wait(&xstatus);
3ec4: fbc40513 addi a0,s0,-68
3ec8: 00001097 auipc ra,0x1
3ecc: 60c080e7 jalr 1548(ra) # 54d4 <wait>
if (xstatus != -1 && xstatus != 2)
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3ed0: fbc42783 lw a5,-68(s0)
3ed4: 577d li a4,-1
3ed6: 00e78563 beq a5,a4,3ee0 <sbrkfail+0x116>
3eda: 4709 li a4,2
3edc: 08e79c63 bne a5,a4,3f74 <sbrkfail+0x1aa>
<<<<<<< HEAD
=======
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3ee0: 70e6 ld ra,120(sp)
3ee2: 7446 ld s0,112(sp)
3ee4: 74a6 ld s1,104(sp)
3ee6: 7906 ld s2,96(sp)
3ee8: 69e6 ld s3,88(sp)
3eea: 6a46 ld s4,80(sp)
3eec: 6aa6 ld s5,72(sp)
3eee: 6109 addi sp,sp,128
3ef0: 8082 ret
<<<<<<< HEAD
3ef2: 85d6 mv a1,s5
3ef4: 00004517 auipc a0,0x4
3ef8: 88c50513 addi a0,a0,-1908 # 7780 <l_free+0x1d18>
3efc: 00002097 auipc ra,0x2
3f00: 94a080e7 jalr -1718(ra) # 5846 <printf>
3f04: 4505 li a0,1
3f06: 00001097 auipc ra,0x1
3f0a: 5c6080e7 jalr 1478(ra) # 54cc <exit>
3f0e: 85d6 mv a1,s5
3f10: 00002517 auipc a0,0x2
3f14: 62050513 addi a0,a0,1568 # 6530 <l_free+0xac8>
3f18: 00002097 auipc ra,0x2
3f1c: 92e080e7 jalr -1746(ra) # 5846 <printf>
3f20: 4505 li a0,1
3f22: 00001097 auipc ra,0x1
3f26: 5aa080e7 jalr 1450(ra) # 54cc <exit>
=======
printf("%s: failed sbrk leaked memory\n", s);
3ef2: 85d6 mv a1,s5
3ef4: 00004517 auipc a0,0x4
3ef8: 88c50513 addi a0,a0,-1908 # 7780 <l_free+0x1d1a>
3efc: 00002097 auipc ra,0x2
3f00: 948080e7 jalr -1720(ra) # 5844 <printf>
exit(1);
3f04: 4505 li a0,1
3f06: 00001097 auipc ra,0x1
3f0a: 5c6080e7 jalr 1478(ra) # 54cc <exit>
printf("%s: fork failed\n", s);
3f0e: 85d6 mv a1,s5
3f10: 00002517 auipc a0,0x2
3f14: 62050513 addi a0,a0,1568 # 6530 <l_free+0xaca>
3f18: 00002097 auipc ra,0x2
3f1c: 92c080e7 jalr -1748(ra) # 5844 <printf>
exit(1);
3f20: 4505 li a0,1
3f22: 00001097 auipc ra,0x1
3f26: 5aa080e7 jalr 1450(ra) # 54cc <exit>
a = sbrk(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3f2a: 4501 li a0,0
3f2c: 00001097 auipc ra,0x1
3f30: 628080e7 jalr 1576(ra) # 5554 <sbrk>
3f34: 892a mv s2,a0
<<<<<<< HEAD
3f36: 3e800537 lui a0,0x3e800
3f3a: 00001097 auipc ra,0x1
3f3e: 61a080e7 jalr 1562(ra) # 5554 <sbrk>
=======
sbrk(10 * BIG);
3f36: 3e800537 lui a0,0x3e800
3f3a: 00001097 auipc ra,0x1
3f3e: 61a080e7 jalr 1562(ra) # 5554 <sbrk>
for (i = 0; i < 10 * BIG; i += PGSIZE) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3f42: 87ca mv a5,s2
3f44: 3e800737 lui a4,0x3e800
3f48: 993a add s2,s2,a4
3f4a: 6705 lui a4,0x1
<<<<<<< HEAD
3f4c: 0007c683 lbu a3,0(a5) # 6400000 <__BSS_END__+0x63f15e0>
3f50: 9cb5 addw s1,s1,a3
3f52: 97ba add a5,a5,a4
3f54: ff279ce3 bne a5,s2,3f4c <sbrkfail+0x182>
3f58: 85a6 mv a1,s1
3f5a: 00004517 auipc a0,0x4
3f5e: 84650513 addi a0,a0,-1978 # 77a0 <l_free+0x1d38>
3f62: 00002097 auipc ra,0x2
3f66: 8e4080e7 jalr -1820(ra) # 5846 <printf>
3f6a: 4505 li a0,1
3f6c: 00001097 auipc ra,0x1
3f70: 560080e7 jalr 1376(ra) # 54cc <exit>
=======
n += *(a + i);
3f4c: 0007c683 lbu a3,0(a5) # 6400000 <__BSS_END__+0x63f1638>
3f50: 9cb5 addw s1,s1,a3
for (i = 0; i < 10 * BIG; i += PGSIZE) {
3f52: 97ba add a5,a5,a4
3f54: ff279ce3 bne a5,s2,3f4c <sbrkfail+0x182>
printf("%s: allocate a lot of memory succeeded %d\n", n);
3f58: 85a6 mv a1,s1
3f5a: 00004517 auipc a0,0x4
3f5e: 84650513 addi a0,a0,-1978 # 77a0 <l_free+0x1d3a>
3f62: 00002097 auipc ra,0x2
3f66: 8e2080e7 jalr -1822(ra) # 5844 <printf>
exit(1);
3f6a: 4505 li a0,1
3f6c: 00001097 auipc ra,0x1
3f70: 560080e7 jalr 1376(ra) # 54cc <exit>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3f74: 4505 li a0,1
3f76: 00001097 auipc ra,0x1
3f7a: 556080e7 jalr 1366(ra) # 54cc <exit>
0000000000003f7e <reparent>:
<<<<<<< HEAD
=======
void reparent(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3f7e: 7179 addi sp,sp,-48
3f80: f406 sd ra,40(sp)
3f82: f022 sd s0,32(sp)
3f84: ec26 sd s1,24(sp)
3f86: e84a sd s2,16(sp)
3f88: e44e sd s3,8(sp)
3f8a: e052 sd s4,0(sp)
3f8c: 1800 addi s0,sp,48
3f8e: 89aa mv s3,a0
<<<<<<< HEAD
=======
int master_pid = getpid();
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3f90: 00001097 auipc ra,0x1
3f94: 5bc080e7 jalr 1468(ra) # 554c <getpid>
3f98: 8a2a mv s4,a0
3f9a: 0c800913 li s2,200
<<<<<<< HEAD
3f9e: 00001097 auipc ra,0x1
3fa2: 526080e7 jalr 1318(ra) # 54c4 <fork>
3fa6: 84aa mv s1,a0
3fa8: 02054263 bltz a0,3fcc <reparent+0x4e>
3fac: cd21 beqz a0,4004 <reparent+0x86>
=======
int pid = fork();
3f9e: 00001097 auipc ra,0x1
3fa2: 526080e7 jalr 1318(ra) # 54c4 <fork>
3fa6: 84aa mv s1,a0
if (pid < 0) {
3fa8: 02054263 bltz a0,3fcc <reparent+0x4e>
if (pid) {
3fac: cd21 beqz a0,4004 <reparent+0x86>
if (wait(0) != pid) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
3fae: 4501 li a0,0
3fb0: 00001097 auipc ra,0x1
3fb4: 524080e7 jalr 1316(ra) # 54d4 <wait>
3fb8: 02951863 bne a0,s1,3fe8 <reparent+0x6a>
<<<<<<< HEAD
3fbc: 397d addiw s2,s2,-1
3fbe: fe0910e3 bnez s2,3f9e <reparent+0x20>
3fc2: 4501 li a0,0
3fc4: 00001097 auipc ra,0x1
3fc8: 508080e7 jalr 1288(ra) # 54cc <exit>
3fcc: 85ce mv a1,s3
3fce: 00002517 auipc a0,0x2
3fd2: 56250513 addi a0,a0,1378 # 6530 <l_free+0xac8>
3fd6: 00002097 auipc ra,0x2
3fda: 870080e7 jalr -1936(ra) # 5846 <printf>
3fde: 4505 li a0,1
3fe0: 00001097 auipc ra,0x1
3fe4: 4ec080e7 jalr 1260(ra) # 54cc <exit>
3fe8: 85ce mv a1,s3
3fea: 00002517 auipc a0,0x2
3fee: 6ce50513 addi a0,a0,1742 # 66b8 <l_free+0xc50>
3ff2: 00002097 auipc ra,0x2
3ff6: 854080e7 jalr -1964(ra) # 5846 <printf>
3ffa: 4505 li a0,1
3ffc: 00001097 auipc ra,0x1
4000: 4d0080e7 jalr 1232(ra) # 54cc <exit>
4004: 00001097 auipc ra,0x1
4008: 4c0080e7 jalr 1216(ra) # 54c4 <fork>
400c: 00054763 bltz a0,401a <reparent+0x9c>
4010: 4501 li a0,0
4012: 00001097 auipc ra,0x1
4016: 4ba080e7 jalr 1210(ra) # 54cc <exit>
401a: 8552 mv a0,s4
401c: 00001097 auipc ra,0x1
4020: 4e0080e7 jalr 1248(ra) # 54fc <kill>
=======
for (int i = 0; i < 200; i++) {
3fbc: 397d addiw s2,s2,-1
3fbe: fe0910e3 bnez s2,3f9e <reparent+0x20>
exit(0);
3fc2: 4501 li a0,0
3fc4: 00001097 auipc ra,0x1
3fc8: 508080e7 jalr 1288(ra) # 54cc <exit>
printf("%s: fork failed\n", s);
3fcc: 85ce mv a1,s3
3fce: 00002517 auipc a0,0x2
3fd2: 56250513 addi a0,a0,1378 # 6530 <l_free+0xaca>
3fd6: 00002097 auipc ra,0x2
3fda: 86e080e7 jalr -1938(ra) # 5844 <printf>
exit(1);
3fde: 4505 li a0,1
3fe0: 00001097 auipc ra,0x1
3fe4: 4ec080e7 jalr 1260(ra) # 54cc <exit>
printf("%s: wait wrong pid\n", s);
3fe8: 85ce mv a1,s3
3fea: 00002517 auipc a0,0x2
3fee: 6ce50513 addi a0,a0,1742 # 66b8 <l_free+0xc52>
3ff2: 00002097 auipc ra,0x2
3ff6: 852080e7 jalr -1966(ra) # 5844 <printf>
exit(1);
3ffa: 4505 li a0,1
3ffc: 00001097 auipc ra,0x1
4000: 4d0080e7 jalr 1232(ra) # 54cc <exit>
int pid2 = fork();
4004: 00001097 auipc ra,0x1
4008: 4c0080e7 jalr 1216(ra) # 54c4 <fork>
if (pid2 < 0) {
400c: 00054763 bltz a0,401a <reparent+0x9c>
exit(0);
4010: 4501 li a0,0
4012: 00001097 auipc ra,0x1
4016: 4ba080e7 jalr 1210(ra) # 54cc <exit>
kill(master_pid);
401a: 8552 mv a0,s4
401c: 00001097 auipc ra,0x1
4020: 4e0080e7 jalr 1248(ra) # 54fc <kill>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4024: 4505 li a0,1
4026: 00001097 auipc ra,0x1
402a: 4a6080e7 jalr 1190(ra) # 54cc <exit>
000000000000402e <mem>:
<<<<<<< HEAD
=======
void mem(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
402e: 7139 addi sp,sp,-64
4030: fc06 sd ra,56(sp)
4032: f822 sd s0,48(sp)
4034: f426 sd s1,40(sp)
4036: f04a sd s2,32(sp)
4038: ec4e sd s3,24(sp)
403a: 0080 addi s0,sp,64
403c: 89aa mv s3,a0
<<<<<<< HEAD
403e: 00001097 auipc ra,0x1
4042: 486080e7 jalr 1158(ra) # 54c4 <fork>
4046: 4481 li s1,0
4048: 6909 lui s2,0x2
404a: 71190913 addi s2,s2,1809 # 2711 <sbrkbugs+0x3d>
404e: c115 beqz a0,4072 <mem+0x44>
4050: fcc40513 addi a0,s0,-52
4054: 00001097 auipc ra,0x1
4058: 480080e7 jalr 1152(ra) # 54d4 <wait>
405c: fcc42503 lw a0,-52(s0)
4060: 57fd li a5,-1
4062: 06f50363 beq a0,a5,40c8 <mem+0x9a>
4066: 00001097 auipc ra,0x1
406a: 466080e7 jalr 1126(ra) # 54cc <exit>
406e: e104 sd s1,0(a0)
4070: 84aa mv s1,a0
4072: 854a mv a0,s2
4074: 00002097 auipc ra,0x2
4078: 890080e7 jalr -1904(ra) # 5904 <malloc>
407c: f96d bnez a0,406e <mem+0x40>
407e: c881 beqz s1,408e <mem+0x60>
4080: 8526 mv a0,s1
4082: 6084 ld s1,0(s1)
4084: 00001097 auipc ra,0x1
4088: 7f8080e7 jalr 2040(ra) # 587c <free>
408c: f8f5 bnez s1,4080 <mem+0x52>
408e: 6515 lui a0,0x5
4090: 00002097 auipc ra,0x2
4094: 874080e7 jalr -1932(ra) # 5904 <malloc>
4098: c911 beqz a0,40ac <mem+0x7e>
409a: 00001097 auipc ra,0x1
409e: 7e2080e7 jalr 2018(ra) # 587c <free>
40a2: 4501 li a0,0
40a4: 00001097 auipc ra,0x1
40a8: 428080e7 jalr 1064(ra) # 54cc <exit>
40ac: 85ce mv a1,s3
40ae: 00003517 auipc a0,0x3
40b2: 72250513 addi a0,a0,1826 # 77d0 <l_free+0x1d68>
40b6: 00001097 auipc ra,0x1
40ba: 790080e7 jalr 1936(ra) # 5846 <printf>
40be: 4505 li a0,1
40c0: 00001097 auipc ra,0x1
40c4: 40c080e7 jalr 1036(ra) # 54cc <exit>
=======
if ((pid = fork()) == 0) {
403e: 00001097 auipc ra,0x1
4042: 486080e7 jalr 1158(ra) # 54c4 <fork>
m1 = 0;
4046: 4481 li s1,0
while ((m2 = malloc(10001)) != 0) {
4048: 6909 lui s2,0x2
404a: 71190913 addi s2,s2,1809 # 2711 <sbrkbugs+0x3d>
if ((pid = fork()) == 0) {
404e: c115 beqz a0,4072 <mem+0x44>
wait(&xstatus);
4050: fcc40513 addi a0,s0,-52
4054: 00001097 auipc ra,0x1
4058: 480080e7 jalr 1152(ra) # 54d4 <wait>
if (xstatus == -1) {
405c: fcc42503 lw a0,-52(s0)
4060: 57fd li a5,-1
4062: 06f50363 beq a0,a5,40c8 <mem+0x9a>
exit(xstatus);
4066: 00001097 auipc ra,0x1
406a: 466080e7 jalr 1126(ra) # 54cc <exit>
*(char **)m2 = m1;
406e: e104 sd s1,0(a0)
m1 = m2;
4070: 84aa mv s1,a0
while ((m2 = malloc(10001)) != 0) {
4072: 854a mv a0,s2
4074: 00002097 auipc ra,0x2
4078: 88e080e7 jalr -1906(ra) # 5902 <malloc>
407c: f96d bnez a0,406e <mem+0x40>
while (m1) {
407e: c881 beqz s1,408e <mem+0x60>
m2 = *(char **)m1;
4080: 8526 mv a0,s1
4082: 6084 ld s1,0(s1)
free(m1);
4084: 00001097 auipc ra,0x1
4088: 7f6080e7 jalr 2038(ra) # 587a <free>
while (m1) {
408c: f8f5 bnez s1,4080 <mem+0x52>
m1 = malloc(1024 * 20);
408e: 6515 lui a0,0x5
4090: 00002097 auipc ra,0x2
4094: 872080e7 jalr -1934(ra) # 5902 <malloc>
if (m1 == 0) {
4098: c911 beqz a0,40ac <mem+0x7e>
free(m1);
409a: 00001097 auipc ra,0x1
409e: 7e0080e7 jalr 2016(ra) # 587a <free>
exit(0);
40a2: 4501 li a0,0
40a4: 00001097 auipc ra,0x1
40a8: 428080e7 jalr 1064(ra) # 54cc <exit>
printf("couldn't allocate mem?!!\n", s);
40ac: 85ce mv a1,s3
40ae: 00003517 auipc a0,0x3
40b2: 72250513 addi a0,a0,1826 # 77d0 <l_free+0x1d6a>
40b6: 00001097 auipc ra,0x1
40ba: 78e080e7 jalr 1934(ra) # 5844 <printf>
exit(1);
40be: 4505 li a0,1
40c0: 00001097 auipc ra,0x1
40c4: 40c080e7 jalr 1036(ra) # 54cc <exit>
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
40c8: 4501 li a0,0
40ca: 00001097 auipc ra,0x1
40ce: 402080e7 jalr 1026(ra) # 54cc <exit>
00000000000040d2 <sharedfd>:
<<<<<<< HEAD
=======
void sharedfd(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
40d2: 7159 addi sp,sp,-112
40d4: f486 sd ra,104(sp)
40d6: f0a2 sd s0,96(sp)
40d8: eca6 sd s1,88(sp)
40da: e8ca sd s2,80(sp)
40dc: e4ce sd s3,72(sp)
40de: e0d2 sd s4,64(sp)
40e0: fc56 sd s5,56(sp)
40e2: f85a sd s6,48(sp)
40e4: f45e sd s7,40(sp)
40e6: 1880 addi s0,sp,112
40e8: 8a2a mv s4,a0
<<<<<<< HEAD
40ea: 00002517 auipc a0,0x2
40ee: b2650513 addi a0,a0,-1242 # 5c10 <l_free+0x1a8>
40f2: 00001097 auipc ra,0x1
40f6: 42a080e7 jalr 1066(ra) # 551c <unlink>
40fa: 20200593 li a1,514
40fe: 00002517 auipc a0,0x2
4102: b1250513 addi a0,a0,-1262 # 5c10 <l_free+0x1a8>
4106: 00001097 auipc ra,0x1
410a: 406080e7 jalr 1030(ra) # 550c <open>
410e: 04054a63 bltz a0,4162 <sharedfd+0x90>
4112: 892a mv s2,a0
4114: 00001097 auipc ra,0x1
4118: 3b0080e7 jalr 944(ra) # 54c4 <fork>
411c: 89aa mv s3,a0
=======
unlink("sharedfd");
40ea: 00002517 auipc a0,0x2
40ee: b2650513 addi a0,a0,-1242 # 5c10 <l_free+0x1aa>
40f2: 00001097 auipc ra,0x1
40f6: 42a080e7 jalr 1066(ra) # 551c <unlink>
fd = open("sharedfd", O_CREATE | O_RDWR);
40fa: 20200593 li a1,514
40fe: 00002517 auipc a0,0x2
4102: b1250513 addi a0,a0,-1262 # 5c10 <l_free+0x1aa>
4106: 00001097 auipc ra,0x1
410a: 406080e7 jalr 1030(ra) # 550c <open>
if (fd < 0) {
410e: 04054a63 bltz a0,4162 <sharedfd+0x90>
4112: 892a mv s2,a0
pid = fork();
4114: 00001097 auipc ra,0x1
4118: 3b0080e7 jalr 944(ra) # 54c4 <fork>
411c: 89aa mv s3,a0
memset(buf, pid == 0 ? 'c' : 'p', sizeof(buf));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
411e: 06300593 li a1,99
4122: c119 beqz a0,4128 <sharedfd+0x56>
4124: 07000593 li a1,112
4128: 4629 li a2,10
412a: fa040513 addi a0,s0,-96
412e: 00001097 auipc ra,0x1
4132: 1a2080e7 jalr 418(ra) # 52d0 <memset>
4136: 3e800493 li s1,1000
<<<<<<< HEAD
=======
if (write(fd, buf, sizeof(buf)) != sizeof(buf)) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
413a: 4629 li a2,10
413c: fa040593 addi a1,s0,-96
4140: 854a mv a0,s2
4142: 00001097 auipc ra,0x1
4146: 3aa080e7 jalr 938(ra) # 54ec <write>
414a: 47a9 li a5,10
414c: 02f51963 bne a0,a5,417e <sharedfd+0xac>
<<<<<<< HEAD
4150: 34fd addiw s1,s1,-1
4152: f4e5 bnez s1,413a <sharedfd+0x68>
4154: 04099363 bnez s3,419a <sharedfd+0xc8>
4158: 4501 li a0,0
415a: 00001097 auipc ra,0x1
415e: 372080e7 jalr 882(ra) # 54cc <exit>
4162: 85d2 mv a1,s4
4164: 00003517 auipc a0,0x3
4168: 68c50513 addi a0,a0,1676 # 77f0 <l_free+0x1d88>
416c: 00001097 auipc ra,0x1
4170: 6da080e7 jalr 1754(ra) # 5846 <printf>
4174: 4505 li a0,1
4176: 00001097 auipc ra,0x1
417a: 356080e7 jalr 854(ra) # 54cc <exit>
417e: 85d2 mv a1,s4
4180: 00003517 auipc a0,0x3
4184: 69850513 addi a0,a0,1688 # 7818 <l_free+0x1db0>
4188: 00001097 auipc ra,0x1
418c: 6be080e7 jalr 1726(ra) # 5846 <printf>
4190: 4505 li a0,1
4192: 00001097 auipc ra,0x1
4196: 33a080e7 jalr 826(ra) # 54cc <exit>
419a: f9c40513 addi a0,s0,-100
419e: 00001097 auipc ra,0x1
41a2: 336080e7 jalr 822(ra) # 54d4 <wait>
41a6: f9c42983 lw s3,-100(s0)
41aa: 00098763 beqz s3,41b8 <sharedfd+0xe6>
41ae: 854e mv a0,s3
41b0: 00001097 auipc ra,0x1
41b4: 31c080e7 jalr 796(ra) # 54cc <exit>
41b8: 854a mv a0,s2
41ba: 00001097 auipc ra,0x1
41be: 33a080e7 jalr 826(ra) # 54f4 <close>
41c2: 4581 li a1,0
41c4: 00002517 auipc a0,0x2
41c8: a4c50513 addi a0,a0,-1460 # 5c10 <l_free+0x1a8>
41cc: 00001097 auipc ra,0x1
41d0: 340080e7 jalr 832(ra) # 550c <open>
41d4: 8baa mv s7,a0
41d6: 8ace mv s5,s3
41d8: 02054563 bltz a0,4202 <sharedfd+0x130>
41dc: faa40913 addi s2,s0,-86
41e0: 06300493 li s1,99
41e4: 07000b13 li s6,112
=======
for (i = 0; i < N; i++) {
4150: 34fd addiw s1,s1,-1
4152: f4e5 bnez s1,413a <sharedfd+0x68>
if (pid == 0) {
4154: 04099363 bnez s3,419a <sharedfd+0xc8>
exit(0);
4158: 4501 li a0,0
415a: 00001097 auipc ra,0x1
415e: 372080e7 jalr 882(ra) # 54cc <exit>
printf("%s: cannot open sharedfd for writing", s);
4162: 85d2 mv a1,s4
4164: 00003517 auipc a0,0x3
4168: 68c50513 addi a0,a0,1676 # 77f0 <l_free+0x1d8a>
416c: 00001097 auipc ra,0x1
4170: 6d8080e7 jalr 1752(ra) # 5844 <printf>
exit(1);
4174: 4505 li a0,1
4176: 00001097 auipc ra,0x1
417a: 356080e7 jalr 854(ra) # 54cc <exit>
printf("%s: write sharedfd failed\n", s);
417e: 85d2 mv a1,s4
4180: 00003517 auipc a0,0x3
4184: 69850513 addi a0,a0,1688 # 7818 <l_free+0x1db2>
4188: 00001097 auipc ra,0x1
418c: 6bc080e7 jalr 1724(ra) # 5844 <printf>
exit(1);
4190: 4505 li a0,1
4192: 00001097 auipc ra,0x1
4196: 33a080e7 jalr 826(ra) # 54cc <exit>
wait(&xstatus);
419a: f9c40513 addi a0,s0,-100
419e: 00001097 auipc ra,0x1
41a2: 336080e7 jalr 822(ra) # 54d4 <wait>
if (xstatus != 0)
41a6: f9c42983 lw s3,-100(s0)
41aa: 00098763 beqz s3,41b8 <sharedfd+0xe6>
exit(xstatus);
41ae: 854e mv a0,s3
41b0: 00001097 auipc ra,0x1
41b4: 31c080e7 jalr 796(ra) # 54cc <exit>
close(fd);
41b8: 854a mv a0,s2
41ba: 00001097 auipc ra,0x1
41be: 33a080e7 jalr 826(ra) # 54f4 <close>
fd = open("sharedfd", 0);
41c2: 4581 li a1,0
41c4: 00002517 auipc a0,0x2
41c8: a4c50513 addi a0,a0,-1460 # 5c10 <l_free+0x1aa>
41cc: 00001097 auipc ra,0x1
41d0: 340080e7 jalr 832(ra) # 550c <open>
41d4: 8baa mv s7,a0
nc = np = 0;
41d6: 8ace mv s5,s3
if (fd < 0) {
41d8: 02054563 bltz a0,4202 <sharedfd+0x130>
41dc: faa40913 addi s2,s0,-86
if (buf[i] == 'c')
41e0: 06300493 li s1,99
if (buf[i] == 'p')
41e4: 07000b13 li s6,112
while ((n = read(fd, buf, sizeof(buf))) > 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
41e8: 4629 li a2,10
41ea: fa040593 addi a1,s0,-96
41ee: 855e mv a0,s7
41f0: 00001097 auipc ra,0x1
41f4: 2f4080e7 jalr 756(ra) # 54e4 <read>
41f8: 02a05f63 blez a0,4236 <sharedfd+0x164>
41fc: fa040793 addi a5,s0,-96
4200: a01d j 4226 <sharedfd+0x154>
<<<<<<< HEAD
4202: 85d2 mv a1,s4
4204: 00003517 auipc a0,0x3
4208: 63450513 addi a0,a0,1588 # 7838 <l_free+0x1dd0>
420c: 00001097 auipc ra,0x1
4210: 63a080e7 jalr 1594(ra) # 5846 <printf>
4214: 4505 li a0,1
4216: 00001097 auipc ra,0x1
421a: 2b6080e7 jalr 694(ra) # 54cc <exit>
421e: 2985 addiw s3,s3,1
4220: 0785 addi a5,a5,1
4222: fd2783e3 beq a5,s2,41e8 <sharedfd+0x116>
4226: 0007c703 lbu a4,0(a5)
422a: fe970ae3 beq a4,s1,421e <sharedfd+0x14c>
422e: ff6719e3 bne a4,s6,4220 <sharedfd+0x14e>
4232: 2a85 addiw s5,s5,1
4234: b7f5 j 4220 <sharedfd+0x14e>
4236: 855e mv a0,s7
4238: 00001097 auipc ra,0x1
423c: 2bc080e7 jalr 700(ra) # 54f4 <close>
4240: 00002517 auipc a0,0x2
4244: 9d050513 addi a0,a0,-1584 # 5c10 <l_free+0x1a8>
4248: 00001097 auipc ra,0x1
424c: 2d4080e7 jalr 724(ra) # 551c <unlink>
=======
printf("%s: cannot open sharedfd for reading\n", s);
4202: 85d2 mv a1,s4
4204: 00003517 auipc a0,0x3
4208: 63450513 addi a0,a0,1588 # 7838 <l_free+0x1dd2>
420c: 00001097 auipc ra,0x1
4210: 638080e7 jalr 1592(ra) # 5844 <printf>
exit(1);
4214: 4505 li a0,1
4216: 00001097 auipc ra,0x1
421a: 2b6080e7 jalr 694(ra) # 54cc <exit>
nc++;
421e: 2985 addiw s3,s3,1
for (i = 0; i < sizeof(buf); i++) {
4220: 0785 addi a5,a5,1
4222: fd2783e3 beq a5,s2,41e8 <sharedfd+0x116>
if (buf[i] == 'c')
4226: 0007c703 lbu a4,0(a5)
422a: fe970ae3 beq a4,s1,421e <sharedfd+0x14c>
if (buf[i] == 'p')
422e: ff6719e3 bne a4,s6,4220 <sharedfd+0x14e>
np++;
4232: 2a85 addiw s5,s5,1
4234: b7f5 j 4220 <sharedfd+0x14e>
close(fd);
4236: 855e mv a0,s7
4238: 00001097 auipc ra,0x1
423c: 2bc080e7 jalr 700(ra) # 54f4 <close>
unlink("sharedfd");
4240: 00002517 auipc a0,0x2
4244: 9d050513 addi a0,a0,-1584 # 5c10 <l_free+0x1aa>
4248: 00001097 auipc ra,0x1
424c: 2d4080e7 jalr 724(ra) # 551c <unlink>
if (nc == N * SZ && np == N * SZ) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4250: 6789 lui a5,0x2
4252: 71078793 addi a5,a5,1808 # 2710 <sbrkbugs+0x3c>
4256: 00f99763 bne s3,a5,4264 <sharedfd+0x192>
425a: 6789 lui a5,0x2
425c: 71078793 addi a5,a5,1808 # 2710 <sbrkbugs+0x3c>
4260: 02fa8063 beq s5,a5,4280 <sharedfd+0x1ae>
<<<<<<< HEAD
4264: 85d2 mv a1,s4
4266: 00003517 auipc a0,0x3
426a: 5fa50513 addi a0,a0,1530 # 7860 <l_free+0x1df8>
426e: 00001097 auipc ra,0x1
4272: 5d8080e7 jalr 1496(ra) # 5846 <printf>
4276: 4505 li a0,1
4278: 00001097 auipc ra,0x1
427c: 254080e7 jalr 596(ra) # 54cc <exit>
=======
printf("%s: nc/np test fails\n", s);
4264: 85d2 mv a1,s4
4266: 00003517 auipc a0,0x3
426a: 5fa50513 addi a0,a0,1530 # 7860 <l_free+0x1dfa>
426e: 00001097 auipc ra,0x1
4272: 5d6080e7 jalr 1494(ra) # 5844 <printf>
exit(1);
4276: 4505 li a0,1
4278: 00001097 auipc ra,0x1
427c: 254080e7 jalr 596(ra) # 54cc <exit>
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4280: 4501 li a0,0
4282: 00001097 auipc ra,0x1
4286: 24a080e7 jalr 586(ra) # 54cc <exit>
000000000000428a <fourfiles>:
<<<<<<< HEAD
=======
void fourfiles(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
428a: 7171 addi sp,sp,-176
428c: f506 sd ra,168(sp)
428e: f122 sd s0,160(sp)
4290: ed26 sd s1,152(sp)
4292: e94a sd s2,144(sp)
4294: e54e sd s3,136(sp)
4296: e152 sd s4,128(sp)
4298: fcd6 sd s5,120(sp)
429a: f8da sd s6,112(sp)
429c: f4de sd s7,104(sp)
429e: f0e2 sd s8,96(sp)
42a0: ece6 sd s9,88(sp)
42a2: e8ea sd s10,80(sp)
42a4: e4ee sd s11,72(sp)
42a6: 1900 addi s0,sp,176
42a8: f4a43c23 sd a0,-168(s0)
<<<<<<< HEAD
42ac: 00001797 auipc a5,0x1
42b0: 7cc78793 addi a5,a5,1996 # 5a78 <l_free+0x10>
42b4: f6f43823 sd a5,-144(s0)
42b8: 00001797 auipc a5,0x1
42bc: 7c878793 addi a5,a5,1992 # 5a80 <l_free+0x18>
42c0: f6f43c23 sd a5,-136(s0)
42c4: 00001797 auipc a5,0x1
42c8: 7c478793 addi a5,a5,1988 # 5a88 <l_free+0x20>
42cc: f8f43023 sd a5,-128(s0)
42d0: 00001797 auipc a5,0x1
42d4: 7c078793 addi a5,a5,1984 # 5a90 <l_free+0x28>
42d8: f8f43423 sd a5,-120(s0)
42dc: f7040c13 addi s8,s0,-144
42e0: 8962 mv s2,s8
42e2: 4481 li s1,0
42e4: 4a11 li s4,4
42e6: 00093983 ld s3,0(s2)
42ea: 854e mv a0,s3
42ec: 00001097 auipc ra,0x1
42f0: 230080e7 jalr 560(ra) # 551c <unlink>
42f4: 00001097 auipc ra,0x1
42f8: 1d0080e7 jalr 464(ra) # 54c4 <fork>
42fc: 04054463 bltz a0,4344 <fourfiles+0xba>
4300: c12d beqz a0,4362 <fourfiles+0xd8>
=======
char *names[] = {"f0", "f1", "f2", "f3"};
42ac: 00001797 auipc a5,0x1
42b0: 7cc78793 addi a5,a5,1996 # 5a78 <l_free+0x12>
42b4: f6f43823 sd a5,-144(s0)
42b8: 00001797 auipc a5,0x1
42bc: 7c878793 addi a5,a5,1992 # 5a80 <l_free+0x1a>
42c0: f6f43c23 sd a5,-136(s0)
42c4: 00001797 auipc a5,0x1
42c8: 7c478793 addi a5,a5,1988 # 5a88 <l_free+0x22>
42cc: f8f43023 sd a5,-128(s0)
42d0: 00001797 auipc a5,0x1
42d4: 7c078793 addi a5,a5,1984 # 5a90 <l_free+0x2a>
42d8: f8f43423 sd a5,-120(s0)
for (pi = 0; pi < NCHILD; pi++) {
42dc: f7040c13 addi s8,s0,-144
char *names[] = {"f0", "f1", "f2", "f3"};
42e0: 8962 mv s2,s8
for (pi = 0; pi < NCHILD; pi++) {
42e2: 4481 li s1,0
42e4: 4a11 li s4,4
fname = names[pi];
42e6: 00093983 ld s3,0(s2)
unlink(fname);
42ea: 854e mv a0,s3
42ec: 00001097 auipc ra,0x1
42f0: 230080e7 jalr 560(ra) # 551c <unlink>
pid = fork();
42f4: 00001097 auipc ra,0x1
42f8: 1d0080e7 jalr 464(ra) # 54c4 <fork>
if (pid < 0) {
42fc: 04054463 bltz a0,4344 <fourfiles+0xba>
if (pid == 0) {
4300: c12d beqz a0,4362 <fourfiles+0xd8>
for (pi = 0; pi < NCHILD; pi++) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4302: 2485 addiw s1,s1,1
4304: 0921 addi s2,s2,8
4306: ff4490e3 bne s1,s4,42e6 <fourfiles+0x5c>
430a: 4491 li s1,4
<<<<<<< HEAD
430c: f6c40513 addi a0,s0,-148
4310: 00001097 auipc ra,0x1
4314: 1c4080e7 jalr 452(ra) # 54d4 <wait>
4318: f6c42b03 lw s6,-148(s0)
431c: 0c0b1e63 bnez s6,43f8 <fourfiles+0x16e>
4320: 34fd addiw s1,s1,-1
4322: f4ed bnez s1,430c <fourfiles+0x82>
4324: 03000b93 li s7,48
4328: 00007a17 auipc s4,0x7
432c: 6e8a0a13 addi s4,s4,1768 # ba10 <buf>
4330: 00007a97 auipc s5,0x7
4334: 6e1a8a93 addi s5,s5,1761 # ba11 <buf+0x1>
4338: 6d85 lui s11,0x1
433a: 770d8d93 addi s11,s11,1904 # 1770 <pipe1+0xc8>
433e: 03400d13 li s10,52
4342: aa1d j 4478 <fourfiles+0x1ee>
4344: f5843583 ld a1,-168(s0)
4348: 00002517 auipc a0,0x2
434c: 5d850513 addi a0,a0,1496 # 6920 <l_free+0xeb8>
4350: 00001097 auipc ra,0x1
4354: 4f6080e7 jalr 1270(ra) # 5846 <printf>
4358: 4505 li a0,1
435a: 00001097 auipc ra,0x1
435e: 172080e7 jalr 370(ra) # 54cc <exit>
=======
wait(&xstatus);
430c: f6c40513 addi a0,s0,-148
4310: 00001097 auipc ra,0x1
4314: 1c4080e7 jalr 452(ra) # 54d4 <wait>
if (xstatus != 0)
4318: f6c42b03 lw s6,-148(s0)
431c: 0c0b1e63 bnez s6,43f8 <fourfiles+0x16e>
for (pi = 0; pi < NCHILD; pi++) {
4320: 34fd addiw s1,s1,-1
4322: f4ed bnez s1,430c <fourfiles+0x82>
4324: 03000b93 li s7,48
while ((n = read(fd, buf, sizeof(buf))) > 0) {
4328: 00007a17 auipc s4,0x7
432c: 690a0a13 addi s4,s4,1680 # b9b8 <buf>
4330: 00007a97 auipc s5,0x7
4334: 689a8a93 addi s5,s5,1673 # b9b9 <buf+0x1>
if (total != N * SZ) {
4338: 6d85 lui s11,0x1
433a: 770d8d93 addi s11,s11,1904 # 1770 <pipe1+0xc8>
for (i = 0; i < NCHILD; i++) {
433e: 03400d13 li s10,52
4342: aa1d j 4478 <fourfiles+0x1ee>
printf("fork failed\n", s);
4344: f5843583 ld a1,-168(s0)
4348: 00002517 auipc a0,0x2
434c: 5d850513 addi a0,a0,1496 # 6920 <l_free+0xeba>
4350: 00001097 auipc ra,0x1
4354: 4f4080e7 jalr 1268(ra) # 5844 <printf>
exit(1);
4358: 4505 li a0,1
435a: 00001097 auipc ra,0x1
435e: 172080e7 jalr 370(ra) # 54cc <exit>
fd = open(fname, O_CREATE | O_RDWR);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4362: 20200593 li a1,514
4366: 854e mv a0,s3
4368: 00001097 auipc ra,0x1
436c: 1a4080e7 jalr 420(ra) # 550c <open>
4370: 892a mv s2,a0
<<<<<<< HEAD
4372: 04054763 bltz a0,43c0 <fourfiles+0x136>
4376: 1f400613 li a2,500
437a: 0304859b addiw a1,s1,48
437e: 00007517 auipc a0,0x7
4382: 69250513 addi a0,a0,1682 # ba10 <buf>
4386: 00001097 auipc ra,0x1
438a: f4a080e7 jalr -182(ra) # 52d0 <memset>
438e: 44b1 li s1,12
4390: 00007997 auipc s3,0x7
4394: 68098993 addi s3,s3,1664 # ba10 <buf>
=======
if (fd < 0) {
4372: 04054763 bltz a0,43c0 <fourfiles+0x136>
memset(buf, '0' + pi, SZ);
4376: 1f400613 li a2,500
437a: 0304859b addiw a1,s1,48
437e: 00007517 auipc a0,0x7
4382: 63a50513 addi a0,a0,1594 # b9b8 <buf>
4386: 00001097 auipc ra,0x1
438a: f4a080e7 jalr -182(ra) # 52d0 <memset>
438e: 44b1 li s1,12
if ((n = write(fd, buf, SZ)) != SZ) {
4390: 00007997 auipc s3,0x7
4394: 62898993 addi s3,s3,1576 # b9b8 <buf>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4398: 1f400613 li a2,500
439c: 85ce mv a1,s3
439e: 854a mv a0,s2
43a0: 00001097 auipc ra,0x1
43a4: 14c080e7 jalr 332(ra) # 54ec <write>
43a8: 85aa mv a1,a0
43aa: 1f400793 li a5,500
43ae: 02f51863 bne a0,a5,43de <fourfiles+0x154>
<<<<<<< HEAD
43b2: 34fd addiw s1,s1,-1
43b4: f0f5 bnez s1,4398 <fourfiles+0x10e>
43b6: 4501 li a0,0
43b8: 00001097 auipc ra,0x1
43bc: 114080e7 jalr 276(ra) # 54cc <exit>
43c0: f5843583 ld a1,-168(s0)
43c4: 00003517 auipc a0,0x3
43c8: 4b450513 addi a0,a0,1204 # 7878 <l_free+0x1e10>
43cc: 00001097 auipc ra,0x1
43d0: 47a080e7 jalr 1146(ra) # 5846 <printf>
43d4: 4505 li a0,1
43d6: 00001097 auipc ra,0x1
43da: 0f6080e7 jalr 246(ra) # 54cc <exit>
43de: 00003517 auipc a0,0x3
43e2: 4aa50513 addi a0,a0,1194 # 7888 <l_free+0x1e20>
43e6: 00001097 auipc ra,0x1
43ea: 460080e7 jalr 1120(ra) # 5846 <printf>
43ee: 4505 li a0,1
43f0: 00001097 auipc ra,0x1
43f4: 0dc080e7 jalr 220(ra) # 54cc <exit>
43f8: 855a mv a0,s6
43fa: 00001097 auipc ra,0x1
43fe: 0d2080e7 jalr 210(ra) # 54cc <exit>
4402: f5843583 ld a1,-168(s0)
4406: 00003517 auipc a0,0x3
440a: 49a50513 addi a0,a0,1178 # 78a0 <l_free+0x1e38>
440e: 00001097 auipc ra,0x1
4412: 438080e7 jalr 1080(ra) # 5846 <printf>
4416: 4505 li a0,1
4418: 00001097 auipc ra,0x1
441c: 0b4080e7 jalr 180(ra) # 54cc <exit>
4420: 00a9093b addw s2,s2,a0
=======
for (i = 0; i < N; i++) {
43b2: 34fd addiw s1,s1,-1
43b4: f0f5 bnez s1,4398 <fourfiles+0x10e>
exit(0);
43b6: 4501 li a0,0
43b8: 00001097 auipc ra,0x1
43bc: 114080e7 jalr 276(ra) # 54cc <exit>
printf("create failed\n", s);
43c0: f5843583 ld a1,-168(s0)
43c4: 00003517 auipc a0,0x3
43c8: 4b450513 addi a0,a0,1204 # 7878 <l_free+0x1e12>
43cc: 00001097 auipc ra,0x1
43d0: 478080e7 jalr 1144(ra) # 5844 <printf>
exit(1);
43d4: 4505 li a0,1
43d6: 00001097 auipc ra,0x1
43da: 0f6080e7 jalr 246(ra) # 54cc <exit>
printf("write failed %d\n", n);
43de: 00003517 auipc a0,0x3
43e2: 4aa50513 addi a0,a0,1194 # 7888 <l_free+0x1e22>
43e6: 00001097 auipc ra,0x1
43ea: 45e080e7 jalr 1118(ra) # 5844 <printf>
exit(1);
43ee: 4505 li a0,1
43f0: 00001097 auipc ra,0x1
43f4: 0dc080e7 jalr 220(ra) # 54cc <exit>
exit(xstatus);
43f8: 855a mv a0,s6
43fa: 00001097 auipc ra,0x1
43fe: 0d2080e7 jalr 210(ra) # 54cc <exit>
printf("wrong char\n", s);
4402: f5843583 ld a1,-168(s0)
4406: 00003517 auipc a0,0x3
440a: 49a50513 addi a0,a0,1178 # 78a0 <l_free+0x1e3a>
440e: 00001097 auipc ra,0x1
4412: 436080e7 jalr 1078(ra) # 5844 <printf>
exit(1);
4416: 4505 li a0,1
4418: 00001097 auipc ra,0x1
441c: 0b4080e7 jalr 180(ra) # 54cc <exit>
total += n;
4420: 00a9093b addw s2,s2,a0
while ((n = read(fd, buf, sizeof(buf))) > 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4424: 660d lui a2,0x3
4426: 85d2 mv a1,s4
4428: 854e mv a0,s3
442a: 00001097 auipc ra,0x1
442e: 0ba080e7 jalr 186(ra) # 54e4 <read>
4432: 02a05363 blez a0,4458 <fourfiles+0x1ce>
4436: 00007797 auipc a5,0x7
<<<<<<< HEAD
443a: 5da78793 addi a5,a5,1498 # ba10 <buf>
=======
443a: 58278793 addi a5,a5,1410 # b9b8 <buf>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
443e: fff5069b addiw a3,a0,-1
4442: 1682 slli a3,a3,0x20
4444: 9281 srli a3,a3,0x20
4446: 96d6 add a3,a3,s5
<<<<<<< HEAD
4448: 0007c703 lbu a4,0(a5)
444c: fa971be3 bne a4,s1,4402 <fourfiles+0x178>
4450: 0785 addi a5,a5,1
4452: fed79be3 bne a5,a3,4448 <fourfiles+0x1be>
4456: b7e9 j 4420 <fourfiles+0x196>
4458: 854e mv a0,s3
445a: 00001097 auipc ra,0x1
445e: 09a080e7 jalr 154(ra) # 54f4 <close>
4462: 03b91863 bne s2,s11,4492 <fourfiles+0x208>
4466: 8566 mv a0,s9
4468: 00001097 auipc ra,0x1
446c: 0b4080e7 jalr 180(ra) # 551c <unlink>
4470: 0c21 addi s8,s8,8
4472: 2b85 addiw s7,s7,1
4474: 03ab8d63 beq s7,s10,44ae <fourfiles+0x224>
4478: 000c3c83 ld s9,0(s8)
=======
if (buf[j] != '0' + i) {
4448: 0007c703 lbu a4,0(a5)
444c: fa971be3 bne a4,s1,4402 <fourfiles+0x178>
for (j = 0; j < n; j++) {
4450: 0785 addi a5,a5,1
4452: fed79be3 bne a5,a3,4448 <fourfiles+0x1be>
4456: b7e9 j 4420 <fourfiles+0x196>
close(fd);
4458: 854e mv a0,s3
445a: 00001097 auipc ra,0x1
445e: 09a080e7 jalr 154(ra) # 54f4 <close>
if (total != N * SZ) {
4462: 03b91863 bne s2,s11,4492 <fourfiles+0x208>
unlink(fname);
4466: 8566 mv a0,s9
4468: 00001097 auipc ra,0x1
446c: 0b4080e7 jalr 180(ra) # 551c <unlink>
for (i = 0; i < NCHILD; i++) {
4470: 0c21 addi s8,s8,8
4472: 2b85 addiw s7,s7,1
4474: 03ab8d63 beq s7,s10,44ae <fourfiles+0x224>
fname = names[i];
4478: 000c3c83 ld s9,0(s8)
fd = open(fname, 0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
447c: 4581 li a1,0
447e: 8566 mv a0,s9
4480: 00001097 auipc ra,0x1
4484: 08c080e7 jalr 140(ra) # 550c <open>
4488: 89aa mv s3,a0
<<<<<<< HEAD
448a: 895a mv s2,s6
448c: 000b849b sext.w s1,s7
4490: bf51 j 4424 <fourfiles+0x19a>
4492: 85ca mv a1,s2
4494: 00003517 auipc a0,0x3
4498: 41c50513 addi a0,a0,1052 # 78b0 <l_free+0x1e48>
449c: 00001097 auipc ra,0x1
44a0: 3aa080e7 jalr 938(ra) # 5846 <printf>
44a4: 4505 li a0,1
44a6: 00001097 auipc ra,0x1
44aa: 026080e7 jalr 38(ra) # 54cc <exit>
=======
total = 0;
448a: 895a mv s2,s6
if (buf[j] != '0' + i) {
448c: 000b849b sext.w s1,s7
while ((n = read(fd, buf, sizeof(buf))) > 0) {
4490: bf51 j 4424 <fourfiles+0x19a>
printf("wrong length %d\n", total);
4492: 85ca mv a1,s2
4494: 00003517 auipc a0,0x3
4498: 41c50513 addi a0,a0,1052 # 78b0 <l_free+0x1e4a>
449c: 00001097 auipc ra,0x1
44a0: 3a8080e7 jalr 936(ra) # 5844 <printf>
exit(1);
44a4: 4505 li a0,1
44a6: 00001097 auipc ra,0x1
44aa: 026080e7 jalr 38(ra) # 54cc <exit>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
44ae: 70aa ld ra,168(sp)
44b0: 740a ld s0,160(sp)
44b2: 64ea ld s1,152(sp)
44b4: 694a ld s2,144(sp)
44b6: 69aa ld s3,136(sp)
44b8: 6a0a ld s4,128(sp)
44ba: 7ae6 ld s5,120(sp)
44bc: 7b46 ld s6,112(sp)
44be: 7ba6 ld s7,104(sp)
44c0: 7c06 ld s8,96(sp)
44c2: 6ce6 ld s9,88(sp)
44c4: 6d46 ld s10,80(sp)
44c6: 6da6 ld s11,72(sp)
44c8: 614d addi sp,sp,176
44ca: 8082 ret
00000000000044cc <concreate>:
<<<<<<< HEAD
=======
void concreate(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
44cc: 7135 addi sp,sp,-160
44ce: ed06 sd ra,152(sp)
44d0: e922 sd s0,144(sp)
44d2: e526 sd s1,136(sp)
44d4: e14a sd s2,128(sp)
44d6: fcce sd s3,120(sp)
44d8: f8d2 sd s4,112(sp)
44da: f4d6 sd s5,104(sp)
44dc: f0da sd s6,96(sp)
44de: ecde sd s7,88(sp)
44e0: 1100 addi s0,sp,160
44e2: 89aa mv s3,a0
<<<<<<< HEAD
44e4: 04300793 li a5,67
44e8: faf40423 sb a5,-88(s0)
44ec: fa040523 sb zero,-86(s0)
44f0: 4901 li s2,0
44f2: 4b0d li s6,3
44f4: 4a85 li s5,1
44f6: 00003b97 auipc s7,0x3
44fa: 3d2b8b93 addi s7,s7,978 # 78c8 <l_free+0x1e60>
44fe: 02800a13 li s4,40
4502: acc1 j 47d2 <concreate+0x306>
=======
file[0] = 'C';
44e4: 04300793 li a5,67
44e8: faf40423 sb a5,-88(s0)
file[2] = '\0';
44ec: fa040523 sb zero,-86(s0)
for (i = 0; i < N; i++) {
44f0: 4901 li s2,0
if (pid && (i % 3) == 1) {
44f2: 4b0d li s6,3
44f4: 4a85 li s5,1
link("C0", file);
44f6: 00003b97 auipc s7,0x3
44fa: 3d2b8b93 addi s7,s7,978 # 78c8 <l_free+0x1e62>
for (i = 0; i < N; i++) {
44fe: 02800a13 li s4,40
4502: acc1 j 47d2 <concreate+0x306>
link("C0", file);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4504: fa840593 addi a1,s0,-88
4508: 855e mv a0,s7
450a: 00001097 auipc ra,0x1
450e: 022080e7 jalr 34(ra) # 552c <link>
<<<<<<< HEAD
4512: a45d j 47b8 <concreate+0x2ec>
=======
if (pid == 0) {
4512: a45d j 47b8 <concreate+0x2ec>
} else if (pid == 0 && (i % 5) == 1) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4514: 4795 li a5,5
4516: 02f9693b remw s2,s2,a5
451a: 4785 li a5,1
451c: 02f90b63 beq s2,a5,4552 <concreate+0x86>
<<<<<<< HEAD
=======
fd = open(file, O_CREATE | O_RDWR);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4520: 20200593 li a1,514
4524: fa840513 addi a0,s0,-88
4528: 00001097 auipc ra,0x1
452c: fe4080e7 jalr -28(ra) # 550c <open>
<<<<<<< HEAD
4530: 26055b63 bgez a0,47a6 <concreate+0x2da>
4534: fa840593 addi a1,s0,-88
4538: 00003517 auipc a0,0x3
453c: 39850513 addi a0,a0,920 # 78d0 <l_free+0x1e68>
4540: 00001097 auipc ra,0x1
4544: 306080e7 jalr 774(ra) # 5846 <printf>
4548: 4505 li a0,1
454a: 00001097 auipc ra,0x1
454e: f82080e7 jalr -126(ra) # 54cc <exit>
4552: fa840593 addi a1,s0,-88
4556: 00003517 auipc a0,0x3
455a: 37250513 addi a0,a0,882 # 78c8 <l_free+0x1e60>
455e: 00001097 auipc ra,0x1
4562: fce080e7 jalr -50(ra) # 552c <link>
4566: 4501 li a0,0
4568: 00001097 auipc ra,0x1
456c: f64080e7 jalr -156(ra) # 54cc <exit>
4570: 4505 li a0,1
4572: 00001097 auipc ra,0x1
4576: f5a080e7 jalr -166(ra) # 54cc <exit>
=======
if (fd < 0) {
4530: 26055b63 bgez a0,47a6 <concreate+0x2da>
printf("concreate create %s failed\n", file);
4534: fa840593 addi a1,s0,-88
4538: 00003517 auipc a0,0x3
453c: 39850513 addi a0,a0,920 # 78d0 <l_free+0x1e6a>
4540: 00001097 auipc ra,0x1
4544: 304080e7 jalr 772(ra) # 5844 <printf>
exit(1);
4548: 4505 li a0,1
454a: 00001097 auipc ra,0x1
454e: f82080e7 jalr -126(ra) # 54cc <exit>
link("C0", file);
4552: fa840593 addi a1,s0,-88
4556: 00003517 auipc a0,0x3
455a: 37250513 addi a0,a0,882 # 78c8 <l_free+0x1e62>
455e: 00001097 auipc ra,0x1
4562: fce080e7 jalr -50(ra) # 552c <link>
exit(0);
4566: 4501 li a0,0
4568: 00001097 auipc ra,0x1
456c: f64080e7 jalr -156(ra) # 54cc <exit>
exit(1);
4570: 4505 li a0,1
4572: 00001097 auipc ra,0x1
4576: f5a080e7 jalr -166(ra) # 54cc <exit>
memset(fa, 0, sizeof(fa));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
457a: 02800613 li a2,40
457e: 4581 li a1,0
4580: f8040513 addi a0,s0,-128
4584: 00001097 auipc ra,0x1
4588: d4c080e7 jalr -692(ra) # 52d0 <memset>
<<<<<<< HEAD
458c: 4581 li a1,0
458e: 00002517 auipc a0,0x2
4592: e0250513 addi a0,a0,-510 # 6390 <l_free+0x928>
4596: 00001097 auipc ra,0x1
459a: f76080e7 jalr -138(ra) # 550c <open>
459e: 892a mv s2,a0
45a0: 8aa6 mv s5,s1
45a2: 04300a13 li s4,67
45a6: 02700b13 li s6,39
45aa: 4b85 li s7,1
=======
fd = open(".", 0);
458c: 4581 li a1,0
458e: 00002517 auipc a0,0x2
4592: e0250513 addi a0,a0,-510 # 6390 <l_free+0x92a>
4596: 00001097 auipc ra,0x1
459a: f76080e7 jalr -138(ra) # 550c <open>
459e: 892a mv s2,a0
n = 0;
45a0: 8aa6 mv s5,s1
if (de.name[0] == 'C' && de.name[2] == '\0') {
45a2: 04300a13 li s4,67
if (i < 0 || i >= sizeof(fa)) {
45a6: 02700b13 li s6,39
fa[i] = 1;
45aa: 4b85 li s7,1
while (read(fd, &de, sizeof(de)) > 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
45ac: 4641 li a2,16
45ae: f7040593 addi a1,s0,-144
45b2: 854a mv a0,s2
45b4: 00001097 auipc ra,0x1
45b8: f30080e7 jalr -208(ra) # 54e4 <read>
45bc: 08a05163 blez a0,463e <concreate+0x172>
<<<<<<< HEAD
45c0: f7045783 lhu a5,-144(s0)
45c4: d7e5 beqz a5,45ac <concreate+0xe0>
=======
if (de.inum == 0)
45c0: f7045783 lhu a5,-144(s0)
45c4: d7e5 beqz a5,45ac <concreate+0xe0>
if (de.name[0] == 'C' && de.name[2] == '\0') {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
45c6: f7244783 lbu a5,-142(s0)
45ca: ff4791e3 bne a5,s4,45ac <concreate+0xe0>
45ce: f7444783 lbu a5,-140(s0)
45d2: ffe9 bnez a5,45ac <concreate+0xe0>
<<<<<<< HEAD
45d4: f7344783 lbu a5,-141(s0)
45d8: fd07879b addiw a5,a5,-48
45dc: 0007871b sext.w a4,a5
45e0: 00eb6f63 bltu s6,a4,45fe <concreate+0x132>
=======
i = de.name[1] - '0';
45d4: f7344783 lbu a5,-141(s0)
45d8: fd07879b addiw a5,a5,-48
45dc: 0007871b sext.w a4,a5
if (i < 0 || i >= sizeof(fa)) {
45e0: 00eb6f63 bltu s6,a4,45fe <concreate+0x132>
if (fa[i]) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
45e4: fb040793 addi a5,s0,-80
45e8: 97ba add a5,a5,a4
45ea: fd07c783 lbu a5,-48(a5)
45ee: eb85 bnez a5,461e <concreate+0x152>
<<<<<<< HEAD
45f0: fb040793 addi a5,s0,-80
45f4: 973e add a4,a4,a5
45f6: fd770823 sb s7,-48(a4) # fd0 <bigdir+0x104>
45fa: 2a85 addiw s5,s5,1
45fc: bf45 j 45ac <concreate+0xe0>
45fe: f7240613 addi a2,s0,-142
4602: 85ce mv a1,s3
4604: 00003517 auipc a0,0x3
4608: 2ec50513 addi a0,a0,748 # 78f0 <l_free+0x1e88>
460c: 00001097 auipc ra,0x1
4610: 23a080e7 jalr 570(ra) # 5846 <printf>
4614: 4505 li a0,1
4616: 00001097 auipc ra,0x1
461a: eb6080e7 jalr -330(ra) # 54cc <exit>
461e: f7240613 addi a2,s0,-142
4622: 85ce mv a1,s3
4624: 00003517 auipc a0,0x3
4628: 2ec50513 addi a0,a0,748 # 7910 <l_free+0x1ea8>
462c: 00001097 auipc ra,0x1
4630: 21a080e7 jalr 538(ra) # 5846 <printf>
4634: 4505 li a0,1
4636: 00001097 auipc ra,0x1
463a: e96080e7 jalr -362(ra) # 54cc <exit>
463e: 854a mv a0,s2
4640: 00001097 auipc ra,0x1
4644: eb4080e7 jalr -332(ra) # 54f4 <close>
4648: 02800793 li a5,40
464c: 00fa9763 bne s5,a5,465a <concreate+0x18e>
4650: 4a8d li s5,3
4652: 4b05 li s6,1
4654: 02800a13 li s4,40
4658: a8c9 j 472a <concreate+0x25e>
465a: 85ce mv a1,s3
465c: 00003517 auipc a0,0x3
4660: 2dc50513 addi a0,a0,732 # 7938 <l_free+0x1ed0>
4664: 00001097 auipc ra,0x1
4668: 1e2080e7 jalr 482(ra) # 5846 <printf>
466c: 4505 li a0,1
466e: 00001097 auipc ra,0x1
4672: e5e080e7 jalr -418(ra) # 54cc <exit>
4676: 85ce mv a1,s3
4678: 00002517 auipc a0,0x2
467c: eb850513 addi a0,a0,-328 # 6530 <l_free+0xac8>
4680: 00001097 auipc ra,0x1
4684: 1c6080e7 jalr 454(ra) # 5846 <printf>
4688: 4505 li a0,1
468a: 00001097 auipc ra,0x1
468e: e42080e7 jalr -446(ra) # 54cc <exit>
=======
fa[i] = 1;
45f0: fb040793 addi a5,s0,-80
45f4: 973e add a4,a4,a5
45f6: fd770823 sb s7,-48(a4) # fd0 <bigdir+0x104>
n++;
45fa: 2a85 addiw s5,s5,1
45fc: bf45 j 45ac <concreate+0xe0>
printf("%s: concreate weird file %s\n", s, de.name);
45fe: f7240613 addi a2,s0,-142
4602: 85ce mv a1,s3
4604: 00003517 auipc a0,0x3
4608: 2ec50513 addi a0,a0,748 # 78f0 <l_free+0x1e8a>
460c: 00001097 auipc ra,0x1
4610: 238080e7 jalr 568(ra) # 5844 <printf>
exit(1);
4614: 4505 li a0,1
4616: 00001097 auipc ra,0x1
461a: eb6080e7 jalr -330(ra) # 54cc <exit>
printf("%s: concreate duplicate file %s\n", s, de.name);
461e: f7240613 addi a2,s0,-142
4622: 85ce mv a1,s3
4624: 00003517 auipc a0,0x3
4628: 2ec50513 addi a0,a0,748 # 7910 <l_free+0x1eaa>
462c: 00001097 auipc ra,0x1
4630: 218080e7 jalr 536(ra) # 5844 <printf>
exit(1);
4634: 4505 li a0,1
4636: 00001097 auipc ra,0x1
463a: e96080e7 jalr -362(ra) # 54cc <exit>
close(fd);
463e: 854a mv a0,s2
4640: 00001097 auipc ra,0x1
4644: eb4080e7 jalr -332(ra) # 54f4 <close>
if (n != N) {
4648: 02800793 li a5,40
464c: 00fa9763 bne s5,a5,465a <concreate+0x18e>
if (((i % 3) == 0 && pid == 0) || ((i % 3) == 1 && pid != 0)) {
4650: 4a8d li s5,3
4652: 4b05 li s6,1
for (i = 0; i < N; i++) {
4654: 02800a13 li s4,40
4658: a8c9 j 472a <concreate+0x25e>
printf("%s: concreate not enough files in directory listing\n", s);
465a: 85ce mv a1,s3
465c: 00003517 auipc a0,0x3
4660: 2dc50513 addi a0,a0,732 # 7938 <l_free+0x1ed2>
4664: 00001097 auipc ra,0x1
4668: 1e0080e7 jalr 480(ra) # 5844 <printf>
exit(1);
466c: 4505 li a0,1
466e: 00001097 auipc ra,0x1
4672: e5e080e7 jalr -418(ra) # 54cc <exit>
printf("%s: fork failed\n", s);
4676: 85ce mv a1,s3
4678: 00002517 auipc a0,0x2
467c: eb850513 addi a0,a0,-328 # 6530 <l_free+0xaca>
4680: 00001097 auipc ra,0x1
4684: 1c4080e7 jalr 452(ra) # 5844 <printf>
exit(1);
4688: 4505 li a0,1
468a: 00001097 auipc ra,0x1
468e: e42080e7 jalr -446(ra) # 54cc <exit>
close(open(file, 0));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4692: 4581 li a1,0
4694: fa840513 addi a0,s0,-88
4698: 00001097 auipc ra,0x1
469c: e74080e7 jalr -396(ra) # 550c <open>
46a0: 00001097 auipc ra,0x1
46a4: e54080e7 jalr -428(ra) # 54f4 <close>
<<<<<<< HEAD
=======
close(open(file, 0));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
46a8: 4581 li a1,0
46aa: fa840513 addi a0,s0,-88
46ae: 00001097 auipc ra,0x1
46b2: e5e080e7 jalr -418(ra) # 550c <open>
46b6: 00001097 auipc ra,0x1
46ba: e3e080e7 jalr -450(ra) # 54f4 <close>
<<<<<<< HEAD
=======
close(open(file, 0));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
46be: 4581 li a1,0
46c0: fa840513 addi a0,s0,-88
46c4: 00001097 auipc ra,0x1
46c8: e48080e7 jalr -440(ra) # 550c <open>
46cc: 00001097 auipc ra,0x1
46d0: e28080e7 jalr -472(ra) # 54f4 <close>
<<<<<<< HEAD
=======
close(open(file, 0));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
46d4: 4581 li a1,0
46d6: fa840513 addi a0,s0,-88
46da: 00001097 auipc ra,0x1
46de: e32080e7 jalr -462(ra) # 550c <open>
46e2: 00001097 auipc ra,0x1
46e6: e12080e7 jalr -494(ra) # 54f4 <close>
<<<<<<< HEAD
=======
close(open(file, 0));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
46ea: 4581 li a1,0
46ec: fa840513 addi a0,s0,-88
46f0: 00001097 auipc ra,0x1
46f4: e1c080e7 jalr -484(ra) # 550c <open>
46f8: 00001097 auipc ra,0x1
46fc: dfc080e7 jalr -516(ra) # 54f4 <close>
<<<<<<< HEAD
=======
close(open(file, 0));
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4700: 4581 li a1,0
4702: fa840513 addi a0,s0,-88
4706: 00001097 auipc ra,0x1
470a: e06080e7 jalr -506(ra) # 550c <open>
470e: 00001097 auipc ra,0x1
4712: de6080e7 jalr -538(ra) # 54f4 <close>
<<<<<<< HEAD
4716: 08090363 beqz s2,479c <concreate+0x2d0>
471a: 4501 li a0,0
471c: 00001097 auipc ra,0x1
4720: db8080e7 jalr -584(ra) # 54d4 <wait>
4724: 2485 addiw s1,s1,1
4726: 0f448563 beq s1,s4,4810 <concreate+0x344>
472a: 0304879b addiw a5,s1,48
472e: faf404a3 sb a5,-87(s0)
4732: 00001097 auipc ra,0x1
4736: d92080e7 jalr -622(ra) # 54c4 <fork>
473a: 892a mv s2,a0
473c: f2054de3 bltz a0,4676 <concreate+0x1aa>
=======
if (pid == 0)
4716: 08090363 beqz s2,479c <concreate+0x2d0>
wait(0);
471a: 4501 li a0,0
471c: 00001097 auipc ra,0x1
4720: db8080e7 jalr -584(ra) # 54d4 <wait>
for (i = 0; i < N; i++) {
4724: 2485 addiw s1,s1,1
4726: 0f448563 beq s1,s4,4810 <concreate+0x344>
file[1] = '0' + i;
472a: 0304879b addiw a5,s1,48
472e: faf404a3 sb a5,-87(s0)
pid = fork();
4732: 00001097 auipc ra,0x1
4736: d92080e7 jalr -622(ra) # 54c4 <fork>
473a: 892a mv s2,a0
if (pid < 0) {
473c: f2054de3 bltz a0,4676 <concreate+0x1aa>
if (((i % 3) == 0 && pid == 0) || ((i % 3) == 1 && pid != 0)) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4740: 0354e73b remw a4,s1,s5
4744: 00a767b3 or a5,a4,a0
4748: 2781 sext.w a5,a5
474a: d7a1 beqz a5,4692 <concreate+0x1c6>
474c: 01671363 bne a4,s6,4752 <concreate+0x286>
4750: f129 bnez a0,4692 <concreate+0x1c6>
<<<<<<< HEAD
4752: fa840513 addi a0,s0,-88
4756: 00001097 auipc ra,0x1
475a: dc6080e7 jalr -570(ra) # 551c <unlink>
475e: fa840513 addi a0,s0,-88
4762: 00001097 auipc ra,0x1
4766: dba080e7 jalr -582(ra) # 551c <unlink>
476a: fa840513 addi a0,s0,-88
476e: 00001097 auipc ra,0x1
4772: dae080e7 jalr -594(ra) # 551c <unlink>
4776: fa840513 addi a0,s0,-88
477a: 00001097 auipc ra,0x1
477e: da2080e7 jalr -606(ra) # 551c <unlink>
4782: fa840513 addi a0,s0,-88
4786: 00001097 auipc ra,0x1
478a: d96080e7 jalr -618(ra) # 551c <unlink>
=======
unlink(file);
4752: fa840513 addi a0,s0,-88
4756: 00001097 auipc ra,0x1
475a: dc6080e7 jalr -570(ra) # 551c <unlink>
unlink(file);
475e: fa840513 addi a0,s0,-88
4762: 00001097 auipc ra,0x1
4766: dba080e7 jalr -582(ra) # 551c <unlink>
unlink(file);
476a: fa840513 addi a0,s0,-88
476e: 00001097 auipc ra,0x1
4772: dae080e7 jalr -594(ra) # 551c <unlink>
unlink(file);
4776: fa840513 addi a0,s0,-88
477a: 00001097 auipc ra,0x1
477e: da2080e7 jalr -606(ra) # 551c <unlink>
unlink(file);
4782: fa840513 addi a0,s0,-88
4786: 00001097 auipc ra,0x1
478a: d96080e7 jalr -618(ra) # 551c <unlink>
unlink(file);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
478e: fa840513 addi a0,s0,-88
4792: 00001097 auipc ra,0x1
4796: d8a080e7 jalr -630(ra) # 551c <unlink>
479a: bfb5 j 4716 <concreate+0x24a>
<<<<<<< HEAD
479c: 4501 li a0,0
479e: 00001097 auipc ra,0x1
47a2: d2e080e7 jalr -722(ra) # 54cc <exit>
47a6: 00001097 auipc ra,0x1
47aa: d4e080e7 jalr -690(ra) # 54f4 <close>
47ae: bb65 j 4566 <concreate+0x9a>
47b0: 00001097 auipc ra,0x1
47b4: d44080e7 jalr -700(ra) # 54f4 <close>
47b8: f6c40513 addi a0,s0,-148
47bc: 00001097 auipc ra,0x1
47c0: d18080e7 jalr -744(ra) # 54d4 <wait>
47c4: f6c42483 lw s1,-148(s0)
47c8: da0494e3 bnez s1,4570 <concreate+0xa4>
47cc: 2905 addiw s2,s2,1
47ce: db4906e3 beq s2,s4,457a <concreate+0xae>
47d2: 0309079b addiw a5,s2,48
47d6: faf404a3 sb a5,-87(s0)
47da: fa840513 addi a0,s0,-88
47de: 00001097 auipc ra,0x1
47e2: d3e080e7 jalr -706(ra) # 551c <unlink>
47e6: 00001097 auipc ra,0x1
47ea: cde080e7 jalr -802(ra) # 54c4 <fork>
47ee: d20503e3 beqz a0,4514 <concreate+0x48>
47f2: 036967bb remw a5,s2,s6
47f6: d15787e3 beq a5,s5,4504 <concreate+0x38>
=======
exit(0);
479c: 4501 li a0,0
479e: 00001097 auipc ra,0x1
47a2: d2e080e7 jalr -722(ra) # 54cc <exit>
close(fd);
47a6: 00001097 auipc ra,0x1
47aa: d4e080e7 jalr -690(ra) # 54f4 <close>
if (pid == 0) {
47ae: bb65 j 4566 <concreate+0x9a>
close(fd);
47b0: 00001097 auipc ra,0x1
47b4: d44080e7 jalr -700(ra) # 54f4 <close>
wait(&xstatus);
47b8: f6c40513 addi a0,s0,-148
47bc: 00001097 auipc ra,0x1
47c0: d18080e7 jalr -744(ra) # 54d4 <wait>
if (xstatus != 0)
47c4: f6c42483 lw s1,-148(s0)
47c8: da0494e3 bnez s1,4570 <concreate+0xa4>
for (i = 0; i < N; i++) {
47cc: 2905 addiw s2,s2,1
47ce: db4906e3 beq s2,s4,457a <concreate+0xae>
file[1] = '0' + i;
47d2: 0309079b addiw a5,s2,48
47d6: faf404a3 sb a5,-87(s0)
unlink(file);
47da: fa840513 addi a0,s0,-88
47de: 00001097 auipc ra,0x1
47e2: d3e080e7 jalr -706(ra) # 551c <unlink>
pid = fork();
47e6: 00001097 auipc ra,0x1
47ea: cde080e7 jalr -802(ra) # 54c4 <fork>
if (pid && (i % 3) == 1) {
47ee: d20503e3 beqz a0,4514 <concreate+0x48>
47f2: 036967bb remw a5,s2,s6
47f6: d15787e3 beq a5,s5,4504 <concreate+0x38>
fd = open(file, O_CREATE | O_RDWR);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
47fa: 20200593 li a1,514
47fe: fa840513 addi a0,s0,-88
4802: 00001097 auipc ra,0x1
4806: d0a080e7 jalr -758(ra) # 550c <open>
<<<<<<< HEAD
480a: fa0553e3 bgez a0,47b0 <concreate+0x2e4>
480e: b31d j 4534 <concreate+0x68>
=======
if (fd < 0) {
480a: fa0553e3 bgez a0,47b0 <concreate+0x2e4>
480e: b31d j 4534 <concreate+0x68>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4810: 60ea ld ra,152(sp)
4812: 644a ld s0,144(sp)
4814: 64aa ld s1,136(sp)
4816: 690a ld s2,128(sp)
4818: 79e6 ld s3,120(sp)
481a: 7a46 ld s4,112(sp)
481c: 7aa6 ld s5,104(sp)
481e: 7b06 ld s6,96(sp)
4820: 6be6 ld s7,88(sp)
4822: 610d addi sp,sp,160
4824: 8082 ret
0000000000004826 <bigfile>:
<<<<<<< HEAD
=======
void bigfile(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4826: 7139 addi sp,sp,-64
4828: fc06 sd ra,56(sp)
482a: f822 sd s0,48(sp)
482c: f426 sd s1,40(sp)
482e: f04a sd s2,32(sp)
4830: ec4e sd s3,24(sp)
4832: e852 sd s4,16(sp)
4834: e456 sd s5,8(sp)
4836: 0080 addi s0,sp,64
4838: 8aaa mv s5,a0
<<<<<<< HEAD
483a: 00003517 auipc a0,0x3
483e: 13650513 addi a0,a0,310 # 7970 <l_free+0x1f08>
4842: 00001097 auipc ra,0x1
4846: cda080e7 jalr -806(ra) # 551c <unlink>
484a: 20200593 li a1,514
484e: 00003517 auipc a0,0x3
4852: 12250513 addi a0,a0,290 # 7970 <l_free+0x1f08>
4856: 00001097 auipc ra,0x1
485a: cb6080e7 jalr -842(ra) # 550c <open>
485e: 89aa mv s3,a0
4860: 4481 li s1,0
4862: 00007917 auipc s2,0x7
4866: 1ae90913 addi s2,s2,430 # ba10 <buf>
486a: 4a51 li s4,20
486c: 0a054063 bltz a0,490c <bigfile+0xe6>
=======
unlink("bigfile.dat");
483a: 00003517 auipc a0,0x3
483e: 13650513 addi a0,a0,310 # 7970 <l_free+0x1f0a>
4842: 00001097 auipc ra,0x1
4846: cda080e7 jalr -806(ra) # 551c <unlink>
fd = open("bigfile.dat", O_CREATE | O_RDWR);
484a: 20200593 li a1,514
484e: 00003517 auipc a0,0x3
4852: 12250513 addi a0,a0,290 # 7970 <l_free+0x1f0a>
4856: 00001097 auipc ra,0x1
485a: cb6080e7 jalr -842(ra) # 550c <open>
485e: 89aa mv s3,a0
for (i = 0; i < N; i++) {
4860: 4481 li s1,0
memset(buf, i, SZ);
4862: 00007917 auipc s2,0x7
4866: 15690913 addi s2,s2,342 # b9b8 <buf>
for (i = 0; i < N; i++) {
486a: 4a51 li s4,20
if (fd < 0) {
486c: 0a054063 bltz a0,490c <bigfile+0xe6>
memset(buf, i, SZ);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4870: 25800613 li a2,600
4874: 85a6 mv a1,s1
4876: 854a mv a0,s2
4878: 00001097 auipc ra,0x1
487c: a58080e7 jalr -1448(ra) # 52d0 <memset>
<<<<<<< HEAD
=======
if (write(fd, buf, SZ) != SZ) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4880: 25800613 li a2,600
4884: 85ca mv a1,s2
4886: 854e mv a0,s3
4888: 00001097 auipc ra,0x1
488c: c64080e7 jalr -924(ra) # 54ec <write>
4890: 25800793 li a5,600
4894: 08f51a63 bne a0,a5,4928 <bigfile+0x102>
<<<<<<< HEAD
4898: 2485 addiw s1,s1,1
489a: fd449be3 bne s1,s4,4870 <bigfile+0x4a>
489e: 854e mv a0,s3
48a0: 00001097 auipc ra,0x1
48a4: c54080e7 jalr -940(ra) # 54f4 <close>
48a8: 4581 li a1,0
48aa: 00003517 auipc a0,0x3
48ae: 0c650513 addi a0,a0,198 # 7970 <l_free+0x1f08>
48b2: 00001097 auipc ra,0x1
48b6: c5a080e7 jalr -934(ra) # 550c <open>
48ba: 8a2a mv s4,a0
48bc: 4981 li s3,0
48be: 4481 li s1,0
48c0: 00007917 auipc s2,0x7
48c4: 15090913 addi s2,s2,336 # ba10 <buf>
48c8: 06054e63 bltz a0,4944 <bigfile+0x11e>
=======
for (i = 0; i < N; i++) {
4898: 2485 addiw s1,s1,1
489a: fd449be3 bne s1,s4,4870 <bigfile+0x4a>
close(fd);
489e: 854e mv a0,s3
48a0: 00001097 auipc ra,0x1
48a4: c54080e7 jalr -940(ra) # 54f4 <close>
fd = open("bigfile.dat", 0);
48a8: 4581 li a1,0
48aa: 00003517 auipc a0,0x3
48ae: 0c650513 addi a0,a0,198 # 7970 <l_free+0x1f0a>
48b2: 00001097 auipc ra,0x1
48b6: c5a080e7 jalr -934(ra) # 550c <open>
48ba: 8a2a mv s4,a0
total = 0;
48bc: 4981 li s3,0
for (i = 0;; i++) {
48be: 4481 li s1,0
cc = read(fd, buf, SZ / 2);
48c0: 00007917 auipc s2,0x7
48c4: 0f890913 addi s2,s2,248 # b9b8 <buf>
if (fd < 0) {
48c8: 06054e63 bltz a0,4944 <bigfile+0x11e>
cc = read(fd, buf, SZ / 2);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
48cc: 12c00613 li a2,300
48d0: 85ca mv a1,s2
48d2: 8552 mv a0,s4
48d4: 00001097 auipc ra,0x1
48d8: c10080e7 jalr -1008(ra) # 54e4 <read>
<<<<<<< HEAD
48dc: 08054263 bltz a0,4960 <bigfile+0x13a>
48e0: c971 beqz a0,49b4 <bigfile+0x18e>
48e2: 12c00793 li a5,300
48e6: 08f51b63 bne a0,a5,497c <bigfile+0x156>
=======
if (cc < 0) {
48dc: 08054263 bltz a0,4960 <bigfile+0x13a>
if (cc == 0)
48e0: c971 beqz a0,49b4 <bigfile+0x18e>
if (cc != SZ / 2) {
48e2: 12c00793 li a5,300
48e6: 08f51b63 bne a0,a5,497c <bigfile+0x156>
if (buf[0] != i / 2 || buf[SZ / 2 - 1] != i / 2) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
48ea: 01f4d79b srliw a5,s1,0x1f
48ee: 9fa5 addw a5,a5,s1
48f0: 4017d79b sraiw a5,a5,0x1
48f4: 00094703 lbu a4,0(s2)
48f8: 0af71063 bne a4,a5,4998 <bigfile+0x172>
48fc: 12b94703 lbu a4,299(s2)
4900: 08f71c63 bne a4,a5,4998 <bigfile+0x172>
<<<<<<< HEAD
4904: 12c9899b addiw s3,s3,300
4908: 2485 addiw s1,s1,1
490a: b7c9 j 48cc <bigfile+0xa6>
490c: 85d6 mv a1,s5
490e: 00003517 auipc a0,0x3
4912: 07250513 addi a0,a0,114 # 7980 <l_free+0x1f18>
4916: 00001097 auipc ra,0x1
491a: f30080e7 jalr -208(ra) # 5846 <printf>
491e: 4505 li a0,1
4920: 00001097 auipc ra,0x1
4924: bac080e7 jalr -1108(ra) # 54cc <exit>
4928: 85d6 mv a1,s5
492a: 00003517 auipc a0,0x3
492e: 07650513 addi a0,a0,118 # 79a0 <l_free+0x1f38>
4932: 00001097 auipc ra,0x1
4936: f14080e7 jalr -236(ra) # 5846 <printf>
493a: 4505 li a0,1
493c: 00001097 auipc ra,0x1
4940: b90080e7 jalr -1136(ra) # 54cc <exit>
4944: 85d6 mv a1,s5
4946: 00003517 auipc a0,0x3
494a: 07a50513 addi a0,a0,122 # 79c0 <l_free+0x1f58>
494e: 00001097 auipc ra,0x1
4952: ef8080e7 jalr -264(ra) # 5846 <printf>
4956: 4505 li a0,1
4958: 00001097 auipc ra,0x1
495c: b74080e7 jalr -1164(ra) # 54cc <exit>
4960: 85d6 mv a1,s5
4962: 00003517 auipc a0,0x3
4966: 07e50513 addi a0,a0,126 # 79e0 <l_free+0x1f78>
496a: 00001097 auipc ra,0x1
496e: edc080e7 jalr -292(ra) # 5846 <printf>
4972: 4505 li a0,1
4974: 00001097 auipc ra,0x1
4978: b58080e7 jalr -1192(ra) # 54cc <exit>
497c: 85d6 mv a1,s5
497e: 00003517 auipc a0,0x3
4982: 08250513 addi a0,a0,130 # 7a00 <l_free+0x1f98>
4986: 00001097 auipc ra,0x1
498a: ec0080e7 jalr -320(ra) # 5846 <printf>
498e: 4505 li a0,1
4990: 00001097 auipc ra,0x1
4994: b3c080e7 jalr -1220(ra) # 54cc <exit>
4998: 85d6 mv a1,s5
499a: 00003517 auipc a0,0x3
499e: 07e50513 addi a0,a0,126 # 7a18 <l_free+0x1fb0>
49a2: 00001097 auipc ra,0x1
49a6: ea4080e7 jalr -348(ra) # 5846 <printf>
49aa: 4505 li a0,1
49ac: 00001097 auipc ra,0x1
49b0: b20080e7 jalr -1248(ra) # 54cc <exit>
49b4: 8552 mv a0,s4
49b6: 00001097 auipc ra,0x1
49ba: b3e080e7 jalr -1218(ra) # 54f4 <close>
49be: 678d lui a5,0x3
49c0: ee078793 addi a5,a5,-288 # 2ee0 <subdir+0x2ce>
49c4: 02f99363 bne s3,a5,49ea <bigfile+0x1c4>
49c8: 00003517 auipc a0,0x3
49cc: fa850513 addi a0,a0,-88 # 7970 <l_free+0x1f08>
49d0: 00001097 auipc ra,0x1
49d4: b4c080e7 jalr -1204(ra) # 551c <unlink>
=======
total += cc;
4904: 12c9899b addiw s3,s3,300
for (i = 0;; i++) {
4908: 2485 addiw s1,s1,1
cc = read(fd, buf, SZ / 2);
490a: b7c9 j 48cc <bigfile+0xa6>
printf("%s: cannot create bigfile", s);
490c: 85d6 mv a1,s5
490e: 00003517 auipc a0,0x3
4912: 07250513 addi a0,a0,114 # 7980 <l_free+0x1f1a>
4916: 00001097 auipc ra,0x1
491a: f2e080e7 jalr -210(ra) # 5844 <printf>
exit(1);
491e: 4505 li a0,1
4920: 00001097 auipc ra,0x1
4924: bac080e7 jalr -1108(ra) # 54cc <exit>
printf("%s: write bigfile failed\n", s);
4928: 85d6 mv a1,s5
492a: 00003517 auipc a0,0x3
492e: 07650513 addi a0,a0,118 # 79a0 <l_free+0x1f3a>
4932: 00001097 auipc ra,0x1
4936: f12080e7 jalr -238(ra) # 5844 <printf>
exit(1);
493a: 4505 li a0,1
493c: 00001097 auipc ra,0x1
4940: b90080e7 jalr -1136(ra) # 54cc <exit>
printf("%s: cannot open bigfile\n", s);
4944: 85d6 mv a1,s5
4946: 00003517 auipc a0,0x3
494a: 07a50513 addi a0,a0,122 # 79c0 <l_free+0x1f5a>
494e: 00001097 auipc ra,0x1
4952: ef6080e7 jalr -266(ra) # 5844 <printf>
exit(1);
4956: 4505 li a0,1
4958: 00001097 auipc ra,0x1
495c: b74080e7 jalr -1164(ra) # 54cc <exit>
printf("%s: read bigfile failed\n", s);
4960: 85d6 mv a1,s5
4962: 00003517 auipc a0,0x3
4966: 07e50513 addi a0,a0,126 # 79e0 <l_free+0x1f7a>
496a: 00001097 auipc ra,0x1
496e: eda080e7 jalr -294(ra) # 5844 <printf>
exit(1);
4972: 4505 li a0,1
4974: 00001097 auipc ra,0x1
4978: b58080e7 jalr -1192(ra) # 54cc <exit>
printf("%s: short read bigfile\n", s);
497c: 85d6 mv a1,s5
497e: 00003517 auipc a0,0x3
4982: 08250513 addi a0,a0,130 # 7a00 <l_free+0x1f9a>
4986: 00001097 auipc ra,0x1
498a: ebe080e7 jalr -322(ra) # 5844 <printf>
exit(1);
498e: 4505 li a0,1
4990: 00001097 auipc ra,0x1
4994: b3c080e7 jalr -1220(ra) # 54cc <exit>
printf("%s: read bigfile wrong data\n", s);
4998: 85d6 mv a1,s5
499a: 00003517 auipc a0,0x3
499e: 07e50513 addi a0,a0,126 # 7a18 <l_free+0x1fb2>
49a2: 00001097 auipc ra,0x1
49a6: ea2080e7 jalr -350(ra) # 5844 <printf>
exit(1);
49aa: 4505 li a0,1
49ac: 00001097 auipc ra,0x1
49b0: b20080e7 jalr -1248(ra) # 54cc <exit>
close(fd);
49b4: 8552 mv a0,s4
49b6: 00001097 auipc ra,0x1
49ba: b3e080e7 jalr -1218(ra) # 54f4 <close>
if (total != N * SZ) {
49be: 678d lui a5,0x3
49c0: ee078793 addi a5,a5,-288 # 2ee0 <subdir+0x2ce>
49c4: 02f99363 bne s3,a5,49ea <bigfile+0x1c4>
unlink("bigfile.dat");
49c8: 00003517 auipc a0,0x3
49cc: fa850513 addi a0,a0,-88 # 7970 <l_free+0x1f0a>
49d0: 00001097 auipc ra,0x1
49d4: b4c080e7 jalr -1204(ra) # 551c <unlink>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
49d8: 70e2 ld ra,56(sp)
49da: 7442 ld s0,48(sp)
49dc: 74a2 ld s1,40(sp)
49de: 7902 ld s2,32(sp)
49e0: 69e2 ld s3,24(sp)
49e2: 6a42 ld s4,16(sp)
49e4: 6aa2 ld s5,8(sp)
49e6: 6121 addi sp,sp,64
49e8: 8082 ret
<<<<<<< HEAD
49ea: 85d6 mv a1,s5
49ec: 00003517 auipc a0,0x3
49f0: 04c50513 addi a0,a0,76 # 7a38 <l_free+0x1fd0>
49f4: 00001097 auipc ra,0x1
49f8: e52080e7 jalr -430(ra) # 5846 <printf>
=======
printf("%s: read bigfile wrong total\n", s);
49ea: 85d6 mv a1,s5
49ec: 00003517 auipc a0,0x3
49f0: 04c50513 addi a0,a0,76 # 7a38 <l_free+0x1fd2>
49f4: 00001097 auipc ra,0x1
49f8: e50080e7 jalr -432(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
49fc: 4505 li a0,1
49fe: 00001097 auipc ra,0x1
4a02: ace080e7 jalr -1330(ra) # 54cc <exit>
0000000000004a06 <writebig>:
<<<<<<< HEAD
=======
void writebig(char *s) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4a06: 7139 addi sp,sp,-64
4a08: fc06 sd ra,56(sp)
4a0a: f822 sd s0,48(sp)
4a0c: f426 sd s1,40(sp)
4a0e: f04a sd s2,32(sp)
4a10: ec4e sd s3,24(sp)
4a12: e852 sd s4,16(sp)
4a14: e456 sd s5,8(sp)
4a16: 0080 addi s0,sp,64
4a18: 8aaa mv s5,a0
<<<<<<< HEAD
4a1a: 20200593 li a1,514
4a1e: 00003517 auipc a0,0x3
4a22: 03a50513 addi a0,a0,58 # 7a58 <l_free+0x1ff0>
4a26: 00001097 auipc ra,0x1
4a2a: ae6080e7 jalr -1306(ra) # 550c <open>
4a2e: 89aa mv s3,a0
4a30: 4481 li s1,0
4a32: 00007917 auipc s2,0x7
4a36: fde90913 addi s2,s2,-34 # ba10 <buf>
4a3a: 10c00a13 li s4,268
4a3e: 06054c63 bltz a0,4ab6 <writebig+0xb0>
4a42: 00992023 sw s1,0(s2)
=======
fd = open("big", O_CREATE | O_RDWR);
4a1a: 20200593 li a1,514
4a1e: 00003517 auipc a0,0x3
4a22: 03a50513 addi a0,a0,58 # 7a58 <l_free+0x1ff2>
4a26: 00001097 auipc ra,0x1
4a2a: ae6080e7 jalr -1306(ra) # 550c <open>
4a2e: 89aa mv s3,a0
for (i = 0; i < MAXFILE; i++) {
4a30: 4481 li s1,0
((int *)buf)[0] = i;
4a32: 00007917 auipc s2,0x7
4a36: f8690913 addi s2,s2,-122 # b9b8 <buf>
for (i = 0; i < MAXFILE; i++) {
4a3a: 10c00a13 li s4,268
if (fd < 0) {
4a3e: 06054c63 bltz a0,4ab6 <writebig+0xb0>
((int *)buf)[0] = i;
4a42: 00992023 sw s1,0(s2)
if (write(fd, buf, BSIZE) != BSIZE) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4a46: 40000613 li a2,1024
4a4a: 85ca mv a1,s2
4a4c: 854e mv a0,s3
4a4e: 00001097 auipc ra,0x1
4a52: a9e080e7 jalr -1378(ra) # 54ec <write>
4a56: 40000793 li a5,1024
4a5a: 06f51c63 bne a0,a5,4ad2 <writebig+0xcc>
<<<<<<< HEAD
4a5e: 2485 addiw s1,s1,1
4a60: ff4491e3 bne s1,s4,4a42 <writebig+0x3c>
4a64: 854e mv a0,s3
4a66: 00001097 auipc ra,0x1
4a6a: a8e080e7 jalr -1394(ra) # 54f4 <close>
4a6e: 4581 li a1,0
4a70: 00003517 auipc a0,0x3
4a74: fe850513 addi a0,a0,-24 # 7a58 <l_free+0x1ff0>
4a78: 00001097 auipc ra,0x1
4a7c: a94080e7 jalr -1388(ra) # 550c <open>
4a80: 89aa mv s3,a0
4a82: 4481 li s1,0
4a84: 00007917 auipc s2,0x7
4a88: f8c90913 addi s2,s2,-116 # ba10 <buf>
4a8c: 06054163 bltz a0,4aee <writebig+0xe8>
=======
for (i = 0; i < MAXFILE; i++) {
4a5e: 2485 addiw s1,s1,1
4a60: ff4491e3 bne s1,s4,4a42 <writebig+0x3c>
close(fd);
4a64: 854e mv a0,s3
4a66: 00001097 auipc ra,0x1
4a6a: a8e080e7 jalr -1394(ra) # 54f4 <close>
fd = open("big", O_RDONLY);
4a6e: 4581 li a1,0
4a70: 00003517 auipc a0,0x3
4a74: fe850513 addi a0,a0,-24 # 7a58 <l_free+0x1ff2>
4a78: 00001097 auipc ra,0x1
4a7c: a94080e7 jalr -1388(ra) # 550c <open>
4a80: 89aa mv s3,a0
n = 0;
4a82: 4481 li s1,0
i = read(fd, buf, BSIZE);
4a84: 00007917 auipc s2,0x7
4a88: f3490913 addi s2,s2,-204 # b9b8 <buf>
if (fd < 0) {
4a8c: 06054163 bltz a0,4aee <writebig+0xe8>
i = read(fd, buf, BSIZE);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4a90: 40000613 li a2,1024
4a94: 85ca mv a1,s2
4a96: 854e mv a0,s3
4a98: 00001097 auipc ra,0x1
4a9c: a4c080e7 jalr -1460(ra) # 54e4 <read>
<<<<<<< HEAD
4aa0: c52d beqz a0,4b0a <writebig+0x104>
4aa2: 40000793 li a5,1024
4aa6: 0af51d63 bne a0,a5,4b60 <writebig+0x15a>
4aaa: 00092603 lw a2,0(s2)
4aae: 0c961763 bne a2,s1,4b7c <writebig+0x176>
4ab2: 2485 addiw s1,s1,1
4ab4: bff1 j 4a90 <writebig+0x8a>
4ab6: 85d6 mv a1,s5
4ab8: 00003517 auipc a0,0x3
4abc: fa850513 addi a0,a0,-88 # 7a60 <l_free+0x1ff8>
4ac0: 00001097 auipc ra,0x1
4ac4: d86080e7 jalr -634(ra) # 5846 <printf>
4ac8: 4505 li a0,1
4aca: 00001097 auipc ra,0x1
4ace: a02080e7 jalr -1534(ra) # 54cc <exit>
4ad2: 85a6 mv a1,s1
4ad4: 00003517 auipc a0,0x3
4ad8: fac50513 addi a0,a0,-84 # 7a80 <l_free+0x2018>
4adc: 00001097 auipc ra,0x1
4ae0: d6a080e7 jalr -662(ra) # 5846 <printf>
4ae4: 4505 li a0,1
4ae6: 00001097 auipc ra,0x1
4aea: 9e6080e7 jalr -1562(ra) # 54cc <exit>
4aee: 85d6 mv a1,s5
4af0: 00003517 auipc a0,0x3
4af4: fb850513 addi a0,a0,-72 # 7aa8 <l_free+0x2040>
4af8: 00001097 auipc ra,0x1
4afc: d4e080e7 jalr -690(ra) # 5846 <printf>
4b00: 4505 li a0,1
4b02: 00001097 auipc ra,0x1
4b06: 9ca080e7 jalr -1590(ra) # 54cc <exit>
4b0a: 10b00793 li a5,267
4b0e: 02f48a63 beq s1,a5,4b42 <writebig+0x13c>
4b12: 854e mv a0,s3
4b14: 00001097 auipc ra,0x1
4b18: 9e0080e7 jalr -1568(ra) # 54f4 <close>
4b1c: 00003517 auipc a0,0x3
4b20: f3c50513 addi a0,a0,-196 # 7a58 <l_free+0x1ff0>
4b24: 00001097 auipc ra,0x1
4b28: 9f8080e7 jalr -1544(ra) # 551c <unlink>
4b2c: 06054663 bltz a0,4b98 <writebig+0x192>
=======
if (i == 0) {
4aa0: c52d beqz a0,4b0a <writebig+0x104>
} else if (i != BSIZE) {
4aa2: 40000793 li a5,1024
4aa6: 0af51d63 bne a0,a5,4b60 <writebig+0x15a>
if (((int *)buf)[0] != n) {
4aaa: 00092603 lw a2,0(s2)
4aae: 0c961763 bne a2,s1,4b7c <writebig+0x176>
n++;
4ab2: 2485 addiw s1,s1,1
i = read(fd, buf, BSIZE);
4ab4: bff1 j 4a90 <writebig+0x8a>
printf("%s: error: creat big failed!\n", s);
4ab6: 85d6 mv a1,s5
4ab8: 00003517 auipc a0,0x3
4abc: fa850513 addi a0,a0,-88 # 7a60 <l_free+0x1ffa>
4ac0: 00001097 auipc ra,0x1
4ac4: d84080e7 jalr -636(ra) # 5844 <printf>
exit(1);
4ac8: 4505 li a0,1
4aca: 00001097 auipc ra,0x1
4ace: a02080e7 jalr -1534(ra) # 54cc <exit>
printf("%s: error: write big file failed\n", i);
4ad2: 85a6 mv a1,s1
4ad4: 00003517 auipc a0,0x3
4ad8: fac50513 addi a0,a0,-84 # 7a80 <l_free+0x201a>
4adc: 00001097 auipc ra,0x1
4ae0: d68080e7 jalr -664(ra) # 5844 <printf>
exit(1);
4ae4: 4505 li a0,1
4ae6: 00001097 auipc ra,0x1
4aea: 9e6080e7 jalr -1562(ra) # 54cc <exit>
printf("%s: error: open big failed!\n", s);
4aee: 85d6 mv a1,s5
4af0: 00003517 auipc a0,0x3
4af4: fb850513 addi a0,a0,-72 # 7aa8 <l_free+0x2042>
4af8: 00001097 auipc ra,0x1
4afc: d4c080e7 jalr -692(ra) # 5844 <printf>
exit(1);
4b00: 4505 li a0,1
4b02: 00001097 auipc ra,0x1
4b06: 9ca080e7 jalr -1590(ra) # 54cc <exit>
if (n == MAXFILE - 1) {
4b0a: 10b00793 li a5,267
4b0e: 02f48a63 beq s1,a5,4b42 <writebig+0x13c>
close(fd);
4b12: 854e mv a0,s3
4b14: 00001097 auipc ra,0x1
4b18: 9e0080e7 jalr -1568(ra) # 54f4 <close>
if (unlink("big") < 0) {
4b1c: 00003517 auipc a0,0x3
4b20: f3c50513 addi a0,a0,-196 # 7a58 <l_free+0x1ff2>
4b24: 00001097 auipc ra,0x1
4b28: 9f8080e7 jalr -1544(ra) # 551c <unlink>
4b2c: 06054663 bltz a0,4b98 <writebig+0x192>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4b30: 70e2 ld ra,56(sp)
4b32: 7442 ld s0,48(sp)
4b34: 74a2 ld s1,40(sp)
4b36: 7902 ld s2,32(sp)
4b38: 69e2 ld s3,24(sp)
4b3a: 6a42 ld s4,16(sp)
4b3c: 6aa2 ld s5,8(sp)
4b3e: 6121 addi sp,sp,64
4b40: 8082 ret
<<<<<<< HEAD
4b42: 10b00593 li a1,267
4b46: 00003517 auipc a0,0x3
4b4a: f8250513 addi a0,a0,-126 # 7ac8 <l_free+0x2060>
4b4e: 00001097 auipc ra,0x1
4b52: cf8080e7 jalr -776(ra) # 5846 <printf>
4b56: 4505 li a0,1
4b58: 00001097 auipc ra,0x1
4b5c: 974080e7 jalr -1676(ra) # 54cc <exit>
4b60: 85aa mv a1,a0
4b62: 00003517 auipc a0,0x3
4b66: f8e50513 addi a0,a0,-114 # 7af0 <l_free+0x2088>
4b6a: 00001097 auipc ra,0x1
4b6e: cdc080e7 jalr -804(ra) # 5846 <printf>
4b72: 4505 li a0,1
4b74: 00001097 auipc ra,0x1
4b78: 958080e7 jalr -1704(ra) # 54cc <exit>
4b7c: 85a6 mv a1,s1
4b7e: 00003517 auipc a0,0x3
4b82: f8a50513 addi a0,a0,-118 # 7b08 <l_free+0x20a0>
4b86: 00001097 auipc ra,0x1
4b8a: cc0080e7 jalr -832(ra) # 5846 <printf>
4b8e: 4505 li a0,1
4b90: 00001097 auipc ra,0x1
4b94: 93c080e7 jalr -1732(ra) # 54cc <exit>
4b98: 85d6 mv a1,s5
4b9a: 00003517 auipc a0,0x3
4b9e: f9650513 addi a0,a0,-106 # 7b30 <l_free+0x20c8>
4ba2: 00001097 auipc ra,0x1
4ba6: ca4080e7 jalr -860(ra) # 5846 <printf>
=======
printf("%s: read only %d blocks from big", n);
4b42: 10b00593 li a1,267
4b46: 00003517 auipc a0,0x3
4b4a: f8250513 addi a0,a0,-126 # 7ac8 <l_free+0x2062>
4b4e: 00001097 auipc ra,0x1
4b52: cf6080e7 jalr -778(ra) # 5844 <printf>
exit(1);
4b56: 4505 li a0,1
4b58: 00001097 auipc ra,0x1
4b5c: 974080e7 jalr -1676(ra) # 54cc <exit>
printf("%s: read failed %d\n", i);
4b60: 85aa mv a1,a0
4b62: 00003517 auipc a0,0x3
4b66: f8e50513 addi a0,a0,-114 # 7af0 <l_free+0x208a>
4b6a: 00001097 auipc ra,0x1
4b6e: cda080e7 jalr -806(ra) # 5844 <printf>
exit(1);
4b72: 4505 li a0,1
4b74: 00001097 auipc ra,0x1
4b78: 958080e7 jalr -1704(ra) # 54cc <exit>
printf("%s: read content of block %d is %d\n", n, ((int *)buf)[0]);
4b7c: 85a6 mv a1,s1
4b7e: 00003517 auipc a0,0x3
4b82: f8a50513 addi a0,a0,-118 # 7b08 <l_free+0x20a2>
4b86: 00001097 auipc ra,0x1
4b8a: cbe080e7 jalr -834(ra) # 5844 <printf>
exit(1);
4b8e: 4505 li a0,1
4b90: 00001097 auipc ra,0x1
4b94: 93c080e7 jalr -1732(ra) # 54cc <exit>
printf("%s: unlink big failed\n", s);
4b98: 85d6 mv a1,s5
4b9a: 00003517 auipc a0,0x3
4b9e: f9650513 addi a0,a0,-106 # 7b30 <l_free+0x20ca>
4ba2: 00001097 auipc ra,0x1
4ba6: ca2080e7 jalr -862(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4baa: 4505 li a0,1
4bac: 00001097 auipc ra,0x1
4bb0: 920080e7 jalr -1760(ra) # 54cc <exit>
0000000000004bb4 <dirtest>:
4bb4: 1101 addi sp,sp,-32
4bb6: ec06 sd ra,24(sp)
4bb8: e822 sd s0,16(sp)
4bba: e426 sd s1,8(sp)
4bbc: 1000 addi s0,sp,32
4bbe: 84aa mv s1,a0
4bc0: 00003517 auipc a0,0x3
<<<<<<< HEAD
4bc4: f8850513 addi a0,a0,-120 # 7b48 <l_free+0x20e0>
4bc8: 00001097 auipc ra,0x1
4bcc: c7e080e7 jalr -898(ra) # 5846 <printf>
4bd0: 00003517 auipc a0,0x3
4bd4: f8850513 addi a0,a0,-120 # 7b58 <l_free+0x20f0>
=======
4bc4: f8850513 addi a0,a0,-120 # 7b48 <l_free+0x20e2>
4bc8: 00001097 auipc ra,0x1
4bcc: c7c080e7 jalr -900(ra) # 5844 <printf>
if (mkdir("dir0") < 0) {
4bd0: 00003517 auipc a0,0x3
4bd4: f8850513 addi a0,a0,-120 # 7b58 <l_free+0x20f2>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4bd8: 00001097 auipc ra,0x1
4bdc: 95c080e7 jalr -1700(ra) # 5534 <mkdir>
4be0: 04054d63 bltz a0,4c3a <dirtest+0x86>
4be4: 00003517 auipc a0,0x3
<<<<<<< HEAD
4be8: f7450513 addi a0,a0,-140 # 7b58 <l_free+0x20f0>
=======
4be8: f7450513 addi a0,a0,-140 # 7b58 <l_free+0x20f2>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4bec: 00001097 auipc ra,0x1
4bf0: 950080e7 jalr -1712(ra) # 553c <chdir>
4bf4: 06054163 bltz a0,4c56 <dirtest+0xa2>
4bf8: 00003517 auipc a0,0x3
<<<<<<< HEAD
4bfc: 82850513 addi a0,a0,-2008 # 7420 <l_free+0x19b8>
=======
4bfc: 82850513 addi a0,a0,-2008 # 7420 <l_free+0x19ba>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4c00: 00001097 auipc ra,0x1
4c04: 93c080e7 jalr -1732(ra) # 553c <chdir>
4c08: 06054563 bltz a0,4c72 <dirtest+0xbe>
4c0c: 00003517 auipc a0,0x3
<<<<<<< HEAD
4c10: f4c50513 addi a0,a0,-180 # 7b58 <l_free+0x20f0>
=======
4c10: f4c50513 addi a0,a0,-180 # 7b58 <l_free+0x20f2>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4c14: 00001097 auipc ra,0x1
4c18: 908080e7 jalr -1784(ra) # 551c <unlink>
4c1c: 06054963 bltz a0,4c8e <dirtest+0xda>
4c20: 00003517 auipc a0,0x3
<<<<<<< HEAD
4c24: f8850513 addi a0,a0,-120 # 7ba8 <l_free+0x2140>
4c28: 00001097 auipc ra,0x1
4c2c: c1e080e7 jalr -994(ra) # 5846 <printf>
=======
4c24: f8850513 addi a0,a0,-120 # 7ba8 <l_free+0x2142>
4c28: 00001097 auipc ra,0x1
4c2c: c1c080e7 jalr -996(ra) # 5844 <printf>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4c30: 60e2 ld ra,24(sp)
4c32: 6442 ld s0,16(sp)
4c34: 64a2 ld s1,8(sp)
4c36: 6105 addi sp,sp,32
4c38: 8082 ret
4c3a: 85a6 mv a1,s1
4c3c: 00002517 auipc a0,0x2
<<<<<<< HEAD
4c40: 18450513 addi a0,a0,388 # 6dc0 <l_free+0x1358>
4c44: 00001097 auipc ra,0x1
4c48: c02080e7 jalr -1022(ra) # 5846 <printf>
4c4c: 4505 li a0,1
4c4e: 00001097 auipc ra,0x1
4c52: 87e080e7 jalr -1922(ra) # 54cc <exit>
4c56: 85a6 mv a1,s1
4c58: 00003517 auipc a0,0x3
4c5c: f0850513 addi a0,a0,-248 # 7b60 <l_free+0x20f8>
4c60: 00001097 auipc ra,0x1
4c64: be6080e7 jalr -1050(ra) # 5846 <printf>
4c68: 4505 li a0,1
4c6a: 00001097 auipc ra,0x1
4c6e: 862080e7 jalr -1950(ra) # 54cc <exit>
4c72: 85a6 mv a1,s1
4c74: 00003517 auipc a0,0x3
4c78: f0450513 addi a0,a0,-252 # 7b78 <l_free+0x2110>
4c7c: 00001097 auipc ra,0x1
4c80: bca080e7 jalr -1078(ra) # 5846 <printf>
4c84: 4505 li a0,1
4c86: 00001097 auipc ra,0x1
4c8a: 846080e7 jalr -1978(ra) # 54cc <exit>
4c8e: 85a6 mv a1,s1
4c90: 00003517 auipc a0,0x3
4c94: f0050513 addi a0,a0,-256 # 7b90 <l_free+0x2128>
4c98: 00001097 auipc ra,0x1
4c9c: bae080e7 jalr -1106(ra) # 5846 <printf>
=======
4c40: 18450513 addi a0,a0,388 # 6dc0 <l_free+0x135a>
4c44: 00001097 auipc ra,0x1
4c48: c00080e7 jalr -1024(ra) # 5844 <printf>
exit(1);
4c4c: 4505 li a0,1
4c4e: 00001097 auipc ra,0x1
4c52: 87e080e7 jalr -1922(ra) # 54cc <exit>
printf("%s: chdir dir0 failed\n", s);
4c56: 85a6 mv a1,s1
4c58: 00003517 auipc a0,0x3
4c5c: f0850513 addi a0,a0,-248 # 7b60 <l_free+0x20fa>
4c60: 00001097 auipc ra,0x1
4c64: be4080e7 jalr -1052(ra) # 5844 <printf>
exit(1);
4c68: 4505 li a0,1
4c6a: 00001097 auipc ra,0x1
4c6e: 862080e7 jalr -1950(ra) # 54cc <exit>
printf("%s: chdir .. failed\n", s);
4c72: 85a6 mv a1,s1
4c74: 00003517 auipc a0,0x3
4c78: f0450513 addi a0,a0,-252 # 7b78 <l_free+0x2112>
4c7c: 00001097 auipc ra,0x1
4c80: bc8080e7 jalr -1080(ra) # 5844 <printf>
exit(1);
4c84: 4505 li a0,1
4c86: 00001097 auipc ra,0x1
4c8a: 846080e7 jalr -1978(ra) # 54cc <exit>
printf("%s: unlink dir0 failed\n", s);
4c8e: 85a6 mv a1,s1
4c90: 00003517 auipc a0,0x3
4c94: f0050513 addi a0,a0,-256 # 7b90 <l_free+0x212a>
4c98: 00001097 auipc ra,0x1
4c9c: bac080e7 jalr -1108(ra) # 5844 <printf>
exit(1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4ca0: 4505 li a0,1
4ca2: 00001097 auipc ra,0x1
4ca6: 82a080e7 jalr -2006(ra) # 54cc <exit>
0000000000004caa <fsfull>:
4caa: 7171 addi sp,sp,-176
4cac: f506 sd ra,168(sp)
4cae: f122 sd s0,160(sp)
4cb0: ed26 sd s1,152(sp)
4cb2: e94a sd s2,144(sp)
4cb4: e54e sd s3,136(sp)
4cb6: e152 sd s4,128(sp)
4cb8: fcd6 sd s5,120(sp)
4cba: f8da sd s6,112(sp)
4cbc: f4de sd s7,104(sp)
4cbe: f0e2 sd s8,96(sp)
4cc0: ece6 sd s9,88(sp)
4cc2: e8ea sd s10,80(sp)
4cc4: e4ee sd s11,72(sp)
4cc6: 1900 addi s0,sp,176
4cc8: 00003517 auipc a0,0x3
<<<<<<< HEAD
4ccc: ef850513 addi a0,a0,-264 # 7bc0 <l_free+0x2158>
4cd0: 00001097 auipc ra,0x1
4cd4: b76080e7 jalr -1162(ra) # 5846 <printf>
=======
4ccc: ef850513 addi a0,a0,-264 # 7bc0 <l_free+0x215a>
4cd0: 00001097 auipc ra,0x1
4cd4: b74080e7 jalr -1164(ra) # 5844 <printf>
for (nfiles = 0;; nfiles++) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4cd8: 4481 li s1,0
4cda: 06600d13 li s10,102
4cde: 3e800c13 li s8,1000
4ce2: 06400b93 li s7,100
4ce6: 4b29 li s6,10
4ce8: 00003c97 auipc s9,0x3
<<<<<<< HEAD
4cec: ee8c8c93 addi s9,s9,-280 # 7bd0 <l_free+0x2168>
=======
4cec: ee8c8c93 addi s9,s9,-280 # 7bd0 <l_free+0x216a>
int total = 0;
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4cf0: 4d81 li s11,0
4cf2: 00007a17 auipc s4,0x7
4cf6: d1ea0a13 addi s4,s4,-738 # ba10 <buf>
4cfa: f5a40823 sb s10,-176(s0)
4cfe: 0384c7bb divw a5,s1,s8
4d02: 0307879b addiw a5,a5,48
4d06: f4f408a3 sb a5,-175(s0)
4d0a: 0384e7bb remw a5,s1,s8
4d0e: 0377c7bb divw a5,a5,s7
4d12: 0307879b addiw a5,a5,48
4d16: f4f40923 sb a5,-174(s0)
4d1a: 0374e7bb remw a5,s1,s7
4d1e: 0367c7bb divw a5,a5,s6
4d22: 0307879b addiw a5,a5,48
4d26: f4f409a3 sb a5,-173(s0)
4d2a: 0364e7bb remw a5,s1,s6
4d2e: 0307879b addiw a5,a5,48
4d32: f4f40a23 sb a5,-172(s0)
4d36: f4040aa3 sb zero,-171(s0)
4d3a: f5040593 addi a1,s0,-176
4d3e: 8566 mv a0,s9
4d40: 00001097 auipc ra,0x1
<<<<<<< HEAD
4d44: b06080e7 jalr -1274(ra) # 5846 <printf>
=======
4d44: b04080e7 jalr -1276(ra) # 5844 <printf>
int fd = open(name, O_CREATE | O_RDWR);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4d48: 20200593 li a1,514
4d4c: f5040513 addi a0,s0,-176
4d50: 00000097 auipc ra,0x0
4d54: 7bc080e7 jalr 1980(ra) # 550c <open>
4d58: 892a mv s2,a0
4d5a: 0a055663 bgez a0,4e06 <fsfull+0x15c>
4d5e: f5040593 addi a1,s0,-176
4d62: 00003517 auipc a0,0x3
<<<<<<< HEAD
4d66: e7e50513 addi a0,a0,-386 # 7be0 <l_free+0x2178>
4d6a: 00001097 auipc ra,0x1
4d6e: adc080e7 jalr -1316(ra) # 5846 <printf>
=======
4d66: e7e50513 addi a0,a0,-386 # 7be0 <l_free+0x217a>
4d6a: 00001097 auipc ra,0x1
4d6e: ada080e7 jalr -1318(ra) # 5844 <printf>
while (nfiles >= 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4d72: 0604c363 bltz s1,4dd8 <fsfull+0x12e>
4d76: 06600b13 li s6,102
4d7a: 3e800a13 li s4,1000
4d7e: 06400993 li s3,100
4d82: 4929 li s2,10
4d84: 5afd li s5,-1
4d86: f5640823 sb s6,-176(s0)
4d8a: 0344c7bb divw a5,s1,s4
4d8e: 0307879b addiw a5,a5,48
4d92: f4f408a3 sb a5,-175(s0)
4d96: 0344e7bb remw a5,s1,s4
4d9a: 0337c7bb divw a5,a5,s3
4d9e: 0307879b addiw a5,a5,48
4da2: f4f40923 sb a5,-174(s0)
4da6: 0334e7bb remw a5,s1,s3
4daa: 0327c7bb divw a5,a5,s2
4dae: 0307879b addiw a5,a5,48
4db2: f4f409a3 sb a5,-173(s0)
4db6: 0324e7bb remw a5,s1,s2
4dba: 0307879b addiw a5,a5,48
4dbe: f4f40a23 sb a5,-172(s0)
4dc2: f4040aa3 sb zero,-171(s0)
4dc6: f5040513 addi a0,s0,-176
4dca: 00000097 auipc ra,0x0
4dce: 752080e7 jalr 1874(ra) # 551c <unlink>
<<<<<<< HEAD
=======
nfiles--;
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4dd2: 34fd addiw s1,s1,-1
4dd4: fb5499e3 bne s1,s5,4d86 <fsfull+0xdc>
4dd8: 00003517 auipc a0,0x3
<<<<<<< HEAD
4ddc: e3850513 addi a0,a0,-456 # 7c10 <l_free+0x21a8>
4de0: 00001097 auipc ra,0x1
4de4: a66080e7 jalr -1434(ra) # 5846 <printf>
=======
4ddc: e3850513 addi a0,a0,-456 # 7c10 <l_free+0x21aa>
4de0: 00001097 auipc ra,0x1
4de4: a64080e7 jalr -1436(ra) # 5844 <printf>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4de8: 70aa ld ra,168(sp)
4dea: 740a ld s0,160(sp)
4dec: 64ea ld s1,152(sp)
4dee: 694a ld s2,144(sp)
4df0: 69aa ld s3,136(sp)
4df2: 6a0a ld s4,128(sp)
4df4: 7ae6 ld s5,120(sp)
4df6: 7b46 ld s6,112(sp)
4df8: 7ba6 ld s7,104(sp)
4dfa: 7c06 ld s8,96(sp)
4dfc: 6ce6 ld s9,88(sp)
4dfe: 6d46 ld s10,80(sp)
4e00: 6da6 ld s11,72(sp)
4e02: 614d addi sp,sp,176
4e04: 8082 ret
4e06: 89ee mv s3,s11
4e08: 3ff00a93 li s5,1023
4e0c: 40000613 li a2,1024
4e10: 85d2 mv a1,s4
4e12: 854a mv a0,s2
4e14: 00000097 auipc ra,0x0
4e18: 6d8080e7 jalr 1752(ra) # 54ec <write>
<<<<<<< HEAD
=======
if (cc < BSIZE)
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4e1c: 00aad563 bge s5,a0,4e26 <fsfull+0x17c>
4e20: 00a989bb addw s3,s3,a0
4e24: b7e5 j 4e0c <fsfull+0x162>
4e26: 85ce mv a1,s3
4e28: 00003517 auipc a0,0x3
<<<<<<< HEAD
4e2c: dd050513 addi a0,a0,-560 # 7bf8 <l_free+0x2190>
4e30: 00001097 auipc ra,0x1
4e34: a16080e7 jalr -1514(ra) # 5846 <printf>
4e38: 854a mv a0,s2
4e3a: 00000097 auipc ra,0x0
4e3e: 6ba080e7 jalr 1722(ra) # 54f4 <close>
=======
4e2c: dd050513 addi a0,a0,-560 # 7bf8 <l_free+0x2192>
4e30: 00001097 auipc ra,0x1
4e34: a14080e7 jalr -1516(ra) # 5844 <printf>
close(fd);
4e38: 854a mv a0,s2
4e3a: 00000097 auipc ra,0x0
4e3e: 6ba080e7 jalr 1722(ra) # 54f4 <close>
if (total == 0)
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4e42: f20988e3 beqz s3,4d72 <fsfull+0xc8>
4e46: 2485 addiw s1,s1,1
4e48: bd4d j 4cfa <fsfull+0x50>
0000000000004e4a <rand>:
4e4a: 1141 addi sp,sp,-16
4e4c: e422 sd s0,8(sp)
4e4e: 0800 addi s0,sp,16
4e50: 00003717 auipc a4,0x3
4e54: 38070713 addi a4,a4,896 # 81d0 <randstate>
4e58: 6308 ld a0,0(a4)
4e5a: 001967b7 lui a5,0x196
4e5e: 60d78793 addi a5,a5,1549 # 19660d <__BSS_END__+0x187bed>
4e62: 02f50533 mul a0,a0,a5
4e66: 3c6ef7b7 lui a5,0x3c6ef
4e6a: 35f78793 addi a5,a5,863 # 3c6ef35f <__BSS_END__+0x3c6e093f>
4e6e: 953e add a0,a0,a5
4e70: e308 sd a0,0(a4)
4e72: 2501 sext.w a0,a0
4e74: 6422 ld s0,8(sp)
4e76: 0141 addi sp,sp,16
4e78: 8082 ret
0000000000004e7a <countfree>:
4e7a: 7139 addi sp,sp,-64
4e7c: fc06 sd ra,56(sp)
4e7e: f822 sd s0,48(sp)
4e80: f426 sd s1,40(sp)
4e82: f04a sd s2,32(sp)
4e84: ec4e sd s3,24(sp)
4e86: 0080 addi s0,sp,64
4e88: fc840513 addi a0,s0,-56
4e8c: 00000097 auipc ra,0x0
4e90: 650080e7 jalr 1616(ra) # 54dc <pipe>
4e94: 06054763 bltz a0,4f02 <countfree+0x88>
4e98: 00000097 auipc ra,0x0
4e9c: 62c080e7 jalr 1580(ra) # 54c4 <fork>
<<<<<<< HEAD
=======
if (pid < 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4ea0: 06054e63 bltz a0,4f1c <countfree+0xa2>
4ea4: ed51 bnez a0,4f40 <countfree+0xc6>
4ea6: fc842503 lw a0,-56(s0)
4eaa: 00000097 auipc ra,0x0
4eae: 64a080e7 jalr 1610(ra) # 54f4 <close>
<<<<<<< HEAD
=======
while (1) {
uint64 a = (uint64)sbrk(4096);
if (a == 0xffffffffffffffff) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4eb2: 597d li s2,-1
4eb4: 4485 li s1,1
4eb6: 00001997 auipc s3,0x1
<<<<<<< HEAD
4eba: f7298993 addi s3,s3,-142 # 5e28 <l_free+0x3c0>
4ebe: 6505 lui a0,0x1
4ec0: 00000097 auipc ra,0x0
4ec4: 694080e7 jalr 1684(ra) # 5554 <sbrk>
=======
4eba: f7298993 addi s3,s3,-142 # 5e28 <l_free+0x3c2>
uint64 a = (uint64)sbrk(4096);
4ebe: 6505 lui a0,0x1
4ec0: 00000097 auipc ra,0x0
4ec4: 694080e7 jalr 1684(ra) # 5554 <sbrk>
if (a == 0xffffffffffffffff) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4ec8: 07250763 beq a0,s2,4f36 <countfree+0xbc>
4ecc: 6785 lui a5,0x1
4ece: 953e add a0,a0,a5
4ed0: fe950fa3 sb s1,-1(a0) # fff <bigdir+0x133>
<<<<<<< HEAD
=======
if (write(fds[1], "x", 1) != 1) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4ed4: 8626 mv a2,s1
4ed6: 85ce mv a1,s3
4ed8: fcc42503 lw a0,-52(s0)
4edc: 00000097 auipc ra,0x0
4ee0: 610080e7 jalr 1552(ra) # 54ec <write>
4ee4: fc950de3 beq a0,s1,4ebe <countfree+0x44>
4ee8: 00003517 auipc a0,0x3
<<<<<<< HEAD
4eec: d8050513 addi a0,a0,-640 # 7c68 <l_free+0x2200>
4ef0: 00001097 auipc ra,0x1
4ef4: 956080e7 jalr -1706(ra) # 5846 <printf>
4ef8: 4505 li a0,1
4efa: 00000097 auipc ra,0x0
4efe: 5d2080e7 jalr 1490(ra) # 54cc <exit>
4f02: 00003517 auipc a0,0x3
4f06: d2650513 addi a0,a0,-730 # 7c28 <l_free+0x21c0>
4f0a: 00001097 auipc ra,0x1
4f0e: 93c080e7 jalr -1732(ra) # 5846 <printf>
4f12: 4505 li a0,1
4f14: 00000097 auipc ra,0x0
4f18: 5b8080e7 jalr 1464(ra) # 54cc <exit>
4f1c: 00003517 auipc a0,0x3
4f20: d2c50513 addi a0,a0,-724 # 7c48 <l_free+0x21e0>
4f24: 00001097 auipc ra,0x1
4f28: 922080e7 jalr -1758(ra) # 5846 <printf>
4f2c: 4505 li a0,1
4f2e: 00000097 auipc ra,0x0
4f32: 59e080e7 jalr 1438(ra) # 54cc <exit>
4f36: 4501 li a0,0
4f38: 00000097 auipc ra,0x0
4f3c: 594080e7 jalr 1428(ra) # 54cc <exit>
4f40: fcc42503 lw a0,-52(s0)
4f44: 00000097 auipc ra,0x0
4f48: 5b0080e7 jalr 1456(ra) # 54f4 <close>
=======
4eec: d8050513 addi a0,a0,-640 # 7c68 <l_free+0x2202>
4ef0: 00001097 auipc ra,0x1
4ef4: 954080e7 jalr -1708(ra) # 5844 <printf>
exit(1);
4ef8: 4505 li a0,1
4efa: 00000097 auipc ra,0x0
4efe: 5d2080e7 jalr 1490(ra) # 54cc <exit>
printf("pipe() failed in countfree()\n");
4f02: 00003517 auipc a0,0x3
4f06: d2650513 addi a0,a0,-730 # 7c28 <l_free+0x21c2>
4f0a: 00001097 auipc ra,0x1
4f0e: 93a080e7 jalr -1734(ra) # 5844 <printf>
exit(1);
4f12: 4505 li a0,1
4f14: 00000097 auipc ra,0x0
4f18: 5b8080e7 jalr 1464(ra) # 54cc <exit>
printf("fork failed in countfree()\n");
4f1c: 00003517 auipc a0,0x3
4f20: d2c50513 addi a0,a0,-724 # 7c48 <l_free+0x21e2>
4f24: 00001097 auipc ra,0x1
4f28: 920080e7 jalr -1760(ra) # 5844 <printf>
exit(1);
4f2c: 4505 li a0,1
4f2e: 00000097 auipc ra,0x0
4f32: 59e080e7 jalr 1438(ra) # 54cc <exit>
}
}
exit(0);
4f36: 4501 li a0,0
4f38: 00000097 auipc ra,0x0
4f3c: 594080e7 jalr 1428(ra) # 54cc <exit>
}
close(fds[1]);
4f40: fcc42503 lw a0,-52(s0)
4f44: 00000097 auipc ra,0x0
4f48: 5b0080e7 jalr 1456(ra) # 54f4 <close>
int n = 0;
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4f4c: 4481 li s1,0
4f4e: 4605 li a2,1
4f50: fc740593 addi a1,s0,-57
4f54: fc842503 lw a0,-56(s0)
4f58: 00000097 auipc ra,0x0
4f5c: 58c080e7 jalr 1420(ra) # 54e4 <read>
<<<<<<< HEAD
=======
if (cc < 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4f60: 00054563 bltz a0,4f6a <countfree+0xf0>
4f64: c105 beqz a0,4f84 <countfree+0x10a>
4f66: 2485 addiw s1,s1,1
4f68: b7dd j 4f4e <countfree+0xd4>
4f6a: 00003517 auipc a0,0x3
<<<<<<< HEAD
4f6e: d1e50513 addi a0,a0,-738 # 7c88 <l_free+0x2220>
4f72: 00001097 auipc ra,0x1
4f76: 8d4080e7 jalr -1836(ra) # 5846 <printf>
4f7a: 4505 li a0,1
4f7c: 00000097 auipc ra,0x0
4f80: 550080e7 jalr 1360(ra) # 54cc <exit>
4f84: fc842503 lw a0,-56(s0)
4f88: 00000097 auipc ra,0x0
4f8c: 56c080e7 jalr 1388(ra) # 54f4 <close>
4f90: 4501 li a0,0
4f92: 00000097 auipc ra,0x0
4f96: 542080e7 jalr 1346(ra) # 54d4 <wait>
=======
4f6e: d1e50513 addi a0,a0,-738 # 7c88 <l_free+0x2222>
4f72: 00001097 auipc ra,0x1
4f76: 8d2080e7 jalr -1838(ra) # 5844 <printf>
exit(1);
4f7a: 4505 li a0,1
4f7c: 00000097 auipc ra,0x0
4f80: 550080e7 jalr 1360(ra) # 54cc <exit>
}
close(fds[0]);
4f84: fc842503 lw a0,-56(s0)
4f88: 00000097 auipc ra,0x0
4f8c: 56c080e7 jalr 1388(ra) # 54f4 <close>
wait((int *)0);
4f90: 4501 li a0,0
4f92: 00000097 auipc ra,0x0
4f96: 542080e7 jalr 1346(ra) # 54d4 <wait>
return n;
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4f9a: 8526 mv a0,s1
4f9c: 70e2 ld ra,56(sp)
4f9e: 7442 ld s0,48(sp)
4fa0: 74a2 ld s1,40(sp)
4fa2: 7902 ld s2,32(sp)
4fa4: 69e2 ld s3,24(sp)
4fa6: 6121 addi sp,sp,64
4fa8: 8082 ret
0000000000004faa <run>:
4faa: 7179 addi sp,sp,-48
4fac: f406 sd ra,40(sp)
4fae: f022 sd s0,32(sp)
4fb0: ec26 sd s1,24(sp)
4fb2: e84a sd s2,16(sp)
4fb4: 1800 addi s0,sp,48
4fb6: 84aa mv s1,a0
4fb8: 892e mv s2,a1
4fba: 00003517 auipc a0,0x3
<<<<<<< HEAD
4fbe: cee50513 addi a0,a0,-786 # 7ca8 <l_free+0x2240>
4fc2: 00001097 auipc ra,0x1
4fc6: 884080e7 jalr -1916(ra) # 5846 <printf>
=======
4fbe: cee50513 addi a0,a0,-786 # 7ca8 <l_free+0x2242>
4fc2: 00001097 auipc ra,0x1
4fc6: 882080e7 jalr -1918(ra) # 5844 <printf>
if ((pid = fork()) < 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4fca: 00000097 auipc ra,0x0
4fce: 4fa080e7 jalr 1274(ra) # 54c4 <fork>
4fd2: 02054e63 bltz a0,500e <run+0x64>
4fd6: c929 beqz a0,5028 <run+0x7e>
4fd8: fdc40513 addi a0,s0,-36
4fdc: 00000097 auipc ra,0x0
4fe0: 4f8080e7 jalr 1272(ra) # 54d4 <wait>
<<<<<<< HEAD
=======
if (xstatus != 0)
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4fe4: fdc42783 lw a5,-36(s0)
4fe8: c7b9 beqz a5,5036 <run+0x8c>
4fea: 00003517 auipc a0,0x3
<<<<<<< HEAD
4fee: ce650513 addi a0,a0,-794 # 7cd0 <l_free+0x2268>
4ff2: 00001097 auipc ra,0x1
4ff6: 854080e7 jalr -1964(ra) # 5846 <printf>
=======
4fee: ce650513 addi a0,a0,-794 # 7cd0 <l_free+0x226a>
4ff2: 00001097 auipc ra,0x1
4ff6: 852080e7 jalr -1966(ra) # 5844 <printf>
else
printf("OK\n");
return xstatus == 0;
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
4ffa: fdc42503 lw a0,-36(s0)
4ffe: 00153513 seqz a0,a0
5002: 70a2 ld ra,40(sp)
5004: 7402 ld s0,32(sp)
5006: 64e2 ld s1,24(sp)
5008: 6942 ld s2,16(sp)
500a: 6145 addi sp,sp,48
500c: 8082 ret
500e: 00003517 auipc a0,0x3
<<<<<<< HEAD
5012: caa50513 addi a0,a0,-854 # 7cb8 <l_free+0x2250>
5016: 00001097 auipc ra,0x1
501a: 830080e7 jalr -2000(ra) # 5846 <printf>
501e: 4505 li a0,1
5020: 00000097 auipc ra,0x0
5024: 4ac080e7 jalr 1196(ra) # 54cc <exit>
=======
5012: caa50513 addi a0,a0,-854 # 7cb8 <l_free+0x2252>
5016: 00001097 auipc ra,0x1
501a: 82e080e7 jalr -2002(ra) # 5844 <printf>
exit(1);
501e: 4505 li a0,1
5020: 00000097 auipc ra,0x0
5024: 4ac080e7 jalr 1196(ra) # 54cc <exit>
f(s);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5028: 854a mv a0,s2
502a: 9482 jalr s1
502c: 4501 li a0,0
502e: 00000097 auipc ra,0x0
5032: 49e080e7 jalr 1182(ra) # 54cc <exit>
<<<<<<< HEAD
5036: 00003517 auipc a0,0x3
503a: ca250513 addi a0,a0,-862 # 7cd8 <l_free+0x2270>
503e: 00001097 auipc ra,0x1
5042: 808080e7 jalr -2040(ra) # 5846 <printf>
5046: bf55 j 4ffa <run+0x50>
0000000000005048 <main>:
=======
printf("OK\n");
5036: 00003517 auipc a0,0x3
503a: ca250513 addi a0,a0,-862 # 7cd8 <l_free+0x2272>
503e: 00001097 auipc ra,0x1
5042: 806080e7 jalr -2042(ra) # 5844 <printf>
5046: bf55 j 4ffa <run+0x50>
0000000000005048 <main>:
int main(int argc, char *argv[]) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5048: c3010113 addi sp,sp,-976
504c: 3c113423 sd ra,968(sp)
5050: 3c813023 sd s0,960(sp)
5054: 3a913c23 sd s1,952(sp)
5058: 3b213823 sd s2,944(sp)
505c: 3b313423 sd s3,936(sp)
5060: 3b413023 sd s4,928(sp)
5064: 39513c23 sd s5,920(sp)
5068: 39613823 sd s6,912(sp)
506c: 0f80 addi s0,sp,976
506e: 89aa mv s3,a0
5070: 4789 li a5,2
5072: 08f50263 beq a0,a5,50f6 <main+0xae>
<<<<<<< HEAD
=======
continuous = 1;
} else if (argc == 2 && strcmp(argv[1], "-C") == 0) {
continuous = 2;
} else if (argc == 2 && argv[1][0] != '-') {
justone = argv[1];
} else if (argc > 1) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5076: 4785 li a5,1
5078: 4901 li s2,0
<<<<<<< HEAD
507a: 0aa7cb63 blt a5,a0,5130 <main+0xe8>
507e: 00003797 auipc a5,0x3
5082: d4278793 addi a5,a5,-702 # 7dc0 <l_free+0x2358>
5086: c3040713 addi a4,s0,-976
508a: 00003317 auipc t1,0x3
508e: 0c630313 addi t1,t1,198 # 8150 <l_free+0x26e8>
=======
} else if (argc > 1) {
507a: 0aa7cb63 blt a5,a0,5130 <main+0xe8>
}
struct test {
void (*f)(char *);
char *s;
} tests[] = {
507e: 00003797 auipc a5,0x3
5082: d4278793 addi a5,a5,-702 # 7dc0 <l_free+0x235a>
5086: c3040713 addi a4,s0,-976
508a: 00003317 auipc t1,0x3
508e: 0c630313 addi t1,t1,198 # 8150 <l_free+0x26ea>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5092: 0007b883 ld a7,0(a5)
5096: 0087b803 ld a6,8(a5)
509a: 6b88 ld a0,16(a5)
509c: 6f8c ld a1,24(a5)
509e: 7390 ld a2,32(a5)
50a0: 7794 ld a3,40(a5)
50a2: 01173023 sd a7,0(a4)
50a6: 01073423 sd a6,8(a4)
50aa: eb08 sd a0,16(a4)
50ac: ef0c sd a1,24(a4)
50ae: f310 sd a2,32(a4)
50b0: f714 sd a3,40(a4)
50b2: 03078793 addi a5,a5,48
50b6: 03070713 addi a4,a4,48
50ba: fc679ce3 bne a5,t1,5092 <main+0x4a>
<<<<<<< HEAD
50be: 00003517 auipc a0,0x3
50c2: ca250513 addi a0,a0,-862 # 7d60 <l_free+0x22f8>
50c6: 00000097 auipc ra,0x0
50ca: 780080e7 jalr 1920(ra) # 5846 <printf>
50ce: c3843503 ld a0,-968(s0)
50d2: c3040493 addi s1,s0,-976
50d6: 4981 li s3,0
50d8: 4a05 li s4,1
50da: ed51 bnez a0,5176 <main+0x12e>
50dc: 00003517 auipc a0,0x3
50e0: c6c50513 addi a0,a0,-916 # 7d48 <l_free+0x22e0>
50e4: 00000097 auipc ra,0x0
50e8: 762080e7 jalr 1890(ra) # 5846 <printf>
=======
exit(1);
}
}
}
printf("usertests starting\n");
50be: 00003517 auipc a0,0x3
50c2: ca250513 addi a0,a0,-862 # 7d60 <l_free+0x22fa>
50c6: 00000097 auipc ra,0x0
50ca: 77e080e7 jalr 1918(ra) # 5844 <printf>
int free0 = 100; // countfree();
int free1 = 0;
int fail = 0;
for (struct test *t = tests; t->s != 0; t++) {
50ce: c3843503 ld a0,-968(s0)
50d2: c3040493 addi s1,s0,-976
int fail = 0;
50d6: 4981 li s3,0
if ((justone == 0) || strcmp(t->s, justone) == 0) {
if (!run(t->f, t->s))
fail = 1;
50d8: 4a05 li s4,1
for (struct test *t = tests; t->s != 0; t++) {
50da: ed51 bnez a0,5176 <main+0x12e>
exit(1);
} else if ((free1 = 100) < free0) {
printf("FAILED -- lost some free pages %d (out of %d)\n", free1, free0);
exit(1);
} else {
printf("ALL TESTS PASSED\n");
50dc: 00003517 auipc a0,0x3
50e0: c6c50513 addi a0,a0,-916 # 7d48 <l_free+0x22e2>
50e4: 00000097 auipc ra,0x0
50e8: 760080e7 jalr 1888(ra) # 5844 <printf>
exit(0);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
50ec: 4501 li a0,0
50ee: 00000097 auipc ra,0x0
50f2: 3de080e7 jalr 990(ra) # 54cc <exit>
50f6: 84ae mv s1,a1
<<<<<<< HEAD
50f8: 00003597 auipc a1,0x3
50fc: be858593 addi a1,a1,-1048 # 7ce0 <l_free+0x2278>
=======
if (argc == 2 && strcmp(argv[1], "-c") == 0) {
50f8: 00003597 auipc a1,0x3
50fc: be858593 addi a1,a1,-1048 # 7ce0 <l_free+0x227a>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5100: 6488 ld a0,8(s1)
5102: 00000097 auipc ra,0x0
5106: 178080e7 jalr 376(ra) # 527a <strcmp>
510a: c57d beqz a0,51f8 <main+0x1b0>
<<<<<<< HEAD
510c: 00003597 auipc a1,0x3
5110: c8c58593 addi a1,a1,-884 # 7d98 <l_free+0x2330>
=======
} else if (argc == 2 && strcmp(argv[1], "-C") == 0) {
510c: 00003597 auipc a1,0x3
5110: c8c58593 addi a1,a1,-884 # 7d98 <l_free+0x2332>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5114: 6488 ld a0,8(s1)
5116: 00000097 auipc ra,0x0
511a: 164080e7 jalr 356(ra) # 527a <strcmp>
511e: cd71 beqz a0,51fa <main+0x1b2>
<<<<<<< HEAD
=======
} else if (argc == 2 && argv[1][0] != '-') {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5120: 0084b903 ld s2,8(s1)
5124: 00094703 lbu a4,0(s2)
5128: 02d00793 li a5,45
512c: f4f719e3 bne a4,a5,507e <main+0x36>
<<<<<<< HEAD
5130: 00003517 auipc a0,0x3
5134: bb850513 addi a0,a0,-1096 # 7ce8 <l_free+0x2280>
5138: 00000097 auipc ra,0x0
513c: 70e080e7 jalr 1806(ra) # 5846 <printf>
5140: 4505 li a0,1
5142: 00000097 auipc ra,0x0
5146: 38a080e7 jalr 906(ra) # 54cc <exit>
514a: 4505 li a0,1
514c: 00000097 auipc ra,0x0
5150: 380080e7 jalr 896(ra) # 54cc <exit>
5154: 40a905bb subw a1,s2,a0
5158: 855a mv a0,s6
515a: 00000097 auipc ra,0x0
515e: 6ec080e7 jalr 1772(ra) # 5846 <printf>
5162: 07498763 beq s3,s4,51d0 <main+0x188>
5166: 4505 li a0,1
5168: 00000097 auipc ra,0x0
516c: 364080e7 jalr 868(ra) # 54cc <exit>
5170: 04c1 addi s1,s1,16
5172: 6488 ld a0,8(s1)
5174: c115 beqz a0,5198 <main+0x150>
=======
printf("Usage: usertests [-c] [testname]\n");
5130: 00003517 auipc a0,0x3
5134: bb850513 addi a0,a0,-1096 # 7ce8 <l_free+0x2282>
5138: 00000097 auipc ra,0x0
513c: 70c080e7 jalr 1804(ra) # 5844 <printf>
exit(1);
5140: 4505 li a0,1
5142: 00000097 auipc ra,0x0
5146: 38a080e7 jalr 906(ra) # 54cc <exit>
exit(1);
514a: 4505 li a0,1
514c: 00000097 auipc ra,0x0
5150: 380080e7 jalr 896(ra) # 54cc <exit>
printf("FAILED -- lost %d free pages\n", free0 - free1);
5154: 40a905bb subw a1,s2,a0
5158: 855a mv a0,s6
515a: 00000097 auipc ra,0x0
515e: 6ea080e7 jalr 1770(ra) # 5844 <printf>
if (continuous != 2)
5162: 07498763 beq s3,s4,51d0 <main+0x188>
exit(1);
5166: 4505 li a0,1
5168: 00000097 auipc ra,0x0
516c: 364080e7 jalr 868(ra) # 54cc <exit>
for (struct test *t = tests; t->s != 0; t++) {
5170: 04c1 addi s1,s1,16
5172: 6488 ld a0,8(s1)
5174: c115 beqz a0,5198 <main+0x150>
if ((justone == 0) || strcmp(t->s, justone) == 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5176: 00090863 beqz s2,5186 <main+0x13e>
517a: 85ca mv a1,s2
517c: 00000097 auipc ra,0x0
5180: 0fe080e7 jalr 254(ra) # 527a <strcmp>
5184: f575 bnez a0,5170 <main+0x128>
<<<<<<< HEAD
=======
if (!run(t->f, t->s))
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5186: 648c ld a1,8(s1)
5188: 6088 ld a0,0(s1)
518a: 00000097 auipc ra,0x0
518e: e20080e7 jalr -480(ra) # 4faa <run>
5192: fd79 bnez a0,5170 <main+0x128>
<<<<<<< HEAD
5194: 89d2 mv s3,s4
5196: bfe9 j 5170 <main+0x128>
5198: f40982e3 beqz s3,50dc <main+0x94>
519c: 00003517 auipc a0,0x3
51a0: b9450513 addi a0,a0,-1132 # 7d30 <l_free+0x22c8>
51a4: 00000097 auipc ra,0x0
51a8: 6a2080e7 jalr 1698(ra) # 5846 <printf>
51ac: 4505 li a0,1
51ae: 00000097 auipc ra,0x0
51b2: 31e080e7 jalr 798(ra) # 54cc <exit>
51b6: 8556 mv a0,s5
51b8: 00000097 auipc ra,0x0
51bc: 68e080e7 jalr 1678(ra) # 5846 <printf>
51c0: f94995e3 bne s3,s4,514a <main+0x102>
51c4: 00000097 auipc ra,0x0
51c8: cb6080e7 jalr -842(ra) # 4e7a <countfree>
51cc: f92544e3 blt a0,s2,5154 <main+0x10c>
51d0: 00000097 auipc ra,0x0
51d4: caa080e7 jalr -854(ra) # 4e7a <countfree>
51d8: 892a mv s2,a0
51da: c3843583 ld a1,-968(s0)
51de: d1fd beqz a1,51c4 <main+0x17c>
51e0: c3040493 addi s1,s0,-976
=======
fail = 1;
5194: 89d2 mv s3,s4
5196: bfe9 j 5170 <main+0x128>
if (fail) {
5198: f40982e3 beqz s3,50dc <main+0x94>
printf("SOME TESTS FAILED\n");
519c: 00003517 auipc a0,0x3
51a0: b9450513 addi a0,a0,-1132 # 7d30 <l_free+0x22ca>
51a4: 00000097 auipc ra,0x0
51a8: 6a0080e7 jalr 1696(ra) # 5844 <printf>
exit(1);
51ac: 4505 li a0,1
51ae: 00000097 auipc ra,0x0
51b2: 31e080e7 jalr 798(ra) # 54cc <exit>
printf("SOME TESTS FAILED\n");
51b6: 8556 mv a0,s5
51b8: 00000097 auipc ra,0x0
51bc: 68c080e7 jalr 1676(ra) # 5844 <printf>
if (continuous != 2)
51c0: f94995e3 bne s3,s4,514a <main+0x102>
int free1 = countfree();
51c4: 00000097 auipc ra,0x0
51c8: cb6080e7 jalr -842(ra) # 4e7a <countfree>
if (free1 < free0) {
51cc: f92544e3 blt a0,s2,5154 <main+0x10c>
int free0 = countfree();
51d0: 00000097 auipc ra,0x0
51d4: caa080e7 jalr -854(ra) # 4e7a <countfree>
51d8: 892a mv s2,a0
for (struct test *t = tests; t->s != 0; t++) {
51da: c3843583 ld a1,-968(s0)
51de: d1fd beqz a1,51c4 <main+0x17c>
51e0: c3040493 addi s1,s0,-976
if (!run(t->f, t->s)) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
51e4: 6088 ld a0,0(s1)
51e6: 00000097 auipc ra,0x0
51ea: dc4080e7 jalr -572(ra) # 4faa <run>
51ee: d561 beqz a0,51b6 <main+0x16e>
<<<<<<< HEAD
=======
for (struct test *t = tests; t->s != 0; t++) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
51f0: 04c1 addi s1,s1,16
51f2: 648c ld a1,8(s1)
51f4: f9e5 bnez a1,51e4 <main+0x19c>
51f6: b7f9 j 51c4 <main+0x17c>
<<<<<<< HEAD
51f8: 4985 li s3,1
51fa: 00003797 auipc a5,0x3
51fe: bc678793 addi a5,a5,-1082 # 7dc0 <l_free+0x2358>
5202: c3040713 addi a4,s0,-976
5206: 00003317 auipc t1,0x3
520a: f4a30313 addi t1,t1,-182 # 8150 <l_free+0x26e8>
=======
continuous = 1;
51f8: 4985 li s3,1
} tests[] = {
51fa: 00003797 auipc a5,0x3
51fe: bc678793 addi a5,a5,-1082 # 7dc0 <l_free+0x235a>
5202: c3040713 addi a4,s0,-976
5206: 00003317 auipc t1,0x3
520a: f4a30313 addi t1,t1,-182 # 8150 <l_free+0x26ea>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
520e: 0007b883 ld a7,0(a5)
5212: 0087b803 ld a6,8(a5)
5216: 6b88 ld a0,16(a5)
5218: 6f8c ld a1,24(a5)
521a: 7390 ld a2,32(a5)
521c: 7794 ld a3,40(a5)
521e: 01173023 sd a7,0(a4)
5222: 01073423 sd a6,8(a4)
5226: eb08 sd a0,16(a4)
5228: ef0c sd a1,24(a4)
522a: f310 sd a2,32(a4)
522c: f714 sd a3,40(a4)
522e: 03078793 addi a5,a5,48
5232: 03070713 addi a4,a4,48
5236: fc679ce3 bne a5,t1,520e <main+0x1c6>
<<<<<<< HEAD
523a: 00003517 auipc a0,0x3
523e: b3e50513 addi a0,a0,-1218 # 7d78 <l_free+0x2310>
5242: 00000097 auipc ra,0x0
5246: 604080e7 jalr 1540(ra) # 5846 <printf>
524a: 00003a97 auipc s5,0x3
524e: ae6a8a93 addi s5,s5,-1306 # 7d30 <l_free+0x22c8>
5252: 4a09 li s4,2
5254: 00003b17 auipc s6,0x3
5258: abcb0b13 addi s6,s6,-1348 # 7d10 <l_free+0x22a8>
525c: bf95 j 51d0 <main+0x188>
000000000000525e <strcpy>:
525e: 1141 addi sp,sp,-16
5260: e422 sd s0,8(sp)
5262: 0800 addi s0,sp,16
=======
printf("continuous usertests starting\n");
523a: 00003517 auipc a0,0x3
523e: b3e50513 addi a0,a0,-1218 # 7d78 <l_free+0x2312>
5242: 00000097 auipc ra,0x0
5246: 602080e7 jalr 1538(ra) # 5844 <printf>
printf("SOME TESTS FAILED\n");
524a: 00003a97 auipc s5,0x3
524e: ae6a8a93 addi s5,s5,-1306 # 7d30 <l_free+0x22ca>
if (continuous != 2)
5252: 4a09 li s4,2
printf("FAILED -- lost %d free pages\n", free0 - free1);
5254: 00003b17 auipc s6,0x3
5258: abcb0b13 addi s6,s6,-1348 # 7d10 <l_free+0x22aa>
525c: bf95 j 51d0 <main+0x188>
000000000000525e <strcpy>:
#include "kernel/fcntl.h"
#include "user/user.h"
char*
strcpy(char *s, const char *t)
{
525e: 1141 addi sp,sp,-16
5260: e422 sd s0,8(sp)
5262: 0800 addi s0,sp,16
char *os;
os = s;
while((*s++ = *t++) != 0)
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5264: 87aa mv a5,a0
5266: 0585 addi a1,a1,1
5268: 0785 addi a5,a5,1
526a: fff5c703 lbu a4,-1(a1)
526e: fee78fa3 sb a4,-1(a5)
5272: fb75 bnez a4,5266 <strcpy+0x8>
<<<<<<< HEAD
=======
;
return os;
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5274: 6422 ld s0,8(sp)
5276: 0141 addi sp,sp,16
5278: 8082 ret
000000000000527a <strcmp>:
<<<<<<< HEAD
527a: 1141 addi sp,sp,-16
527c: e422 sd s0,8(sp)
527e: 0800 addi s0,sp,16
=======
int
strcmp(const char *p, const char *q)
{
527a: 1141 addi sp,sp,-16
527c: e422 sd s0,8(sp)
527e: 0800 addi s0,sp,16
while(*p && *p == *q)
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5280: 00054783 lbu a5,0(a0)
5284: cb91 beqz a5,5298 <strcmp+0x1e>
5286: 0005c703 lbu a4,0(a1)
528a: 00f71763 bne a4,a5,5298 <strcmp+0x1e>
<<<<<<< HEAD
528e: 0505 addi a0,a0,1
5290: 0585 addi a1,a1,1
5292: 00054783 lbu a5,0(a0)
5296: fbe5 bnez a5,5286 <strcmp+0xc>
5298: 0005c503 lbu a0,0(a1)
=======
p++, q++;
528e: 0505 addi a0,a0,1
5290: 0585 addi a1,a1,1
while(*p && *p == *q)
5292: 00054783 lbu a5,0(a0)
5296: fbe5 bnez a5,5286 <strcmp+0xc>
return (uchar)*p - (uchar)*q;
5298: 0005c503 lbu a0,0(a1)
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
529c: 40a7853b subw a0,a5,a0
52a0: 6422 ld s0,8(sp)
52a2: 0141 addi sp,sp,16
52a4: 8082 ret
00000000000052a6 <strlen>:
<<<<<<< HEAD
52a6: 1141 addi sp,sp,-16
52a8: e422 sd s0,8(sp)
52aa: 0800 addi s0,sp,16
=======
uint
strlen(const char *s)
{
52a6: 1141 addi sp,sp,-16
52a8: e422 sd s0,8(sp)
52aa: 0800 addi s0,sp,16
int n;
for(n = 0; s[n]; n++)
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
52ac: 00054783 lbu a5,0(a0)
52b0: cf91 beqz a5,52cc <strlen+0x26>
52b2: 0505 addi a0,a0,1
52b4: 87aa mv a5,a0
52b6: 4685 li a3,1
52b8: 9e89 subw a3,a3,a0
52ba: 00f6853b addw a0,a3,a5
52be: 0785 addi a5,a5,1
52c0: fff7c703 lbu a4,-1(a5)
52c4: fb7d bnez a4,52ba <strlen+0x14>
<<<<<<< HEAD
52c6: 6422 ld s0,8(sp)
52c8: 0141 addi sp,sp,16
52ca: 8082 ret
=======
;
return n;
}
52c6: 6422 ld s0,8(sp)
52c8: 0141 addi sp,sp,16
52ca: 8082 ret
for(n = 0; s[n]; n++)
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
52cc: 4501 li a0,0
52ce: bfe5 j 52c6 <strlen+0x20>
00000000000052d0 <memset>:
<<<<<<< HEAD
52d0: 1141 addi sp,sp,-16
52d2: e422 sd s0,8(sp)
52d4: 0800 addi s0,sp,16
=======
void*
memset(void *dst, int c, uint n)
{
52d0: 1141 addi sp,sp,-16
52d2: e422 sd s0,8(sp)
52d4: 0800 addi s0,sp,16
char *cdst = (char *) dst;
int i;
for(i = 0; i < n; i++){
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
52d6: ca19 beqz a2,52ec <memset+0x1c>
52d8: 87aa mv a5,a0
52da: 1602 slli a2,a2,0x20
52dc: 9201 srli a2,a2,0x20
52de: 00a60733 add a4,a2,a0
<<<<<<< HEAD
52e2: 00b78023 sb a1,0(a5)
52e6: 0785 addi a5,a5,1
52e8: fee79de3 bne a5,a4,52e2 <memset+0x12>
52ec: 6422 ld s0,8(sp)
52ee: 0141 addi sp,sp,16
52f0: 8082 ret
00000000000052f2 <strchr>:
52f2: 1141 addi sp,sp,-16
52f4: e422 sd s0,8(sp)
52f6: 0800 addi s0,sp,16
52f8: 00054783 lbu a5,0(a0)
52fc: cb99 beqz a5,5312 <strchr+0x20>
52fe: 00f58763 beq a1,a5,530c <strchr+0x1a>
5302: 0505 addi a0,a0,1
5304: 00054783 lbu a5,0(a0)
5308: fbfd bnez a5,52fe <strchr+0xc>
530a: 4501 li a0,0
530c: 6422 ld s0,8(sp)
530e: 0141 addi sp,sp,16
5310: 8082 ret
5312: 4501 li a0,0
5314: bfe5 j 530c <strchr+0x1a>
0000000000005316 <gets>:
=======
cdst[i] = c;
52e2: 00b78023 sb a1,0(a5)
for(i = 0; i < n; i++){
52e6: 0785 addi a5,a5,1
52e8: fee79de3 bne a5,a4,52e2 <memset+0x12>
}
return dst;
}
52ec: 6422 ld s0,8(sp)
52ee: 0141 addi sp,sp,16
52f0: 8082 ret
00000000000052f2 <strchr>:
char*
strchr(const char *s, char c)
{
52f2: 1141 addi sp,sp,-16
52f4: e422 sd s0,8(sp)
52f6: 0800 addi s0,sp,16
for(; *s; s++)
52f8: 00054783 lbu a5,0(a0)
52fc: cb99 beqz a5,5312 <strchr+0x20>
if(*s == c)
52fe: 00f58763 beq a1,a5,530c <strchr+0x1a>
for(; *s; s++)
5302: 0505 addi a0,a0,1
5304: 00054783 lbu a5,0(a0)
5308: fbfd bnez a5,52fe <strchr+0xc>
return (char*)s;
return 0;
530a: 4501 li a0,0
}
530c: 6422 ld s0,8(sp)
530e: 0141 addi sp,sp,16
5310: 8082 ret
return 0;
5312: 4501 li a0,0
5314: bfe5 j 530c <strchr+0x1a>
0000000000005316 <gets>:
char*
gets(char *buf, int max)
{
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5316: 711d addi sp,sp,-96
5318: ec86 sd ra,88(sp)
531a: e8a2 sd s0,80(sp)
531c: e4a6 sd s1,72(sp)
531e: e0ca sd s2,64(sp)
5320: fc4e sd s3,56(sp)
5322: f852 sd s4,48(sp)
5324: f456 sd s5,40(sp)
5326: f05a sd s6,32(sp)
5328: ec5e sd s7,24(sp)
532a: 1080 addi s0,sp,96
532c: 8baa mv s7,a0
532e: 8a2e mv s4,a1
<<<<<<< HEAD
5330: 892a mv s2,a0
5332: 4481 li s1,0
5334: 4aa9 li s5,10
5336: 4b35 li s6,13
5338: 89a6 mv s3,s1
533a: 2485 addiw s1,s1,1
533c: 0344d863 bge s1,s4,536c <gets+0x56>
=======
int i, cc;
char c;
for(i=0; i+1 < max; ){
5330: 892a mv s2,a0
5332: 4481 li s1,0
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
5334: 4aa9 li s5,10
5336: 4b35 li s6,13
for(i=0; i+1 < max; ){
5338: 89a6 mv s3,s1
533a: 2485 addiw s1,s1,1
533c: 0344d863 bge s1,s4,536c <gets+0x56>
cc = read(0, &c, 1);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5340: 4605 li a2,1
5342: faf40593 addi a1,s0,-81
5346: 4501 li a0,0
5348: 00000097 auipc ra,0x0
534c: 19c080e7 jalr 412(ra) # 54e4 <read>
<<<<<<< HEAD
5350: 00a05e63 blez a0,536c <gets+0x56>
5354: faf44783 lbu a5,-81(s0)
5358: 00f90023 sb a5,0(s2)
535c: 01578763 beq a5,s5,536a <gets+0x54>
5360: 0905 addi s2,s2,1
5362: fd679be3 bne a5,s6,5338 <gets+0x22>
5366: 89a6 mv s3,s1
5368: a011 j 536c <gets+0x56>
536a: 89a6 mv s3,s1
536c: 99de add s3,s3,s7
536e: 00098023 sb zero,0(s3)
=======
if(cc < 1)
5350: 00a05e63 blez a0,536c <gets+0x56>
buf[i++] = c;
5354: faf44783 lbu a5,-81(s0)
5358: 00f90023 sb a5,0(s2)
if(c == '\n' || c == '\r')
535c: 01578763 beq a5,s5,536a <gets+0x54>
5360: 0905 addi s2,s2,1
5362: fd679be3 bne a5,s6,5338 <gets+0x22>
for(i=0; i+1 < max; ){
5366: 89a6 mv s3,s1
5368: a011 j 536c <gets+0x56>
536a: 89a6 mv s3,s1
break;
}
buf[i] = '\0';
536c: 99de add s3,s3,s7
536e: 00098023 sb zero,0(s3)
return buf;
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5372: 855e mv a0,s7
5374: 60e6 ld ra,88(sp)
5376: 6446 ld s0,80(sp)
5378: 64a6 ld s1,72(sp)
537a: 6906 ld s2,64(sp)
537c: 79e2 ld s3,56(sp)
537e: 7a42 ld s4,48(sp)
5380: 7aa2 ld s5,40(sp)
5382: 7b02 ld s6,32(sp)
5384: 6be2 ld s7,24(sp)
5386: 6125 addi sp,sp,96
5388: 8082 ret
000000000000538a <stat>:
<<<<<<< HEAD
=======
int
stat(const char *n, struct stat *st)
{
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
538a: 1101 addi sp,sp,-32
538c: ec06 sd ra,24(sp)
538e: e822 sd s0,16(sp)
5390: e426 sd s1,8(sp)
5392: e04a sd s2,0(sp)
5394: 1000 addi s0,sp,32
5396: 892e mv s2,a1
<<<<<<< HEAD
5398: 4581 li a1,0
539a: 00000097 auipc ra,0x0
539e: 172080e7 jalr 370(ra) # 550c <open>
53a2: 02054563 bltz a0,53cc <stat+0x42>
53a6: 84aa mv s1,a0
=======
int fd;
int r;
fd = open(n, O_RDONLY);
5398: 4581 li a1,0
539a: 00000097 auipc ra,0x0
539e: 172080e7 jalr 370(ra) # 550c <open>
if(fd < 0)
53a2: 02054563 bltz a0,53cc <stat+0x42>
53a6: 84aa mv s1,a0
return -1;
r = fstat(fd, st);
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
53a8: 85ca mv a1,s2
53aa: 00000097 auipc ra,0x0
53ae: 17a080e7 jalr 378(ra) # 5524 <fstat>
53b2: 892a mv s2,a0
<<<<<<< HEAD
53b4: 8526 mv a0,s1
53b6: 00000097 auipc ra,0x0
53ba: 13e080e7 jalr 318(ra) # 54f4 <close>
=======
close(fd);
53b4: 8526 mv a0,s1
53b6: 00000097 auipc ra,0x0
53ba: 13e080e7 jalr 318(ra) # 54f4 <close>
return r;
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
53be: 854a mv a0,s2
53c0: 60e2 ld ra,24(sp)
53c2: 6442 ld s0,16(sp)
53c4: 64a2 ld s1,8(sp)
53c6: 6902 ld s2,0(sp)
53c8: 6105 addi sp,sp,32
53ca: 8082 ret
<<<<<<< HEAD
=======
return -1;
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
53cc: 597d li s2,-1
53ce: bfc5 j 53be <stat+0x34>
00000000000053d0 <atoi>:
<<<<<<< HEAD
53d0: 1141 addi sp,sp,-16
53d2: e422 sd s0,8(sp)
53d4: 0800 addi s0,sp,16
53d6: 00054603 lbu a2,0(a0)
53da: fd06079b addiw a5,a2,-48
53de: 0ff7f793 zext.b a5,a5
53e2: 4725 li a4,9
53e4: 02f76963 bltu a4,a5,5416 <atoi+0x46>
53e8: 86aa mv a3,a0
53ea: 4501 li a0,0
53ec: 45a5 li a1,9
=======
int
atoi(const char *s)
{
53d0: 1141 addi sp,sp,-16
53d2: e422 sd s0,8(sp)
53d4: 0800 addi s0,sp,16
int n;
n = 0;
while('0' <= *s && *s <= '9')
53d6: 00054603 lbu a2,0(a0)
53da: fd06079b addiw a5,a2,-48
53de: 0ff7f793 andi a5,a5,255
53e2: 4725 li a4,9
53e4: 02f76963 bltu a4,a5,5416 <atoi+0x46>
53e8: 86aa mv a3,a0
n = 0;
53ea: 4501 li a0,0
while('0' <= *s && *s <= '9')
53ec: 45a5 li a1,9
n = n*10 + *s++ - '0';
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
53ee: 0685 addi a3,a3,1
53f0: 0025179b slliw a5,a0,0x2
53f4: 9fa9 addw a5,a5,a0
53f6: 0017979b slliw a5,a5,0x1
53fa: 9fb1 addw a5,a5,a2
53fc: fd07851b addiw a0,a5,-48
<<<<<<< HEAD
5400: 0006c603 lbu a2,0(a3)
5404: fd06071b addiw a4,a2,-48
5408: 0ff77713 zext.b a4,a4
540c: fee5f1e3 bgeu a1,a4,53ee <atoi+0x1e>
5410: 6422 ld s0,8(sp)
5412: 0141 addi sp,sp,16
5414: 8082 ret
=======
while('0' <= *s && *s <= '9')
5400: 0006c603 lbu a2,0(a3)
5404: fd06071b addiw a4,a2,-48
5408: 0ff77713 andi a4,a4,255
540c: fee5f1e3 bgeu a1,a4,53ee <atoi+0x1e>
return n;
}
5410: 6422 ld s0,8(sp)
5412: 0141 addi sp,sp,16
5414: 8082 ret
n = 0;
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5416: 4501 li a0,0
5418: bfe5 j 5410 <atoi+0x40>
000000000000541a <memmove>:
<<<<<<< HEAD
541a: 1141 addi sp,sp,-16
541c: e422 sd s0,8(sp)
541e: 0800 addi s0,sp,16
5420: 02b57463 bgeu a0,a1,5448 <memmove+0x2e>
=======
void*
memmove(void *vdst, const void *vsrc, int n)
{
541a: 1141 addi sp,sp,-16
541c: e422 sd s0,8(sp)
541e: 0800 addi s0,sp,16
char *dst;
const char *src;
dst = vdst;
src = vsrc;
if (src > dst) {
5420: 02b57463 bgeu a0,a1,5448 <memmove+0x2e>
while(n-- > 0)
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5424: 00c05f63 blez a2,5442 <memmove+0x28>
5428: 1602 slli a2,a2,0x20
542a: 9201 srli a2,a2,0x20
542c: 00c507b3 add a5,a0,a2
<<<<<<< HEAD
5430: 872a mv a4,a0
=======
dst = vdst;
5430: 872a mv a4,a0
*dst++ = *src++;
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5432: 0585 addi a1,a1,1
5434: 0705 addi a4,a4,1
5436: fff5c683 lbu a3,-1(a1)
543a: fed70fa3 sb a3,-1(a4)
<<<<<<< HEAD
543e: fee79ae3 bne a5,a4,5432 <memmove+0x18>
5442: 6422 ld s0,8(sp)
5444: 0141 addi sp,sp,16
5446: 8082 ret
5448: 00c50733 add a4,a0,a2
544c: 95b2 add a1,a1,a2
=======
while(n-- > 0)
543e: fee79ae3 bne a5,a4,5432 <memmove+0x18>
src += n;
while(n-- > 0)
*--dst = *--src;
}
return vdst;
}
5442: 6422 ld s0,8(sp)
5444: 0141 addi sp,sp,16
5446: 8082 ret
dst += n;
5448: 00c50733 add a4,a0,a2
src += n;
544c: 95b2 add a1,a1,a2
while(n-- > 0)
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
544e: fec05ae3 blez a2,5442 <memmove+0x28>
5452: fff6079b addiw a5,a2,-1
5456: 1782 slli a5,a5,0x20
5458: 9381 srli a5,a5,0x20
545a: fff7c793 not a5,a5
545e: 97ba add a5,a5,a4
<<<<<<< HEAD
=======
*--dst = *--src;
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5460: 15fd addi a1,a1,-1
5462: 177d addi a4,a4,-1
5464: 0005c683 lbu a3,0(a1)
5468: 00d70023 sb a3,0(a4)
<<<<<<< HEAD
=======
while(n-- > 0)
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
546c: fee79ae3 bne a5,a4,5460 <memmove+0x46>
5470: bfc9 j 5442 <memmove+0x28>
0000000000005472 <memcmp>:
<<<<<<< HEAD
5472: 1141 addi sp,sp,-16
5474: e422 sd s0,8(sp)
5476: 0800 addi s0,sp,16
=======
int
memcmp(const void *s1, const void *s2, uint n)
{
5472: 1141 addi sp,sp,-16
5474: e422 sd s0,8(sp)
5476: 0800 addi s0,sp,16
const char *p1 = s1, *p2 = s2;
while (n-- > 0) {
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
5478: ca05 beqz a2,54a8 <memcmp+0x36>
547a: fff6069b addiw a3,a2,-1
547e: 1682 slli a3,a3,0x20
5480: 9281 srli a3,a3,0x20
5482: 0685 addi a3,a3,1
5484: 96aa add a3,a3,a0
<<<<<<< HEAD
5486: 00054783 lbu a5,0(a0)
548a: 0005c703 lbu a4,0(a1)
548e: 00e79863 bne a5,a4,549e <memcmp+0x2c>
5492: 0505 addi a0,a0,1
5494: 0585 addi a1,a1,1
5496: fed518e3 bne a0,a3,5486 <memcmp+0x14>
549a: 4501 li a0,0
549c: a019 j 54a2 <memcmp+0x30>
549e: 40e7853b subw a0,a5,a4
54a2: 6422 ld s0,8(sp)
54a4: 0141 addi sp,sp,16
54a6: 8082 ret
=======
if (*p1 != *p2) {
5486: 00054783 lbu a5,0(a0)
548a: 0005c703 lbu a4,0(a1)
548e: 00e79863 bne a5,a4,549e <memcmp+0x2c>
return *p1 - *p2;
}
p1++;
5492: 0505 addi a0,a0,1
p2++;
5494: 0585 addi a1,a1,1
while (n-- > 0) {
5496: fed518e3 bne a0,a3,5486 <memcmp+0x14>
}
return 0;
549a: 4501 li a0,0
549c: a019 j 54a2 <memcmp+0x30>
return *p1 - *p2;
549e: 40e7853b subw a0,a5,a4
}
54a2: 6422 ld s0,8(sp)
54a4: 0141 addi sp,sp,16
54a6: 8082 ret
return 0;
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
54a8: 4501 li a0,0
54aa: bfe5 j 54a2 <memcmp+0x30>
00000000000054ac <memcpy>:
<<<<<<< HEAD
=======
void *
memcpy(void *dst, const void *src, uint n)
{
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
54ac: 1141 addi sp,sp,-16
54ae: e406 sd ra,8(sp)
54b0: e022 sd s0,0(sp)
54b2: 0800 addi s0,sp,16
<<<<<<< HEAD
54b4: 00000097 auipc ra,0x0
54b8: f66080e7 jalr -154(ra) # 541a <memmove>
=======
return memmove(dst, src, n);
54b4: 00000097 auipc ra,0x0
54b8: f66080e7 jalr -154(ra) # 541a <memmove>
}
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
54bc: 60a2 ld ra,8(sp)
54be: 6402 ld s0,0(sp)
54c0: 0141 addi sp,sp,16
54c2: 8082 ret
<<<<<<< HEAD
00000000000054c4 <fork>:
54c4: 4885 li a7,1
54c6: 00000073 ecall
54ca: 8082 ret
00000000000054cc <exit>:
54cc: 4889 li a7,2
54ce: 00000073 ecall
54d2: 8082 ret
00000000000054d4 <wait>:
54d4: 488d li a7,3
54d6: 00000073 ecall
54da: 8082 ret
00000000000054dc <pipe>:
54dc: 4891 li a7,4
54de: 00000073 ecall
54e2: 8082 ret
00000000000054e4 <read>:
54e4: 4895 li a7,5
54e6: 00000073 ecall
54ea: 8082 ret
00000000000054ec <write>:
54ec: 48c1 li a7,16
54ee: 00000073 ecall
54f2: 8082 ret
00000000000054f4 <close>:
54f4: 48d5 li a7,21
54f6: 00000073 ecall
54fa: 8082 ret
00000000000054fc <kill>:
54fc: 4899 li a7,6
54fe: 00000073 ecall
5502: 8082 ret
0000000000005504 <exec>:
5504: 489d li a7,7
5506: 00000073 ecall
550a: 8082 ret
000000000000550c <open>:
550c: 48bd li a7,15
550e: 00000073 ecall
5512: 8082 ret
0000000000005514 <mknod>:
5514: 48c5 li a7,17
5516: 00000073 ecall
551a: 8082 ret
000000000000551c <unlink>:
551c: 48c9 li a7,18
551e: 00000073 ecall
5522: 8082 ret
0000000000005524 <fstat>:
5524: 48a1 li a7,8
5526: 00000073 ecall
552a: 8082 ret
000000000000552c <link>:
552c: 48cd li a7,19
552e: 00000073 ecall
5532: 8082 ret
0000000000005534 <mkdir>:
5534: 48d1 li a7,20
5536: 00000073 ecall
553a: 8082 ret
000000000000553c <chdir>:
553c: 48a5 li a7,9
553e: 00000073 ecall
5542: 8082 ret
0000000000005544 <dup>:
5544: 48a9 li a7,10
5546: 00000073 ecall
554a: 8082 ret
000000000000554c <getpid>:
554c: 48ad li a7,11
554e: 00000073 ecall
5552: 8082 ret
0000000000005554 <sbrk>:
5554: 48b1 li a7,12
5556: 00000073 ecall
555a: 8082 ret
000000000000555c <sleep>:
555c: 48b5 li a7,13
555e: 00000073 ecall
5562: 8082 ret
0000000000005564 <uptime>:
5564: 48b9 li a7,14
5566: 00000073 ecall
556a: 8082 ret
=======
00000000000054c4 <fork>:
# generated by usys.pl - do not edit
#include "kernel/syscall.h"
.global fork
fork:
li a7, SYS_fork
54c4: 4885 li a7,1
ecall
54c6: 00000073 ecall
ret
54ca: 8082 ret
00000000000054cc <exit>:
.global exit
exit:
li a7, SYS_exit
54cc: 4889 li a7,2
ecall
54ce: 00000073 ecall
ret
54d2: 8082 ret
00000000000054d4 <wait>:
.global wait
wait:
li a7, SYS_wait
54d4: 488d li a7,3
ecall
54d6: 00000073 ecall
ret
54da: 8082 ret
00000000000054dc <pipe>:
.global pipe
pipe:
li a7, SYS_pipe
54dc: 4891 li a7,4
ecall
54de: 00000073 ecall
ret
54e2: 8082 ret
00000000000054e4 <read>:
.global read
read:
li a7, SYS_read
54e4: 4895 li a7,5
ecall
54e6: 00000073 ecall
ret
54ea: 8082 ret
00000000000054ec <write>:
.global write
write:
li a7, SYS_write
54ec: 48c1 li a7,16
ecall
54ee: 00000073 ecall
ret
54f2: 8082 ret
00000000000054f4 <close>:
.global close
close:
li a7, SYS_close
54f4: 48d5 li a7,21
ecall
54f6: 00000073 ecall
ret
54fa: 8082 ret
00000000000054fc <kill>:
.global kill
kill:
li a7, SYS_kill
54fc: 4899 li a7,6
ecall
54fe: 00000073 ecall
ret
5502: 8082 ret
0000000000005504 <exec>:
.global exec
exec:
li a7, SYS_exec
5504: 489d li a7,7
ecall
5506: 00000073 ecall
ret
550a: 8082 ret
000000000000550c <open>:
.global open
open:
li a7, SYS_open
550c: 48bd li a7,15
ecall
550e: 00000073 ecall
ret
5512: 8082 ret
0000000000005514 <mknod>:
.global mknod
mknod:
li a7, SYS_mknod
5514: 48c5 li a7,17
ecall
5516: 00000073 ecall
ret
551a: 8082 ret
000000000000551c <unlink>:
.global unlink
unlink:
li a7, SYS_unlink
551c: 48c9 li a7,18
ecall
551e: 00000073 ecall
ret
5522: 8082 ret
0000000000005524 <fstat>:
.global fstat
fstat:
li a7, SYS_fstat
5524: 48a1 li a7,8
ecall
5526: 00000073 ecall
ret
552a: 8082 ret
000000000000552c <link>:
.global link
link:
li a7, SYS_link
552c: 48cd li a7,19
ecall
552e: 00000073 ecall
ret
5532: 8082 ret
0000000000005534 <mkdir>:
.global mkdir
mkdir:
li a7, SYS_mkdir
5534: 48d1 li a7,20
ecall
5536: 00000073 ecall
ret
553a: 8082 ret
000000000000553c <chdir>:
.global chdir
chdir:
li a7, SYS_chdir
553c: 48a5 li a7,9
ecall
553e: 00000073 ecall
ret
5542: 8082 ret
0000000000005544 <dup>:
.global dup
dup:
li a7, SYS_dup
5544: 48a9 li a7,10
ecall
5546: 00000073 ecall
ret
554a: 8082 ret
000000000000554c <getpid>:
.global getpid
getpid:
li a7, SYS_getpid
554c: 48ad li a7,11
ecall
554e: 00000073 ecall
ret
5552: 8082 ret
0000000000005554 <sbrk>:
.global sbrk
sbrk:
li a7, SYS_sbrk
5554: 48b1 li a7,12
ecall
5556: 00000073 ecall
ret
555a: 8082 ret
000000000000555c <sleep>:
.global sleep
sleep:
li a7, SYS_sleep
555c: 48b5 li a7,13
ecall
555e: 00000073 ecall
ret
5562: 8082 ret
0000000000005564 <uptime>:
.global uptime
uptime:
li a7, SYS_uptime
5564: 48b9 li a7,14
ecall
5566: 00000073 ecall
ret
556a: 8082 ret
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
000000000000556c <putc>:
static char digits[] = "0123456789ABCDEF";
static void
putc(int fd, char c)
{
556c: 1101 addi sp,sp,-32
556e: ec06 sd ra,24(sp)
5570: e822 sd s0,16(sp)
5572: 1000 addi s0,sp,32
5574: feb407a3 sb a1,-17(s0)
write(fd, &c, 1);
5578: 4605 li a2,1
557a: fef40593 addi a1,s0,-17
557e: 00000097 auipc ra,0x0
5582: f6e080e7 jalr -146(ra) # 54ec <write>
}
5586: 60e2 ld ra,24(sp)
5588: 6442 ld s0,16(sp)
558a: 6105 addi sp,sp,32
558c: 8082 ret
000000000000558e <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
558e: 7139 addi sp,sp,-64
5590: fc06 sd ra,56(sp)
5592: f822 sd s0,48(sp)
5594: f426 sd s1,40(sp)
5596: f04a sd s2,32(sp)
5598: ec4e sd s3,24(sp)
559a: 0080 addi s0,sp,64
559c: 84aa mv s1,a0
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
559e: c299 beqz a3,55a4 <printint+0x16>
<<<<<<< HEAD
55a0: 0805c963 bltz a1,5632 <printint+0xa4>
=======
55a0: 0805c863 bltz a1,5630 <printint+0xa2>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
neg = 1;
x = -xx;
} else {
x = xx;
55a4: 2581 sext.w a1,a1
neg = 0;
55a6: 4881 li a7,0
55a8: fc040693 addi a3,s0,-64
}
i = 0;
55ac: 4701 li a4,0
do{
buf[i++] = digits[x % base];
55ae: 2601 sext.w a2,a2
55b0: 00003517 auipc a0,0x3
<<<<<<< HEAD
55b4: c0050513 addi a0,a0,-1024 # 81b0 <digits>
=======
55b4: ba850513 addi a0,a0,-1112 # 8158 <digits>
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
55b8: 883a mv a6,a4
55ba: 2705 addiw a4,a4,1
55bc: 02c5f7bb remuw a5,a1,a2
55c0: 1782 slli a5,a5,0x20
55c2: 9381 srli a5,a5,0x20
55c4: 97aa add a5,a5,a0
55c6: 0007c783 lbu a5,0(a5)
55ca: 00f68023 sb a5,0(a3)
}while((x /= base) != 0);
55ce: 0005879b sext.w a5,a1
55d2: 02c5d5bb divuw a1,a1,a2
55d6: 0685 addi a3,a3,1
55d8: fec7f0e3 bgeu a5,a2,55b8 <printint+0x2a>
if(neg)
<<<<<<< HEAD
55dc: 00088c63 beqz a7,55f4 <printint+0x66>
buf[i++] = '-';
55e0: fd070793 addi a5,a4,-48
55e4: 00878733 add a4,a5,s0
55e8: 02d00793 li a5,45
55ec: fef70823 sb a5,-16(a4)
55f0: 0028071b addiw a4,a6,2
while(--i >= 0)
55f4: 02e05863 blez a4,5624 <printint+0x96>
55f8: fc040793 addi a5,s0,-64
55fc: 00e78933 add s2,a5,a4
5600: fff78993 addi s3,a5,-1
5604: 99ba add s3,s3,a4
5606: 377d addiw a4,a4,-1
5608: 1702 slli a4,a4,0x20
560a: 9301 srli a4,a4,0x20
560c: 40e989b3 sub s3,s3,a4
putc(fd, buf[i]);
5610: fff94583 lbu a1,-1(s2)
5614: 8526 mv a0,s1
5616: 00000097 auipc ra,0x0
561a: f56080e7 jalr -170(ra) # 556c <putc>
while(--i >= 0)
561e: 197d addi s2,s2,-1
5620: ff3918e3 bne s2,s3,5610 <printint+0x82>
}
5624: 70e2 ld ra,56(sp)
5626: 7442 ld s0,48(sp)
5628: 74a2 ld s1,40(sp)
562a: 7902 ld s2,32(sp)
562c: 69e2 ld s3,24(sp)
562e: 6121 addi sp,sp,64
5630: 8082 ret
x = -xx;
5632: 40b005bb negw a1,a1
neg = 1;
5636: 4885 li a7,1
x = -xx;
5638: bf85 j 55a8 <printint+0x1a>
000000000000563a <vprintf>:
=======
55dc: 00088b63 beqz a7,55f2 <printint+0x64>
buf[i++] = '-';
55e0: fd040793 addi a5,s0,-48
55e4: 973e add a4,a4,a5
55e6: 02d00793 li a5,45
55ea: fef70823 sb a5,-16(a4)
55ee: 0028071b addiw a4,a6,2
while(--i >= 0)
55f2: 02e05863 blez a4,5622 <printint+0x94>
55f6: fc040793 addi a5,s0,-64
55fa: 00e78933 add s2,a5,a4
55fe: fff78993 addi s3,a5,-1
5602: 99ba add s3,s3,a4
5604: 377d addiw a4,a4,-1
5606: 1702 slli a4,a4,0x20
5608: 9301 srli a4,a4,0x20
560a: 40e989b3 sub s3,s3,a4
putc(fd, buf[i]);
560e: fff94583 lbu a1,-1(s2)
5612: 8526 mv a0,s1
5614: 00000097 auipc ra,0x0
5618: f58080e7 jalr -168(ra) # 556c <putc>
while(--i >= 0)
561c: 197d addi s2,s2,-1
561e: ff3918e3 bne s2,s3,560e <printint+0x80>
}
5622: 70e2 ld ra,56(sp)
5624: 7442 ld s0,48(sp)
5626: 74a2 ld s1,40(sp)
5628: 7902 ld s2,32(sp)
562a: 69e2 ld s3,24(sp)
562c: 6121 addi sp,sp,64
562e: 8082 ret
x = -xx;
5630: 40b005bb negw a1,a1
neg = 1;
5634: 4885 li a7,1
x = -xx;
5636: bf8d j 55a8 <printint+0x1a>
0000000000005638 <vprintf>:
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
vprintf(int fd, const char *fmt, va_list ap)
{
<<<<<<< HEAD
563a: 7119 addi sp,sp,-128
563c: fc86 sd ra,120(sp)
563e: f8a2 sd s0,112(sp)
5640: f4a6 sd s1,104(sp)
5642: f0ca sd s2,96(sp)
5644: ecce sd s3,88(sp)
5646: e8d2 sd s4,80(sp)
5648: e4d6 sd s5,72(sp)
564a: e0da sd s6,64(sp)
564c: fc5e sd s7,56(sp)
564e: f862 sd s8,48(sp)
5650: f466 sd s9,40(sp)
5652: f06a sd s10,32(sp)
5654: ec6e sd s11,24(sp)
5656: 0100 addi s0,sp,128
=======
5638: 7119 addi sp,sp,-128
563a: fc86 sd ra,120(sp)
563c: f8a2 sd s0,112(sp)
563e: f4a6 sd s1,104(sp)
5640: f0ca sd s2,96(sp)
5642: ecce sd s3,88(sp)
5644: e8d2 sd s4,80(sp)
5646: e4d6 sd s5,72(sp)
5648: e0da sd s6,64(sp)
564a: fc5e sd s7,56(sp)
564c: f862 sd s8,48(sp)
564e: f466 sd s9,40(sp)
5650: f06a sd s10,32(sp)
5652: ec6e sd s11,24(sp)
5654: 0100 addi s0,sp,128
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
char *s;
int c, i, state;
state = 0;
for(i = 0; fmt[i]; i++){
<<<<<<< HEAD
5658: 0005c903 lbu s2,0(a1)
565c: 18090f63 beqz s2,57fa <vprintf+0x1c0>
5660: 8aaa mv s5,a0
5662: 8b32 mv s6,a2
5664: 00158493 addi s1,a1,1
state = 0;
5668: 4981 li s3,0
=======
5656: 0005c903 lbu s2,0(a1)
565a: 18090f63 beqz s2,57f8 <vprintf+0x1c0>
565e: 8aaa mv s5,a0
5660: 8b32 mv s6,a2
5662: 00158493 addi s1,a1,1
state = 0;
5666: 4981 li s3,0
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
<<<<<<< HEAD
566a: 02500a13 li s4,37
566e: 4c55 li s8,21
5670: 00003c97 auipc s9,0x3
5674: ae8c8c93 addi s9,s9,-1304 # 8158 <l_free+0x26f0>
printptr(fd, va_arg(ap, uint64));
} else if(c == 's'){
s = va_arg(ap, char*);
if(s == 0)
s = "(null)";
while(*s != 0){
5678: 02800d93 li s11,40
putc(fd, 'x');
567c: 4d41 li s10,16
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
567e: 00003b97 auipc s7,0x3
5682: b32b8b93 addi s7,s7,-1230 # 81b0 <digits>
5686: a839 j 56a4 <vprintf+0x6a>
putc(fd, c);
5688: 85ca mv a1,s2
568a: 8556 mv a0,s5
568c: 00000097 auipc ra,0x0
5690: ee0080e7 jalr -288(ra) # 556c <putc>
5694: a019 j 569a <vprintf+0x60>
} else if(state == '%'){
5696: 01498d63 beq s3,s4,56b0 <vprintf+0x76>
for(i = 0; fmt[i]; i++){
569a: 0485 addi s1,s1,1
569c: fff4c903 lbu s2,-1(s1)
56a0: 14090d63 beqz s2,57fa <vprintf+0x1c0>
if(state == 0){
56a4: fe0999e3 bnez s3,5696 <vprintf+0x5c>
if(c == '%'){
56a8: ff4910e3 bne s2,s4,5688 <vprintf+0x4e>
state = '%';
56ac: 89d2 mv s3,s4
56ae: b7f5 j 569a <vprintf+0x60>
if(c == 'd'){
56b0: 11490c63 beq s2,s4,57c8 <vprintf+0x18e>
56b4: f9d9079b addiw a5,s2,-99
56b8: 0ff7f793 zext.b a5,a5
56bc: 10fc6e63 bltu s8,a5,57d8 <vprintf+0x19e>
56c0: f9d9079b addiw a5,s2,-99
56c4: 0ff7f713 zext.b a4,a5
56c8: 10ec6863 bltu s8,a4,57d8 <vprintf+0x19e>
56cc: 00271793 slli a5,a4,0x2
56d0: 97e6 add a5,a5,s9
56d2: 439c lw a5,0(a5)
56d4: 97e6 add a5,a5,s9
56d6: 8782 jr a5
printint(fd, va_arg(ap, int), 10, 1);
56d8: 008b0913 addi s2,s6,8
56dc: 4685 li a3,1
56de: 4629 li a2,10
56e0: 000b2583 lw a1,0(s6)
56e4: 8556 mv a0,s5
56e6: 00000097 auipc ra,0x0
56ea: ea8080e7 jalr -344(ra) # 558e <printint>
56ee: 8b4a mv s6,s2
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
56f0: 4981 li s3,0
56f2: b765 j 569a <vprintf+0x60>
printint(fd, va_arg(ap, uint64), 10, 0);
56f4: 008b0913 addi s2,s6,8
56f8: 4681 li a3,0
56fa: 4629 li a2,10
56fc: 000b2583 lw a1,0(s6)
5700: 8556 mv a0,s5
5702: 00000097 auipc ra,0x0
5706: e8c080e7 jalr -372(ra) # 558e <printint>
570a: 8b4a mv s6,s2
state = 0;
570c: 4981 li s3,0
570e: b771 j 569a <vprintf+0x60>
printint(fd, va_arg(ap, int), 16, 0);
5710: 008b0913 addi s2,s6,8
5714: 4681 li a3,0
5716: 866a mv a2,s10
5718: 000b2583 lw a1,0(s6)
571c: 8556 mv a0,s5
571e: 00000097 auipc ra,0x0
5722: e70080e7 jalr -400(ra) # 558e <printint>
5726: 8b4a mv s6,s2
state = 0;
5728: 4981 li s3,0
572a: bf85 j 569a <vprintf+0x60>
printptr(fd, va_arg(ap, uint64));
572c: 008b0793 addi a5,s6,8
5730: f8f43423 sd a5,-120(s0)
5734: 000b3983 ld s3,0(s6)
putc(fd, '0');
5738: 03000593 li a1,48
573c: 8556 mv a0,s5
573e: 00000097 auipc ra,0x0
5742: e2e080e7 jalr -466(ra) # 556c <putc>
putc(fd, 'x');
5746: 07800593 li a1,120
574a: 8556 mv a0,s5
574c: 00000097 auipc ra,0x0
5750: e20080e7 jalr -480(ra) # 556c <putc>
5754: 896a mv s2,s10
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
5756: 03c9d793 srli a5,s3,0x3c
575a: 97de add a5,a5,s7
575c: 0007c583 lbu a1,0(a5)
5760: 8556 mv a0,s5
5762: 00000097 auipc ra,0x0
5766: e0a080e7 jalr -502(ra) # 556c <putc>
for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4)
576a: 0992 slli s3,s3,0x4
576c: 397d addiw s2,s2,-1
576e: fe0914e3 bnez s2,5756 <vprintf+0x11c>
printptr(fd, va_arg(ap, uint64));
5772: f8843b03 ld s6,-120(s0)
state = 0;
5776: 4981 li s3,0
5778: b70d j 569a <vprintf+0x60>
s = va_arg(ap, char*);
577a: 008b0913 addi s2,s6,8
577e: 000b3983 ld s3,0(s6)
if(s == 0)
5782: 02098163 beqz s3,57a4 <vprintf+0x16a>
while(*s != 0){
5786: 0009c583 lbu a1,0(s3)
578a: c5ad beqz a1,57f4 <vprintf+0x1ba>
putc(fd, *s);
578c: 8556 mv a0,s5
578e: 00000097 auipc ra,0x0
5792: dde080e7 jalr -546(ra) # 556c <putc>
s++;
5796: 0985 addi s3,s3,1
while(*s != 0){
5798: 0009c583 lbu a1,0(s3)
579c: f9e5 bnez a1,578c <vprintf+0x152>
s = va_arg(ap, char*);
579e: 8b4a mv s6,s2
state = 0;
57a0: 4981 li s3,0
57a2: bde5 j 569a <vprintf+0x60>
s = "(null)";
57a4: 00003997 auipc s3,0x3
57a8: 9ac98993 addi s3,s3,-1620 # 8150 <l_free+0x26e8>
while(*s != 0){
57ac: 85ee mv a1,s11
57ae: bff9 j 578c <vprintf+0x152>
putc(fd, va_arg(ap, uint));
57b0: 008b0913 addi s2,s6,8
57b4: 000b4583 lbu a1,0(s6)
57b8: 8556 mv a0,s5
57ba: 00000097 auipc ra,0x0
57be: db2080e7 jalr -590(ra) # 556c <putc>
57c2: 8b4a mv s6,s2
state = 0;
57c4: 4981 li s3,0
57c6: bdd1 j 569a <vprintf+0x60>
putc(fd, c);
57c8: 85d2 mv a1,s4
57ca: 8556 mv a0,s5
57cc: 00000097 auipc ra,0x0
57d0: da0080e7 jalr -608(ra) # 556c <putc>
state = 0;
57d4: 4981 li s3,0
57d6: b5d1 j 569a <vprintf+0x60>
putc(fd, '%');
57d8: 85d2 mv a1,s4
57da: 8556 mv a0,s5
57dc: 00000097 auipc ra,0x0
57e0: d90080e7 jalr -624(ra) # 556c <putc>
putc(fd, c);
57e4: 85ca mv a1,s2
57e6: 8556 mv a0,s5
57e8: 00000097 auipc ra,0x0
57ec: d84080e7 jalr -636(ra) # 556c <putc>
state = 0;
57f0: 4981 li s3,0
57f2: b565 j 569a <vprintf+0x60>
s = va_arg(ap, char*);
57f4: 8b4a mv s6,s2
state = 0;
57f6: 4981 li s3,0
57f8: b54d j 569a <vprintf+0x60>
}
}
}
57fa: 70e6 ld ra,120(sp)
57fc: 7446 ld s0,112(sp)
57fe: 74a6 ld s1,104(sp)
5800: 7906 ld s2,96(sp)
5802: 69e6 ld s3,88(sp)
5804: 6a46 ld s4,80(sp)
5806: 6aa6 ld s5,72(sp)
5808: 6b06 ld s6,64(sp)
580a: 7be2 ld s7,56(sp)
580c: 7c42 ld s8,48(sp)
580e: 7ca2 ld s9,40(sp)
5810: 7d02 ld s10,32(sp)
5812: 6de2 ld s11,24(sp)
5814: 6109 addi sp,sp,128
5816: 8082 ret
0000000000005818 <fprintf>:
=======
5668: 02500a13 li s4,37
if(c == 'd'){
566c: 06400c13 li s8,100
printint(fd, va_arg(ap, int), 10, 1);
} else if(c == 'l') {
5670: 06c00c93 li s9,108
printint(fd, va_arg(ap, uint64), 10, 0);
} else if(c == 'x') {
5674: 07800d13 li s10,120
printint(fd, va_arg(ap, int), 16, 0);
} else if(c == 'p') {
5678: 07000d93 li s11,112
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
567c: 00003b97 auipc s7,0x3
5680: adcb8b93 addi s7,s7,-1316 # 8158 <digits>
5684: a839 j 56a2 <vprintf+0x6a>
putc(fd, c);
5686: 85ca mv a1,s2
5688: 8556 mv a0,s5
568a: 00000097 auipc ra,0x0
568e: ee2080e7 jalr -286(ra) # 556c <putc>
5692: a019 j 5698 <vprintf+0x60>
} else if(state == '%'){
5694: 01498f63 beq s3,s4,56b2 <vprintf+0x7a>
for(i = 0; fmt[i]; i++){
5698: 0485 addi s1,s1,1
569a: fff4c903 lbu s2,-1(s1)
569e: 14090d63 beqz s2,57f8 <vprintf+0x1c0>
c = fmt[i] & 0xff;
56a2: 0009079b sext.w a5,s2
if(state == 0){
56a6: fe0997e3 bnez s3,5694 <vprintf+0x5c>
if(c == '%'){
56aa: fd479ee3 bne a5,s4,5686 <vprintf+0x4e>
state = '%';
56ae: 89be mv s3,a5
56b0: b7e5 j 5698 <vprintf+0x60>
if(c == 'd'){
56b2: 05878063 beq a5,s8,56f2 <vprintf+0xba>
} else if(c == 'l') {
56b6: 05978c63 beq a5,s9,570e <vprintf+0xd6>
} else if(c == 'x') {
56ba: 07a78863 beq a5,s10,572a <vprintf+0xf2>
} else if(c == 'p') {
56be: 09b78463 beq a5,s11,5746 <vprintf+0x10e>
printptr(fd, va_arg(ap, uint64));
} else if(c == 's'){
56c2: 07300713 li a4,115
56c6: 0ce78663 beq a5,a4,5792 <vprintf+0x15a>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
56ca: 06300713 li a4,99
56ce: 0ee78e63 beq a5,a4,57ca <vprintf+0x192>
putc(fd, va_arg(ap, uint));
} else if(c == '%'){
56d2: 11478863 beq a5,s4,57e2 <vprintf+0x1aa>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
56d6: 85d2 mv a1,s4
56d8: 8556 mv a0,s5
56da: 00000097 auipc ra,0x0
56de: e92080e7 jalr -366(ra) # 556c <putc>
putc(fd, c);
56e2: 85ca mv a1,s2
56e4: 8556 mv a0,s5
56e6: 00000097 auipc ra,0x0
56ea: e86080e7 jalr -378(ra) # 556c <putc>
}
state = 0;
56ee: 4981 li s3,0
56f0: b765 j 5698 <vprintf+0x60>
printint(fd, va_arg(ap, int), 10, 1);
56f2: 008b0913 addi s2,s6,8
56f6: 4685 li a3,1
56f8: 4629 li a2,10
56fa: 000b2583 lw a1,0(s6)
56fe: 8556 mv a0,s5
5700: 00000097 auipc ra,0x0
5704: e8e080e7 jalr -370(ra) # 558e <printint>
5708: 8b4a mv s6,s2
state = 0;
570a: 4981 li s3,0
570c: b771 j 5698 <vprintf+0x60>
printint(fd, va_arg(ap, uint64), 10, 0);
570e: 008b0913 addi s2,s6,8
5712: 4681 li a3,0
5714: 4629 li a2,10
5716: 000b2583 lw a1,0(s6)
571a: 8556 mv a0,s5
571c: 00000097 auipc ra,0x0
5720: e72080e7 jalr -398(ra) # 558e <printint>
5724: 8b4a mv s6,s2
state = 0;
5726: 4981 li s3,0
5728: bf85 j 5698 <vprintf+0x60>
printint(fd, va_arg(ap, int), 16, 0);
572a: 008b0913 addi s2,s6,8
572e: 4681 li a3,0
5730: 4641 li a2,16
5732: 000b2583 lw a1,0(s6)
5736: 8556 mv a0,s5
5738: 00000097 auipc ra,0x0
573c: e56080e7 jalr -426(ra) # 558e <printint>
5740: 8b4a mv s6,s2
state = 0;
5742: 4981 li s3,0
5744: bf91 j 5698 <vprintf+0x60>
printptr(fd, va_arg(ap, uint64));
5746: 008b0793 addi a5,s6,8
574a: f8f43423 sd a5,-120(s0)
574e: 000b3983 ld s3,0(s6)
putc(fd, '0');
5752: 03000593 li a1,48
5756: 8556 mv a0,s5
5758: 00000097 auipc ra,0x0
575c: e14080e7 jalr -492(ra) # 556c <putc>
putc(fd, 'x');
5760: 85ea mv a1,s10
5762: 8556 mv a0,s5
5764: 00000097 auipc ra,0x0
5768: e08080e7 jalr -504(ra) # 556c <putc>
576c: 4941 li s2,16
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
576e: 03c9d793 srli a5,s3,0x3c
5772: 97de add a5,a5,s7
5774: 0007c583 lbu a1,0(a5)
5778: 8556 mv a0,s5
577a: 00000097 auipc ra,0x0
577e: df2080e7 jalr -526(ra) # 556c <putc>
for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4)
5782: 0992 slli s3,s3,0x4
5784: 397d addiw s2,s2,-1
5786: fe0914e3 bnez s2,576e <vprintf+0x136>
printptr(fd, va_arg(ap, uint64));
578a: f8843b03 ld s6,-120(s0)
state = 0;
578e: 4981 li s3,0
5790: b721 j 5698 <vprintf+0x60>
s = va_arg(ap, char*);
5792: 008b0993 addi s3,s6,8
5796: 000b3903 ld s2,0(s6)
if(s == 0)
579a: 02090163 beqz s2,57bc <vprintf+0x184>
while(*s != 0){
579e: 00094583 lbu a1,0(s2)
57a2: c9a1 beqz a1,57f2 <vprintf+0x1ba>
putc(fd, *s);
57a4: 8556 mv a0,s5
57a6: 00000097 auipc ra,0x0
57aa: dc6080e7 jalr -570(ra) # 556c <putc>
s++;
57ae: 0905 addi s2,s2,1
while(*s != 0){
57b0: 00094583 lbu a1,0(s2)
57b4: f9e5 bnez a1,57a4 <vprintf+0x16c>
s = va_arg(ap, char*);
57b6: 8b4e mv s6,s3
state = 0;
57b8: 4981 li s3,0
57ba: bdf9 j 5698 <vprintf+0x60>
s = "(null)";
57bc: 00003917 auipc s2,0x3
57c0: 99490913 addi s2,s2,-1644 # 8150 <l_free+0x26ea>
while(*s != 0){
57c4: 02800593 li a1,40
57c8: bff1 j 57a4 <vprintf+0x16c>
putc(fd, va_arg(ap, uint));
57ca: 008b0913 addi s2,s6,8
57ce: 000b4583 lbu a1,0(s6)
57d2: 8556 mv a0,s5
57d4: 00000097 auipc ra,0x0
57d8: d98080e7 jalr -616(ra) # 556c <putc>
57dc: 8b4a mv s6,s2
state = 0;
57de: 4981 li s3,0
57e0: bd65 j 5698 <vprintf+0x60>
putc(fd, c);
57e2: 85d2 mv a1,s4
57e4: 8556 mv a0,s5
57e6: 00000097 auipc ra,0x0
57ea: d86080e7 jalr -634(ra) # 556c <putc>
state = 0;
57ee: 4981 li s3,0
57f0: b565 j 5698 <vprintf+0x60>
s = va_arg(ap, char*);
57f2: 8b4e mv s6,s3
state = 0;
57f4: 4981 li s3,0
57f6: b54d j 5698 <vprintf+0x60>
}
}
}
57f8: 70e6 ld ra,120(sp)
57fa: 7446 ld s0,112(sp)
57fc: 74a6 ld s1,104(sp)
57fe: 7906 ld s2,96(sp)
5800: 69e6 ld s3,88(sp)
5802: 6a46 ld s4,80(sp)
5804: 6aa6 ld s5,72(sp)
5806: 6b06 ld s6,64(sp)
5808: 7be2 ld s7,56(sp)
580a: 7c42 ld s8,48(sp)
580c: 7ca2 ld s9,40(sp)
580e: 7d02 ld s10,32(sp)
5810: 6de2 ld s11,24(sp)
5812: 6109 addi sp,sp,128
5814: 8082 ret
0000000000005816 <fprintf>:
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
void
fprintf(int fd, const char *fmt, ...)
{
<<<<<<< HEAD
5818: 715d addi sp,sp,-80
581a: ec06 sd ra,24(sp)
581c: e822 sd s0,16(sp)
581e: 1000 addi s0,sp,32
5820: e010 sd a2,0(s0)
5822: e414 sd a3,8(s0)
5824: e818 sd a4,16(s0)
5826: ec1c sd a5,24(s0)
5828: 03043023 sd a6,32(s0)
582c: 03143423 sd a7,40(s0)
va_list ap;
va_start(ap, fmt);
5830: fe843423 sd s0,-24(s0)
vprintf(fd, fmt, ap);
5834: 8622 mv a2,s0
5836: 00000097 auipc ra,0x0
583a: e04080e7 jalr -508(ra) # 563a <vprintf>
}
583e: 60e2 ld ra,24(sp)
5840: 6442 ld s0,16(sp)
5842: 6161 addi sp,sp,80
5844: 8082 ret
0000000000005846 <printf>:
=======
5816: 715d addi sp,sp,-80
5818: ec06 sd ra,24(sp)
581a: e822 sd s0,16(sp)
581c: 1000 addi s0,sp,32
581e: e010 sd a2,0(s0)
5820: e414 sd a3,8(s0)
5822: e818 sd a4,16(s0)
5824: ec1c sd a5,24(s0)
5826: 03043023 sd a6,32(s0)
582a: 03143423 sd a7,40(s0)
va_list ap;
va_start(ap, fmt);
582e: fe843423 sd s0,-24(s0)
vprintf(fd, fmt, ap);
5832: 8622 mv a2,s0
5834: 00000097 auipc ra,0x0
5838: e04080e7 jalr -508(ra) # 5638 <vprintf>
}
583c: 60e2 ld ra,24(sp)
583e: 6442 ld s0,16(sp)
5840: 6161 addi sp,sp,80
5842: 8082 ret
0000000000005844 <printf>:
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
void
printf(const char *fmt, ...)
{
<<<<<<< HEAD
5846: 711d addi sp,sp,-96
5848: ec06 sd ra,24(sp)
584a: e822 sd s0,16(sp)
584c: 1000 addi s0,sp,32
584e: e40c sd a1,8(s0)
5850: e810 sd a2,16(s0)
5852: ec14 sd a3,24(s0)
5854: f018 sd a4,32(s0)
5856: f41c sd a5,40(s0)
5858: 03043823 sd a6,48(s0)
585c: 03143c23 sd a7,56(s0)
va_list ap;
va_start(ap, fmt);
5860: 00840613 addi a2,s0,8
5864: fec43423 sd a2,-24(s0)
vprintf(1, fmt, ap);
5868: 85aa mv a1,a0
586a: 4505 li a0,1
586c: 00000097 auipc ra,0x0
5870: dce080e7 jalr -562(ra) # 563a <vprintf>
}
5874: 60e2 ld ra,24(sp)
5876: 6442 ld s0,16(sp)
5878: 6125 addi sp,sp,96
587a: 8082 ret
000000000000587c <free>:
587c: 1141 addi sp,sp,-16
587e: e422 sd s0,8(sp)
5880: 0800 addi s0,sp,16
5882: ff050693 addi a3,a0,-16
5886: 00003797 auipc a5,0x3
588a: 96a7b783 ld a5,-1686(a5) # 81f0 <freep>
588e: a805 j 58be <free+0x42>
5890: 4618 lw a4,8(a2)
5892: 9db9 addw a1,a1,a4
5894: feb52c23 sw a1,-8(a0)
5898: 6398 ld a4,0(a5)
589a: 6318 ld a4,0(a4)
589c: fee53823 sd a4,-16(a0)
58a0: a091 j 58e4 <free+0x68>
58a2: ff852703 lw a4,-8(a0)
58a6: 9e39 addw a2,a2,a4
58a8: c790 sw a2,8(a5)
58aa: ff053703 ld a4,-16(a0)
58ae: e398 sd a4,0(a5)
58b0: a099 j 58f6 <free+0x7a>
58b2: 6398 ld a4,0(a5)
58b4: 00e7e463 bltu a5,a4,58bc <free+0x40>
58b8: 00e6ea63 bltu a3,a4,58cc <free+0x50>
58bc: 87ba mv a5,a4
58be: fed7fae3 bgeu a5,a3,58b2 <free+0x36>
58c2: 6398 ld a4,0(a5)
58c4: 00e6e463 bltu a3,a4,58cc <free+0x50>
58c8: fee7eae3 bltu a5,a4,58bc <free+0x40>
58cc: ff852583 lw a1,-8(a0)
58d0: 6390 ld a2,0(a5)
58d2: 02059713 slli a4,a1,0x20
58d6: 9301 srli a4,a4,0x20
58d8: 0712 slli a4,a4,0x4
58da: 9736 add a4,a4,a3
58dc: fae60ae3 beq a2,a4,5890 <free+0x14>
58e0: fec53823 sd a2,-16(a0)
58e4: 4790 lw a2,8(a5)
58e6: 02061713 slli a4,a2,0x20
58ea: 9301 srli a4,a4,0x20
58ec: 0712 slli a4,a4,0x4
58ee: 973e add a4,a4,a5
58f0: fae689e3 beq a3,a4,58a2 <free+0x26>
58f4: e394 sd a3,0(a5)
58f6: 00003717 auipc a4,0x3
58fa: 8ef73d23 sd a5,-1798(a4) # 81f0 <freep>
58fe: 6422 ld s0,8(sp)
5900: 0141 addi sp,sp,16
5902: 8082 ret
0000000000005904 <malloc>:
5904: 7139 addi sp,sp,-64
5906: fc06 sd ra,56(sp)
5908: f822 sd s0,48(sp)
590a: f426 sd s1,40(sp)
590c: f04a sd s2,32(sp)
590e: ec4e sd s3,24(sp)
5910: e852 sd s4,16(sp)
5912: e456 sd s5,8(sp)
5914: e05a sd s6,0(sp)
5916: 0080 addi s0,sp,64
5918: 02051493 slli s1,a0,0x20
591c: 9081 srli s1,s1,0x20
591e: 04bd addi s1,s1,15
5920: 8091 srli s1,s1,0x4
5922: 0014899b addiw s3,s1,1
5926: 0485 addi s1,s1,1
5928: 00003517 auipc a0,0x3
592c: 8c853503 ld a0,-1848(a0) # 81f0 <freep>
5930: c515 beqz a0,595c <malloc+0x58>
5932: 611c ld a5,0(a0)
5934: 4798 lw a4,8(a5)
5936: 02977f63 bgeu a4,s1,5974 <malloc+0x70>
593a: 8a4e mv s4,s3
593c: 0009871b sext.w a4,s3
5940: 6685 lui a3,0x1
5942: 00d77363 bgeu a4,a3,5948 <malloc+0x44>
5946: 6a05 lui s4,0x1
5948: 000a0b1b sext.w s6,s4
594c: 004a1a1b slliw s4,s4,0x4
5950: 00003917 auipc s2,0x3
5954: 8a090913 addi s2,s2,-1888 # 81f0 <freep>
5958: 5afd li s5,-1
595a: a88d j 59cc <malloc+0xc8>
595c: 00009797 auipc a5,0x9
5960: 0b478793 addi a5,a5,180 # ea10 <base>
5964: 00003717 auipc a4,0x3
5968: 88f73623 sd a5,-1908(a4) # 81f0 <freep>
596c: e39c sd a5,0(a5)
596e: 0007a423 sw zero,8(a5)
5972: b7e1 j 593a <malloc+0x36>
5974: 02e48b63 beq s1,a4,59aa <malloc+0xa6>
5978: 4137073b subw a4,a4,s3
597c: c798 sw a4,8(a5)
597e: 1702 slli a4,a4,0x20
5980: 9301 srli a4,a4,0x20
5982: 0712 slli a4,a4,0x4
5984: 97ba add a5,a5,a4
5986: 0137a423 sw s3,8(a5)
598a: 00003717 auipc a4,0x3
598e: 86a73323 sd a0,-1946(a4) # 81f0 <freep>
5992: 01078513 addi a0,a5,16
5996: 70e2 ld ra,56(sp)
5998: 7442 ld s0,48(sp)
599a: 74a2 ld s1,40(sp)
599c: 7902 ld s2,32(sp)
599e: 69e2 ld s3,24(sp)
59a0: 6a42 ld s4,16(sp)
59a2: 6aa2 ld s5,8(sp)
59a4: 6b02 ld s6,0(sp)
59a6: 6121 addi sp,sp,64
59a8: 8082 ret
59aa: 6398 ld a4,0(a5)
59ac: e118 sd a4,0(a0)
59ae: bff1 j 598a <malloc+0x86>
59b0: 01652423 sw s6,8(a0)
59b4: 0541 addi a0,a0,16
59b6: 00000097 auipc ra,0x0
59ba: ec6080e7 jalr -314(ra) # 587c <free>
59be: 00093503 ld a0,0(s2)
59c2: d971 beqz a0,5996 <malloc+0x92>
59c4: 611c ld a5,0(a0)
59c6: 4798 lw a4,8(a5)
59c8: fa9776e3 bgeu a4,s1,5974 <malloc+0x70>
59cc: 00093703 ld a4,0(s2)
59d0: 853e mv a0,a5
59d2: fef719e3 bne a4,a5,59c4 <malloc+0xc0>
59d6: 8552 mv a0,s4
59d8: 00000097 auipc ra,0x0
59dc: b7c080e7 jalr -1156(ra) # 5554 <sbrk>
59e0: fd5518e3 bne a0,s5,59b0 <malloc+0xac>
59e4: 4501 li a0,0
59e6: bf45 j 5996 <malloc+0x92>
00000000000059e8 <mem_init>:
59e8: 1141 addi sp,sp,-16
59ea: e406 sd ra,8(sp)
59ec: e022 sd s0,0(sp)
59ee: 0800 addi s0,sp,16
59f0: 6505 lui a0,0x1
59f2: 00000097 auipc ra,0x0
59f6: b62080e7 jalr -1182(ra) # 5554 <sbrk>
59fa: 00002797 auipc a5,0x2
59fe: 7ea7b723 sd a0,2030(a5) # 81e8 <alloc>
5a02: 00850793 addi a5,a0,8 # 1008 <bigdir+0x13c>
5a06: e11c sd a5,0(a0)
5a08: 60a2 ld ra,8(sp)
5a0a: 6402 ld s0,0(sp)
5a0c: 0141 addi sp,sp,16
5a0e: 8082 ret
0000000000005a10 <l_alloc>:
5a10: 1101 addi sp,sp,-32
5a12: ec06 sd ra,24(sp)
5a14: e822 sd s0,16(sp)
5a16: e426 sd s1,8(sp)
5a18: 1000 addi s0,sp,32
5a1a: 84aa mv s1,a0
5a1c: 00002797 auipc a5,0x2
5a20: 7c47a783 lw a5,1988(a5) # 81e0 <if_init>
5a24: c795 beqz a5,5a50 <l_alloc+0x40>
5a26: 00002717 auipc a4,0x2
5a2a: 7c273703 ld a4,1986(a4) # 81e8 <alloc>
5a2e: 6308 ld a0,0(a4)
5a30: 40e506b3 sub a3,a0,a4
5a34: 6785 lui a5,0x1
5a36: 37e1 addiw a5,a5,-8
5a38: 9f95 subw a5,a5,a3
5a3a: 02f4f563 bgeu s1,a5,5a64 <l_alloc+0x54>
5a3e: 1482 slli s1,s1,0x20
5a40: 9081 srli s1,s1,0x20
5a42: 94aa add s1,s1,a0
5a44: e304 sd s1,0(a4)
5a46: 60e2 ld ra,24(sp)
5a48: 6442 ld s0,16(sp)
5a4a: 64a2 ld s1,8(sp)
5a4c: 6105 addi sp,sp,32
5a4e: 8082 ret
5a50: 00000097 auipc ra,0x0
5a54: f98080e7 jalr -104(ra) # 59e8 <mem_init>
5a58: 4785 li a5,1
5a5a: 00002717 auipc a4,0x2
5a5e: 78f72323 sw a5,1926(a4) # 81e0 <if_init>
5a62: b7d1 j 5a26 <l_alloc+0x16>
5a64: 4501 li a0,0
5a66: b7c5 j 5a46 <l_alloc+0x36>
0000000000005a68 <l_free>:
5a68: 1141 addi sp,sp,-16
5a6a: e422 sd s0,8(sp)
5a6c: 0800 addi s0,sp,16
5a6e: 6422 ld s0,8(sp)
5a70: 0141 addi sp,sp,16
5a72: 8082 ret
=======
5844: 711d addi sp,sp,-96
5846: ec06 sd ra,24(sp)
5848: e822 sd s0,16(sp)
584a: 1000 addi s0,sp,32
584c: e40c sd a1,8(s0)
584e: e810 sd a2,16(s0)
5850: ec14 sd a3,24(s0)
5852: f018 sd a4,32(s0)
5854: f41c sd a5,40(s0)
5856: 03043823 sd a6,48(s0)
585a: 03143c23 sd a7,56(s0)
va_list ap;
va_start(ap, fmt);
585e: 00840613 addi a2,s0,8
5862: fec43423 sd a2,-24(s0)
vprintf(1, fmt, ap);
5866: 85aa mv a1,a0
5868: 4505 li a0,1
586a: 00000097 auipc ra,0x0
586e: dce080e7 jalr -562(ra) # 5638 <vprintf>
}
5872: 60e2 ld ra,24(sp)
5874: 6442 ld s0,16(sp)
5876: 6125 addi sp,sp,96
5878: 8082 ret
000000000000587a <free>:
typedef union header Header;
static Header base;
static Header *freep;
void free(void *ap) {
587a: 1141 addi sp,sp,-16
587c: e422 sd s0,8(sp)
587e: 0800 addi s0,sp,16
Header *bp, *p;
bp = (Header *)ap - 1;
5880: ff050693 addi a3,a0,-16
for (p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5884: 00003797 auipc a5,0x3
5888: 9147b783 ld a5,-1772(a5) # 8198 <freep>
588c: a805 j 58bc <free+0x42>
if (p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if (bp + bp->s.size == p->s.ptr) {
bp->s.size += p->s.ptr->s.size;
588e: 4618 lw a4,8(a2)
5890: 9db9 addw a1,a1,a4
5892: feb52c23 sw a1,-8(a0)
bp->s.ptr = p->s.ptr->s.ptr;
5896: 6398 ld a4,0(a5)
5898: 6318 ld a4,0(a4)
589a: fee53823 sd a4,-16(a0)
589e: a091 j 58e2 <free+0x68>
} else
bp->s.ptr = p->s.ptr;
if (p + p->s.size == bp) {
p->s.size += bp->s.size;
58a0: ff852703 lw a4,-8(a0)
58a4: 9e39 addw a2,a2,a4
58a6: c790 sw a2,8(a5)
p->s.ptr = bp->s.ptr;
58a8: ff053703 ld a4,-16(a0)
58ac: e398 sd a4,0(a5)
58ae: a099 j 58f4 <free+0x7a>
if (p >= p->s.ptr && (bp > p || bp < p->s.ptr))
58b0: 6398 ld a4,0(a5)
58b2: 00e7e463 bltu a5,a4,58ba <free+0x40>
58b6: 00e6ea63 bltu a3,a4,58ca <free+0x50>
void free(void *ap) {
58ba: 87ba mv a5,a4
for (p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
58bc: fed7fae3 bgeu a5,a3,58b0 <free+0x36>
58c0: 6398 ld a4,0(a5)
58c2: 00e6e463 bltu a3,a4,58ca <free+0x50>
if (p >= p->s.ptr && (bp > p || bp < p->s.ptr))
58c6: fee7eae3 bltu a5,a4,58ba <free+0x40>
if (bp + bp->s.size == p->s.ptr) {
58ca: ff852583 lw a1,-8(a0)
58ce: 6390 ld a2,0(a5)
58d0: 02059713 slli a4,a1,0x20
58d4: 9301 srli a4,a4,0x20
58d6: 0712 slli a4,a4,0x4
58d8: 9736 add a4,a4,a3
58da: fae60ae3 beq a2,a4,588e <free+0x14>
bp->s.ptr = p->s.ptr;
58de: fec53823 sd a2,-16(a0)
if (p + p->s.size == bp) {
58e2: 4790 lw a2,8(a5)
58e4: 02061713 slli a4,a2,0x20
58e8: 9301 srli a4,a4,0x20
58ea: 0712 slli a4,a4,0x4
58ec: 973e add a4,a4,a5
58ee: fae689e3 beq a3,a4,58a0 <free+0x26>
} else
p->s.ptr = bp;
58f2: e394 sd a3,0(a5)
freep = p;
58f4: 00003717 auipc a4,0x3
58f8: 8af73223 sd a5,-1884(a4) # 8198 <freep>
}
58fc: 6422 ld s0,8(sp)
58fe: 0141 addi sp,sp,16
5900: 8082 ret
0000000000005902 <malloc>:
hp->s.size = nu;
free((void *)(hp + 1));
return freep;
}
void *malloc(uint nbytes) {
5902: 7139 addi sp,sp,-64
5904: fc06 sd ra,56(sp)
5906: f822 sd s0,48(sp)
5908: f426 sd s1,40(sp)
590a: f04a sd s2,32(sp)
590c: ec4e sd s3,24(sp)
590e: e852 sd s4,16(sp)
5910: e456 sd s5,8(sp)
5912: e05a sd s6,0(sp)
5914: 0080 addi s0,sp,64
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1) / sizeof(Header) + 1;
5916: 02051493 slli s1,a0,0x20
591a: 9081 srli s1,s1,0x20
591c: 04bd addi s1,s1,15
591e: 8091 srli s1,s1,0x4
5920: 0014899b addiw s3,s1,1
5924: 0485 addi s1,s1,1
if ((prevp = freep) == 0) {
5926: 00003517 auipc a0,0x3
592a: 87253503 ld a0,-1934(a0) # 8198 <freep>
592e: c515 beqz a0,595a <malloc+0x58>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for (p = prevp->s.ptr;; prevp = p, p = p->s.ptr) {
5930: 611c ld a5,0(a0)
if (p->s.size >= nunits) {
5932: 4798 lw a4,8(a5)
5934: 02977f63 bgeu a4,s1,5972 <malloc+0x70>
5938: 8a4e mv s4,s3
593a: 0009871b sext.w a4,s3
593e: 6685 lui a3,0x1
5940: 00d77363 bgeu a4,a3,5946 <malloc+0x44>
5944: 6a05 lui s4,0x1
5946: 000a0b1b sext.w s6,s4
p = sbrk(nu * sizeof(Header));
594a: 004a1a1b slliw s4,s4,0x4
p->s.size = nunits;
}
freep = prevp;
return (void *)(p + 1);
}
if (p == freep)
594e: 00003917 auipc s2,0x3
5952: 84a90913 addi s2,s2,-1974 # 8198 <freep>
if (p == (char *)-1)
5956: 5afd li s5,-1
5958: a88d j 59ca <malloc+0xc8>
base.s.ptr = freep = prevp = &base;
595a: 00009797 auipc a5,0x9
595e: 05e78793 addi a5,a5,94 # e9b8 <base>
5962: 00003717 auipc a4,0x3
5966: 82f73b23 sd a5,-1994(a4) # 8198 <freep>
596a: e39c sd a5,0(a5)
base.s.size = 0;
596c: 0007a423 sw zero,8(a5)
if (p->s.size >= nunits) {
5970: b7e1 j 5938 <malloc+0x36>
if (p->s.size == nunits)
5972: 02e48b63 beq s1,a4,59a8 <malloc+0xa6>
p->s.size -= nunits;
5976: 4137073b subw a4,a4,s3
597a: c798 sw a4,8(a5)
p += p->s.size;
597c: 1702 slli a4,a4,0x20
597e: 9301 srli a4,a4,0x20
5980: 0712 slli a4,a4,0x4
5982: 97ba add a5,a5,a4
p->s.size = nunits;
5984: 0137a423 sw s3,8(a5)
freep = prevp;
5988: 00003717 auipc a4,0x3
598c: 80a73823 sd a0,-2032(a4) # 8198 <freep>
return (void *)(p + 1);
5990: 01078513 addi a0,a5,16
if ((p = morecore(nunits)) == 0)
return 0;
}
}
5994: 70e2 ld ra,56(sp)
5996: 7442 ld s0,48(sp)
5998: 74a2 ld s1,40(sp)
599a: 7902 ld s2,32(sp)
599c: 69e2 ld s3,24(sp)
599e: 6a42 ld s4,16(sp)
59a0: 6aa2 ld s5,8(sp)
59a2: 6b02 ld s6,0(sp)
59a4: 6121 addi sp,sp,64
59a6: 8082 ret
prevp->s.ptr = p->s.ptr;
59a8: 6398 ld a4,0(a5)
59aa: e118 sd a4,0(a0)
59ac: bff1 j 5988 <malloc+0x86>
hp->s.size = nu;
59ae: 01652423 sw s6,8(a0)
free((void *)(hp + 1));
59b2: 0541 addi a0,a0,16
59b4: 00000097 auipc ra,0x0
59b8: ec6080e7 jalr -314(ra) # 587a <free>
return freep;
59bc: 00093503 ld a0,0(s2)
if ((p = morecore(nunits)) == 0)
59c0: d971 beqz a0,5994 <malloc+0x92>
for (p = prevp->s.ptr;; prevp = p, p = p->s.ptr) {
59c2: 611c ld a5,0(a0)
if (p->s.size >= nunits) {
59c4: 4798 lw a4,8(a5)
59c6: fa9776e3 bgeu a4,s1,5972 <malloc+0x70>
if (p == freep)
59ca: 00093703 ld a4,0(s2)
59ce: 853e mv a0,a5
59d0: fef719e3 bne a4,a5,59c2 <malloc+0xc0>
p = sbrk(nu * sizeof(Header));
59d4: 8552 mv a0,s4
59d6: 00000097 auipc ra,0x0
59da: b7e080e7 jalr -1154(ra) # 5554 <sbrk>
if (p == (char *)-1)
59de: fd5518e3 bne a0,s5,59ae <malloc+0xac>
return 0;
59e2: 4501 li a0,0
59e4: bf45 j 5994 <malloc+0x92>
00000000000059e6 <mem_init>:
page_t *next_page;
} allocator_t;
static allocator_t alloc;
static int if_init = 0;
void mem_init() {
59e6: 1141 addi sp,sp,-16
59e8: e406 sd ra,8(sp)
59ea: e022 sd s0,0(sp)
59ec: 0800 addi s0,sp,16
alloc.next_page = (page_t *)sbrk(PGSIZE);
59ee: 6505 lui a0,0x1
59f0: 00000097 auipc ra,0x0
59f4: b64080e7 jalr -1180(ra) # 5554 <sbrk>
59f8: 00002797 auipc a5,0x2
59fc: 78a7bc23 sd a0,1944(a5) # 8190 <alloc>
page_t *p = (page_t *)alloc.next_page;
p->cur = (void *)p + sizeof(page_t);
5a00: 00850793 addi a5,a0,8 # 1008 <bigdir+0x13c>
5a04: e11c sd a5,0(a0)
}
5a06: 60a2 ld ra,8(sp)
5a08: 6402 ld s0,0(sp)
5a0a: 0141 addi sp,sp,16
5a0c: 8082 ret
0000000000005a0e <l_alloc>:
void *l_alloc(u32 size) {
5a0e: 1101 addi sp,sp,-32
5a10: ec06 sd ra,24(sp)
5a12: e822 sd s0,16(sp)
5a14: e426 sd s1,8(sp)
5a16: 1000 addi s0,sp,32
5a18: 84aa mv s1,a0
if (!if_init) {
5a1a: 00002797 auipc a5,0x2
5a1e: 76e7a783 lw a5,1902(a5) # 8188 <if_init>
5a22: c795 beqz a5,5a4e <l_alloc+0x40>
mem_init();
if_init = 1;
}
void *res = 0;
u32 avail = PGSIZE - (alloc.next_page->cur - (void *)(alloc.next_page)) -
5a24: 00002717 auipc a4,0x2
5a28: 76c73703 ld a4,1900(a4) # 8190 <alloc>
5a2c: 6308 ld a0,0(a4)
5a2e: 40e506b3 sub a3,a0,a4
sizeof(page_t);
if (avail > size) {
5a32: 6785 lui a5,0x1
5a34: 37e1 addiw a5,a5,-8
5a36: 9f95 subw a5,a5,a3
5a38: 02f4f563 bgeu s1,a5,5a62 <l_alloc+0x54>
res = alloc.next_page->cur;
alloc.next_page->cur += size;
5a3c: 1482 slli s1,s1,0x20
5a3e: 9081 srli s1,s1,0x20
5a40: 94aa add s1,s1,a0
5a42: e304 sd s1,0(a4)
} else {
return 0;
}
return res;
}
5a44: 60e2 ld ra,24(sp)
5a46: 6442 ld s0,16(sp)
5a48: 64a2 ld s1,8(sp)
5a4a: 6105 addi sp,sp,32
5a4c: 8082 ret
mem_init();
5a4e: 00000097 auipc ra,0x0
5a52: f98080e7 jalr -104(ra) # 59e6 <mem_init>
if_init = 1;
5a56: 4785 li a5,1
5a58: 00002717 auipc a4,0x2
5a5c: 72f72823 sw a5,1840(a4) # 8188 <if_init>
5a60: b7d1 j 5a24 <l_alloc+0x16>
return 0;
5a62: 4501 li a0,0
5a64: b7c5 j 5a44 <l_alloc+0x36>
0000000000005a66 <l_free>:
5a66: 1141 addi sp,sp,-16
5a68: e422 sd s0,8(sp)
5a6a: 0800 addi s0,sp,16
5a6c: 6422 ld s0,8(sp)
5a6e: 0141 addi sp,sp,16
5a70: 8082 ret
>>>>>>> 6205848b8618453bf50bfe5331b435a9614bac2b
|
src/numerics-sparse_matrices-zero.adb | sciencylab/lagrangian-solver | 0 | 8295 | separate (Numerics.Sparse_Matrices)
function Zero (N : in Pos) return Sparse_Matrix is
Result : Sparse_Matrix;
use Ada.Containers;
begin
Result.Format := CSC;
Result.N_Row := N;
Result.N_Col := N;
Result.X.Reserve_Capacity (0);
Result.I.Reserve_Capacity (0);
Result.P.Reserve_Capacity (Count_Type (N + 1));
for I in 1 .. N + 1 loop
Result.P.Append (1);
end loop;
return Result;
end Zero;
|
mc-sema/validator/x86/tests/PADDQrm.asm | randolphwong/mcsema | 2 | 8783 | <reponame>randolphwong/mcsema
BITS 32
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=FLAG_OF|FLAG_SF|FLAG_ZF|FLAG_AF|FLAG_PF|FLAG_CF
;TEST_FILE_META_END
; allocate 16 byte aligned stack space for the packed values
lea ecx, [esp-17]
and ecx, 0xfffffff0
; load 128 bit value into xmm0
mov DWORD [ecx], 0x12345678
mov DWORD [ecx+4], 0x55555555
mov DWORD [ecx+8], 0xdeadbeef
mov DWORD [ecx+12], 0x1f311c47
movaps xmm0, [ecx]
lea ecx, [ecx+16]
;TEST_BEGIN_RECORDING
lea ecx, [esp-17]
and ecx, 0xfffffff0 ; using this requires us to ignore ALU flags
mov DWORD [ecx], 0xabcdef12
mov DWORD [ecx+4], 0xaaaaaaaa
mov DWORD [ecx+8], 0xdeadbeef
mov DWORD [ecx+12], 0xfeeb1e01
paddq xmm0, [ecx]
mov ecx, [ecx]
mov ecx, 0
;TEST_END_RECORDING
cvtsi2sd xmm0, ecx
|
Ada/src/Problem_27.adb | Tim-Tom/project-euler | 0 | 24011 | with Ada.Integer_Text_IO;
with Ada.Text_IO;
with PrimeInstances;
package body Problem_27 is
package IO renames Ada.Text_IO;
package I_IO renames Ada.Integer_Text_IO;
procedure Solve is
subtype Parameter is Integer range -999 .. 999;
subtype Output is Integer range -(Parameter'Last**2) .. Parameter'Last**2;
package Integer_Primes renames PrimeInstances.Integer_Primes;
primes : constant Integer_Primes.Sieve := Integer_Primes.Generate_Sieve(79*79 + 999*79 + 999);
function Is_Prime(n : Integer) return Boolean is
subtype Sieve_Index is Positive range primes'Range;
lower : Sieve_Index := primes'First;
upper : Sieve_Index := primes'Last;
midPoint : Sieve_Index;
begin
if n <= 1 then
return False;
end if;
-- Basic binary search
while lower <= upper loop
midPoint := (lower + upper) / 2;
if n = primes(midPoint) then
return True;
elsif n < primes(midPoint) then
upper := midPoint - 1;
else
lower := midPoint + 1;
end if;
end loop;
return False;
end Is_Prime;
function doQuad(n : Natural; a,b : parameter) return Integer is
begin
return n*n + a*n + b;
end doQuad;
highest_count : Natural := 0;
best_output : Output;
begin
for a in Parameter'Range loop
for prime_index in primes'Range loop
exit when primes(prime_index) > Parameter'Last;
declare
b : constant Parameter := Parameter(primes(prime_index));
n : Natural := 0;
begin
while Is_Prime(doQuad(n, a, b)) loop
n := n + 1;
end loop;
if n > highest_count then
highest_count := n;
best_output := a * b;
end if;
end;
end loop;
end loop;
I_IO.Put(best_output);
IO.New_Line;
end Solve;
end Problem_27;
|
appName.applescript | rcmdnk/AppleScript | 11 | 1085 | <filename>appName.applescript
tell application "System Events"
set pList to name of every process whose frontmost is true
set appName to item 1 of pList
end tell
display dialog appName
tell application "Finder"
set AppList to name of every process
display dialog AppList
end tell
|
src/def_monitor.adb | lumalisan/EspeblancaYLos7PPs | 0 | 10346 | with Ada.Text_IO;
use Ada.Text_IO;
package body def_monitor is
protected body Monitor is
entry cadiraLock when (contCadires < 4) is
begin
contCadires := contCadires + 1;
end cadiraLock;
procedure cadiraUnlock is
begin
contCadires := contCadires - 1;
end cadiraUnlock;
entry menjarLock when (potsMenjar = False) is
begin
potsMenjar := True;
end menjarLock;
procedure menjarUnlock is
begin
potsMenjar := False;
end menjarUnlock;
function ferMenjar return Boolean is
begin
return contCadires > 0;
end ferMenjar;
end Monitor;
end def_monitor;
|
src/glfw/v2/glfw-display-modes.ads | Roldak/OpenGLAda | 0 | 30689 | -- part of OpenGLAda, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "COPYING"
package Glfw.Display.Modes is
type Mode is record
Width, Height : Natural;
Red_Bits, Green_Bits, Blue_Bits : Natural;
end record;
type Mode_List is array (Positive range <>) of Mode;
function Available_Modes return Mode_List;
function Desktop_Mode return Mode;
end Glfw.Display.Modes;
|
programs/oeis/102/A102902.asm | neoneye/loda | 22 | 27976 | <gh_stars>10-100
; A102902: a(n) = 9a(n-1) - 16a(n-2).
; 1,9,65,441,2929,19305,126881,833049,5467345,35877321,235418369,1544728185,10135859761,66507086889,436390025825,2863396842201,18788331166609,123280631024265,808912380552641,5307721328585529,34826893868427505,228518503558479081,1499436230131471649,9838630014247579545,64556690446124669521,423592133787160752969,2779422156946452064385,18237325271923496531961,119665172936168235757489,785189352074738177306025,5152061401693951823634401,33805522982049755575813209,221816724411344571004168465,1455462151989305049824504841,9550091777322232312353848129,62663431564071210013992555705,411169415639485173128271431281,2697909835730227197930561990249,17702477871340282011322715011745,116155743470378902935015443261721,762162045291965614233975549167569,5000966512101628081145532850320585,32814105884243202902566186866204161,215311488764562776824767156190708089
lpb $0
sub $0,1
mul $1,4
sub $1,$2
add $1,4
mul $2,2
add $2,$1
mul $1,2
lpe
add $1,1
mov $0,$1
|
Eq.agda | mjhopkins/PowerOfPi | 1 | 17052 | <filename>Eq.agda
module Eq where
infix 4 _≡_
{-
data _≡_ {A : Set} : A → A → Set where
Refl : {x : A} → x ≡ x
-}
data _≡_ {a} {A : Set a} (x : A) : A → Set a where
Refl : x ≡ x
{-# BUILTIN EQUALITY _≡_ #-}
{-# BUILTIN REFL Refl #-}
|
bin/Alloy/models/cloudnet/map.als | ORANGE-XFM/Cloudnet-TOSCA-toolbox | 21 | 1072 | /******************************************************************************
*
* Software Name : Cloudnet TOSCA toolbox
* Version: 1.0
* SPDX-FileCopyrightText: Copyright (c) 2020 Orange
* SPDX-License-Identifier: Apache-2.0
*
* This software is distributed under the Apache License 2.0
* the text of which is available at http://www.apache.org/licenses/LICENSE-2.0
* or see the "LICENSE-2.0.txt" file for more details.
*
* Author: <NAME> (INRIA) <<EMAIL>>
*
* Specification of map.
*
*******************************************************************************/
module map[VALUE]
sig Map {
entries: String -> lone VALUE
}
fun Map.keys[] : set String
{
this.entries.VALUE
}
fun Map.elems[] : set VALUE
{
String.(this.entries)
}
fun Map.entry[key: one String] : one VALUE
{
(this.entries[key])
}
pred Map.empty[]
{
no this.entries
}
pred Map.size[size : one Int]
{
// ISSUE: Currently commented as SAT solving takes too time :-(
// #this.entries = size
}
pred Map.min_length[length : one Int]
{
// ISSUE: Currently commented as SAT solving takes too time :-(
// #this.entries >= length
}
pred Map.entry_schema_type[type: set VALUE]
{
// ISSUE: Currently commented as generating CNF takes too time :-(
// this.elems in type
}
pred Map.one_entry[key: one String]
{
one this.entry[key]
}
pred Map.keys[k: set String]
{
this.keys = k
}
|
Task/Search-a-list/Ada/search-a-list.ada | LaudateCorpus1/RosettaCodeData | 1 | 2482 | with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Text_IO; use Ada.Text_IO;
procedure Test_List_Index is
Not_In : exception;
type List is array (Positive range <>) of Unbounded_String;
function Index (Haystack : List; Needle : String) return Positive is
begin
for Index in Haystack'Range loop
if Haystack (Index) = Needle then
return Index;
end if;
end loop;
raise Not_In;
end Index;
-- Functions to create lists
function "+" (X, Y : String) return List is
begin
return (1 => To_Unbounded_String (X), 2 => To_Unbounded_String (Y));
end "+";
function "+" (X : List; Y : String) return List is
begin
return X & (1 => To_Unbounded_String (Y));
end "+";
Haystack : List := "Zig"+"Zag"+"Wally"+"Ronald"+"Bush"+"Krusty"+"Charlie"+"Bush"+"Bozo";
procedure Check (Needle : String) is
begin
Put (Needle);
Put_Line ("at" & Positive'Image (Index (Haystack, Needle)));
exception
when Not_In => Put_Line (" is not in");
end Check;
begin
Check ("Washington");
Check ("Bush");
end Test_List_Index;
|
PiFrac/Category.agda | DreamLinuxer/popl21-artifact | 5 | 5963 | <filename>PiFrac/Category.agda
module PiFrac.Category where
open import Categories.Category.Monoidal
open import Categories.Category.Monoidal.Braided
open import Categories.Category.Monoidal.Symmetric
open import Categories.Category.Monoidal.Rigid
open import Categories.Category.Monoidal.CompactClosed
open import Categories.Functor.Bifunctor
open import Categories.Category
open import Categories.Category.Product
open import Categories.Category.Groupoid
open import Data.Empty
open import Data.Unit hiding (_≟_)
open import Data.Sum
open import Data.Product
open import Data.Maybe
open import Relation.Binary.Core
open import Relation.Binary hiding (Symmetric)
open import Relation.Nullary
open import Relation.Binary.PropositionalEquality
open import Function using (_∘_)
open import PiFrac.Syntax
open import PiFrac.Opsem
open import PiFrac.Interp
open import PiFrac.Properties
Pi∙ : Category _ _ _
Pi∙ = record
{ Obj = Σ[ t ∈ 𝕌 ] ⟦ t ⟧
; _⇒_ = λ (A , a) (B , b) → Σ[ c ∈ (A ↔ B) ] (interp c a ≡ just b)
; _≈_ = λ {(A , a)} {(B , b)} (c , eq) (c' , eq) → ⊤
; id = id↔ , refl
; _∘_ = λ (c₂ , eq₂) (c₁ , eq₁) → comp (c₁ , eq₁) (c₂ , eq₂)
; assoc = tt
; sym-assoc = tt
; identityˡ = tt
; identityʳ = tt
; identity² = tt
; equiv = record { refl = tt ; sym = λ _ → tt ; trans = λ _ _ → tt }
; ∘-resp-≈ = λ _ _ → tt
}
where
comp : ∀ {A B C a b c} → Σ[ c₁ ∈ (A ↔ B) ] (interp c₁ a ≡ just b) → Σ[ c₂ ∈ (B ↔ C) ] (interp c₂ b ≡ just c)
→ Σ[ c' ∈ (A ↔ C) ] (interp c' a ≡ just c)
comp {c = c} (c₁ , eq₁) (c₂ , eq₂) = (c₁ ⨾ c₂) , subst (λ x → (x >>= interp c₂) ≡ just c) (sym eq₁) eq₂
Pi∙Groupoid : Groupoid _ _ _
Pi∙Groupoid = record { category = Pi∙
; isGroupoid = record { _⁻¹ = λ (c , eq) → ! c , interp! c _ _ eq
; iso = record { isoˡ = tt
; isoʳ = tt } } }
Pi∙Monoidal : Monoidal Pi∙
Pi∙Monoidal = record
{ ⊗ = record
{ F₀ = λ ((A , a) , (B , b)) → (A ×ᵤ B) , (a , b)
; F₁ = λ {((A , a) , (B , b))} {((C , c) , (D , d))} ((c₁ , eq₁) , (c₂ , eq₂)) →
(c₁ ⊗ c₂) , subst (λ x → (x >>= (λ v₁' → interp c₂ b >>= λ v₂' → just (v₁' , v₂'))) ≡ just (c , d))
(sym eq₁) (subst (λ x → (x >>= λ v₂' → just (c , v₂')) ≡ just (c , d)) (sym eq₂) refl)
; identity = tt
; homomorphism = tt
; F-resp-≈ = λ _ → tt
}
; unit = (𝟙 , tt)
; unitorˡ = record { from = unite⋆l , refl
; to = uniti⋆l , refl
; iso = record { isoˡ = tt ; isoʳ = tt } }
; unitorʳ = record { from = unite⋆r , refl
; to = uniti⋆r , refl
; iso = record { isoˡ = tt ; isoʳ = tt } }
; associator = record { from = assocr⋆ , refl
; to = assocl⋆ , refl
; iso = record { isoˡ = tt ; isoʳ = tt } }
; unitorˡ-commute-from = tt
; unitorˡ-commute-to = tt
; unitorʳ-commute-from = tt
; unitorʳ-commute-to = tt
; assoc-commute-from = tt
; assoc-commute-to = tt
; triangle = tt
; pentagon = tt
}
Pi∙Braided : Braided Pi∙Monoidal
Pi∙Braided = record { braiding = record { F⇒G = record { η = λ _ → swap⋆ , refl
; commute = λ _ → tt
; sym-commute = λ _ → tt }
; F⇐G = record { η = λ _ → swap⋆ , refl
; commute = λ _ → tt
; sym-commute = λ _ → tt }
; iso = λ X → record { isoˡ = tt ; isoʳ = tt } }
; hexagon₁ = tt
; hexagon₂ = tt }
Pi∙Symmetric : Symmetric Pi∙Monoidal
Pi∙Symmetric = record { braided = Pi∙Braided
; commutative = tt}
Pi∙Rigid : LeftRigid Pi∙Monoidal
Pi∙Rigid = record { _⁻¹ = λ {(A , a) → 𝟙/ a , ↻}
; η = λ {(X , x)} → ηₓ x , refl
; ε = λ {(X , x)} → (swap⋆ ⨾ εₓ x) , εₓ≡
; snake₁ = tt
; snake₂ = tt}
where
εₓ≡ : ∀ {X} {x : ⟦ X ⟧} → interp (swap⋆ ⨾ εₓ x) (↻ , x) ≡ just tt
εₓ≡ {X} {x} with x ≟ x
... | yes refl = refl
... | no neq = ⊥-elim (neq refl)
Pi∙CompactClosed : CompactClosed Pi∙Monoidal
Pi∙CompactClosed = record { symmetric = Pi∙Symmetric
; rigid = inj₁ Pi∙Rigid }
|
samples/hellocpc.asm | wilsonpilon/msx-menu | 0 | 173920 | <gh_stars>0
org 33000
KM_WAIT_CHAR equ #BB06
TXT_INITIALISE equ #BB4E
TXT_VDU_ENABLE equ #BB54
TXT_OUTPUT equ #BB5A
TXT_CUR_ENABLE equ #BB7B
TXT_SET_PEN equ #BB90
TXT_CUR_ON equ #BB81
MC_START_PROGRAM equ #BD16
start
if 0
ld hl, program
ld c, 0
call MC_START_PROGRAM
endif
program
if 0
call TXT_INITIALISE
call TXT_VDU_ENABLE
ld a,1
call TXT_SET_PEN
endif
ld bc,1010h
another
push bc
ld hl,hello
again ld a,(hl)
cp 0
jr z, exit
push hl
call TXT_OUTPUT
pop hl
inc hl
jr again
exit
pop bc
djnz another
;call TXT_CUR_ENABLE
call TXT_CUR_ON
call KM_WAIT_CHAR
ret
hello db "Hello, Amstrad CPC world.", 0Dh, 0Ah, 0
end start
|
working with registers/loadImmediate.asm | DanerSound/MIPS-from-scratch | 2 | 21714 | # Direct Use of loadImmediate with registers
#
# fileName:loadImmediate
#
.data
.text
main: li $t0,0x0
li $t1,0x1
li $t2,0x2
li $t3,0x3
li $t4,0x4
li $t5,0x5
li $t6,0x6
li $t7,0x7
li $t8,0x8
li $t9,0x9
#exit the program
li $v0,10
syscall
|
llvm-gcc-4.2-2.9/gcc/ada/par-ch12.adb | vidkidz/crossbridge | 1 | 27424 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P A R . C H 1 2 --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Style_Checks (All_Checks);
-- Turn off subprogram body ordering check. Subprograms are in order
-- by RM section rather than alphabetical
separate (Par)
package body Ch12 is
-- Local functions, used only in this chapter
function P_Formal_Derived_Type_Definition return Node_Id;
function P_Formal_Discrete_Type_Definition return Node_Id;
function P_Formal_Fixed_Point_Definition return Node_Id;
function P_Formal_Floating_Point_Definition return Node_Id;
function P_Formal_Modular_Type_Definition return Node_Id;
function P_Formal_Package_Declaration return Node_Id;
function P_Formal_Private_Type_Definition return Node_Id;
function P_Formal_Signed_Integer_Type_Definition return Node_Id;
function P_Formal_Subprogram_Declaration return Node_Id;
function P_Formal_Type_Declaration return Node_Id;
function P_Formal_Type_Definition return Node_Id;
function P_Generic_Association return Node_Id;
procedure P_Formal_Object_Declarations (Decls : List_Id);
-- Scans one or more formal object declarations and appends them to
-- Decls. Scans more than one declaration only in the case where the
-- source has a declaration with multiple defining identifiers.
--------------------------------
-- 12.1 Generic (also 8.5.5) --
--------------------------------
-- This routine parses either one of the forms of a generic declaration
-- or a generic renaming declaration.
-- GENERIC_DECLARATION ::=
-- GENERIC_SUBPROGRAM_DECLARATION | GENERIC_PACKAGE_DECLARATION
-- GENERIC_SUBPROGRAM_DECLARATION ::=
-- GENERIC_FORMAL_PART SUBPROGRAM_SPECIFICATION;
-- GENERIC_PACKAGE_DECLARATION ::=
-- GENERIC_FORMAL_PART PACKAGE_SPECIFICATION;
-- GENERIC_FORMAL_PART ::=
-- generic {GENERIC_FORMAL_PARAMETER_DECLARATION | USE_CLAUSE}
-- GENERIC_RENAMING_DECLARATION ::=
-- generic package DEFINING_PROGRAM_UNIT_NAME
-- renames generic_package_NAME
-- | generic procedure DEFINING_PROGRAM_UNIT_NAME
-- renames generic_procedure_NAME
-- | generic function DEFINING_PROGRAM_UNIT_NAME
-- renames generic_function_NAME
-- GENERIC_FORMAL_PARAMETER_DECLARATION ::=
-- FORMAL_OBJECT_DECLARATION
-- | FORMAL_TYPE_DECLARATION
-- | FORMAL_SUBPROGRAM_DECLARATION
-- | FORMAL_PACKAGE_DECLARATION
-- The caller has checked that the initial token is GENERIC
-- Error recovery: can raise Error_Resync
function P_Generic return Node_Id is
Gen_Sloc : constant Source_Ptr := Token_Ptr;
Gen_Decl : Node_Id;
Decl_Node : Node_Id;
Decls : List_Id;
Def_Unit : Node_Id;
Ren_Token : Token_Type;
Scan_State : Saved_Scan_State;
begin
Scan; -- past GENERIC
if Token = Tok_Private then
Error_Msg_SC ("PRIVATE goes before GENERIC, not after");
Scan; -- past junk PRIVATE token
end if;
Save_Scan_State (Scan_State); -- at token past GENERIC
-- Check for generic renaming declaration case
if Token = Tok_Package
or else Token = Tok_Function
or else Token = Tok_Procedure
then
Ren_Token := Token;
Scan; -- scan past PACKAGE, FUNCTION or PROCEDURE
if Token = Tok_Identifier then
Def_Unit := P_Defining_Program_Unit_Name;
Check_Misspelling_Of (Tok_Renames);
if Token = Tok_Renames then
if Ren_Token = Tok_Package then
Decl_Node := New_Node
(N_Generic_Package_Renaming_Declaration, Gen_Sloc);
elsif Ren_Token = Tok_Procedure then
Decl_Node := New_Node
(N_Generic_Procedure_Renaming_Declaration, Gen_Sloc);
else -- Ren_Token = Tok_Function then
Decl_Node := New_Node
(N_Generic_Function_Renaming_Declaration, Gen_Sloc);
end if;
Scan; -- past RENAMES
Set_Defining_Unit_Name (Decl_Node, Def_Unit);
Set_Name (Decl_Node, P_Name);
TF_Semicolon;
return Decl_Node;
end if;
end if;
end if;
-- Fall through if this is *not* a generic renaming declaration
Restore_Scan_State (Scan_State);
Decls := New_List;
-- Loop through generic parameter declarations and use clauses
Decl_Loop : loop
P_Pragmas_Opt (Decls);
if Token = Tok_Private then
Error_Msg_S ("generic private child packages not permitted");
Scan; -- past PRIVATE
end if;
if Token = Tok_Use then
Append (P_Use_Clause, Decls);
else
-- Parse a generic parameter declaration
if Token = Tok_Identifier then
P_Formal_Object_Declarations (Decls);
elsif Token = Tok_Type then
Append (P_Formal_Type_Declaration, Decls);
elsif Token = Tok_With then
Scan; -- past WITH
if Token = Tok_Package then
Append (P_Formal_Package_Declaration, Decls);
elsif Token = Tok_Procedure or Token = Tok_Function then
Append (P_Formal_Subprogram_Declaration, Decls);
else
Error_Msg_BC
("FUNCTION, PROCEDURE or PACKAGE expected here");
Resync_Past_Semicolon;
end if;
elsif Token = Tok_Subtype then
Error_Msg_SC ("subtype declaration not allowed " &
"as generic parameter declaration!");
Resync_Past_Semicolon;
else
exit Decl_Loop;
end if;
end if;
end loop Decl_Loop;
-- Generic formal part is scanned, scan out subprogram or package spec
if Token = Tok_Package then
Gen_Decl := New_Node (N_Generic_Package_Declaration, Gen_Sloc);
Set_Specification (Gen_Decl, P_Package (Pf_Spcn));
else
Gen_Decl := New_Node (N_Generic_Subprogram_Declaration, Gen_Sloc);
Set_Specification (Gen_Decl, P_Subprogram_Specification);
if Nkind (Defining_Unit_Name (Specification (Gen_Decl))) =
N_Defining_Program_Unit_Name
and then Scope.Last > 0
then
Error_Msg_SP ("child unit allowed only at library level");
end if;
TF_Semicolon;
end if;
Set_Generic_Formal_Declarations (Gen_Decl, Decls);
return Gen_Decl;
end P_Generic;
-------------------------------
-- 12.1 Generic Declaration --
-------------------------------
-- Parsed by P_Generic (12.1)
------------------------------------------
-- 12.1 Generic Subprogram Declaration --
------------------------------------------
-- Parsed by P_Generic (12.1)
---------------------------------------
-- 12.1 Generic Package Declaration --
---------------------------------------
-- Parsed by P_Generic (12.1)
-------------------------------
-- 12.1 Generic Formal Part --
-------------------------------
-- Parsed by P_Generic (12.1)
-------------------------------------------------
-- 12.1 Generic Formal Parameter Declaration --
-------------------------------------------------
-- Parsed by P_Generic (12.1)
---------------------------------
-- 12.3 Generic Instantiation --
---------------------------------
-- Generic package instantiation parsed by P_Package (7.1)
-- Generic procedure instantiation parsed by P_Subprogram (6.1)
-- Generic function instantiation parsed by P_Subprogram (6.1)
-------------------------------
-- 12.3 Generic Actual Part --
-------------------------------
-- GENERIC_ACTUAL_PART ::=
-- (GENERIC_ASSOCIATION {, GENERIC_ASSOCIATION})
-- Returns a list of generic associations, or Empty if none are present
-- Error recovery: cannot raise Error_Resync
function P_Generic_Actual_Part_Opt return List_Id is
Association_List : List_Id;
begin
-- Figure out if a generic actual part operation is present. Clearly
-- there is no generic actual part if the current token is semicolon
if Token = Tok_Semicolon then
return No_List;
-- If we don't have a left paren, then we have an error, and the job
-- is to figure out whether a left paren or semicolon was intended.
-- We assume a missing left paren (and hence a generic actual part
-- present) if the current token is not on a new line, or if it is
-- indented from the subprogram token. Otherwise assume missing
-- semicolon (which will be diagnosed by caller) and no generic part
elsif Token /= Tok_Left_Paren
and then Token_Is_At_Start_Of_Line
and then Start_Column <= Scope.Table (Scope.Last).Ecol
then
return No_List;
-- Otherwise we have a generic actual part (either a left paren is
-- present, or we have decided that there must be a missing left paren)
else
Association_List := New_List;
T_Left_Paren;
loop
Append (P_Generic_Association, Association_List);
exit when not Comma_Present;
end loop;
T_Right_Paren;
return Association_List;
end if;
end P_Generic_Actual_Part_Opt;
-------------------------------
-- 12.3 Generic Association --
-------------------------------
-- GENERIC_ASSOCIATION ::=
-- [generic_formal_parameter_SELECTOR_NAME =>]
-- EXPLICIT_GENERIC_ACTUAL_PARAMETER
-- EXPLICIT_GENERIC_ACTUAL_PARAMETER ::=
-- EXPRESSION | variable_NAME | subprogram_NAME
-- | entry_NAME | SUBTYPE_MARK | package_instance_NAME
-- Error recovery: cannot raise Error_Resync
function P_Generic_Association return Node_Id is
Scan_State : Saved_Scan_State;
Param_Name_Node : Node_Id;
Generic_Assoc_Node : Node_Id;
begin
Generic_Assoc_Node := New_Node (N_Generic_Association, Token_Ptr);
if Token in Token_Class_Desig then
Param_Name_Node := Token_Node;
Save_Scan_State (Scan_State); -- at designator
Scan; -- past simple name or operator symbol
if Token = Tok_Arrow then
Scan; -- past arrow
Set_Selector_Name (Generic_Assoc_Node, Param_Name_Node);
else
Restore_Scan_State (Scan_State); -- to designator
end if;
end if;
Set_Explicit_Generic_Actual_Parameter (Generic_Assoc_Node, P_Expression);
return Generic_Assoc_Node;
end P_Generic_Association;
---------------------------------------------
-- 12.3 Explicit Generic Actual Parameter --
---------------------------------------------
-- Parsed by P_Generic_Association (12.3)
--------------------------------------
-- 12.4 Formal Object Declarations --
--------------------------------------
-- FORMAL_OBJECT_DECLARATION ::=
-- DEFINING_IDENTIFIER_LIST :
-- MODE SUBTYPE_MARK [:= DEFAULT_EXPRESSION];
-- The caller has checked that the initial token is an identifier
-- Error recovery: cannot raise Error_Resync
procedure P_Formal_Object_Declarations (Decls : List_Id) is
Decl_Node : Node_Id;
Scan_State : Saved_Scan_State;
Num_Idents : Nat;
Ident : Nat;
Idents : array (Int range 1 .. 4096) of Entity_Id;
-- This array holds the list of defining identifiers. The upper bound
-- of 4096 is intended to be essentially infinite, and we do not even
-- bother to check for it being exceeded.
begin
Idents (1) := P_Defining_Identifier (C_Comma_Colon);
Num_Idents := 1;
while Comma_Present loop
Num_Idents := Num_Idents + 1;
Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon);
end loop;
T_Colon;
-- If there are multiple identifiers, we repeatedly scan the
-- type and initialization expression information by resetting
-- the scan pointer (so that we get completely separate trees
-- for each occurrence).
if Num_Idents > 1 then
Save_Scan_State (Scan_State);
end if;
-- Loop through defining identifiers in list
Ident := 1;
Ident_Loop : loop
Decl_Node := New_Node (N_Formal_Object_Declaration, Token_Ptr);
Set_Defining_Identifier (Decl_Node, Idents (Ident));
P_Mode (Decl_Node);
Set_Subtype_Mark (Decl_Node, P_Subtype_Mark_Resync);
No_Constraint;
Set_Expression (Decl_Node, Init_Expr_Opt);
if Ident > 1 then
Set_Prev_Ids (Decl_Node, True);
end if;
if Ident < Num_Idents then
Set_More_Ids (Decl_Node, True);
end if;
Append (Decl_Node, Decls);
exit Ident_Loop when Ident = Num_Idents;
Ident := Ident + 1;
Restore_Scan_State (Scan_State);
end loop Ident_Loop;
TF_Semicolon;
end P_Formal_Object_Declarations;
-----------------------------------
-- 12.5 Formal Type Declaration --
-----------------------------------
-- FORMAL_TYPE_DECLARATION ::=
-- type DEFINING_IDENTIFIER [DISCRIMINANT_PART]
-- is FORMAL_TYPE_DEFINITION;
-- The caller has checked that the initial token is TYPE
-- Error recovery: cannot raise Error_Resync
function P_Formal_Type_Declaration return Node_Id is
Decl_Node : Node_Id;
Def_Node : Node_Id;
begin
Decl_Node := New_Node (N_Formal_Type_Declaration, Token_Ptr);
Scan; -- past TYPE
Set_Defining_Identifier (Decl_Node, P_Defining_Identifier);
if P_Unknown_Discriminant_Part_Opt then
Set_Unknown_Discriminants_Present (Decl_Node, True);
else
Set_Discriminant_Specifications
(Decl_Node, P_Known_Discriminant_Part_Opt);
end if;
T_Is;
Def_Node := P_Formal_Type_Definition;
if Def_Node /= Error then
Set_Formal_Type_Definition (Decl_Node, Def_Node);
TF_Semicolon;
else
Decl_Node := Error;
-- If we have semicolon, skip it to avoid cascaded errors
if Token = Tok_Semicolon then
Scan;
end if;
end if;
return Decl_Node;
end P_Formal_Type_Declaration;
----------------------------------
-- 12.5 Formal Type Definition --
----------------------------------
-- FORMAL_TYPE_DEFINITION ::=
-- FORMAL_PRIVATE_TYPE_DEFINITION
-- | FORMAL_DERIVED_TYPE_DEFINITION
-- | FORMAL_DISCRETE_TYPE_DEFINITION
-- | FORMAL_SIGNED_INTEGER_TYPE_DEFINITION
-- | FORMAL_MODULAR_TYPE_DEFINITION
-- | FORMAL_FLOATING_POINT_DEFINITION
-- | FORMAL_ORDINARY_FIXED_POINT_DEFINITION
-- | FORMAL_DECIMAL_FIXED_POINT_DEFINITION
-- | FORMAL_ARRAY_TYPE_DEFINITION
-- | FORMAL_ACCESS_TYPE_DEFINITION
-- | FORMAL_INTERFACE_TYPE_DEFINITION
-- FORMAL_ARRAY_TYPE_DEFINITION ::= ARRAY_TYPE_DEFINITION
-- FORMAL_ACCESS_TYPE_DEFINITION ::= ACCESS_TYPE_DEFINITION
-- FORMAL_INTERFACE_TYPE_DEFINITION ::= INTERFACE_TYPE_DEFINITION
function P_Formal_Type_Definition return Node_Id is
Scan_State : Saved_Scan_State;
Typedef_Node : Node_Id;
begin
if Token_Name = Name_Abstract then
Check_95_Keyword (Tok_Abstract, Tok_Tagged);
end if;
if Token_Name = Name_Tagged then
Check_95_Keyword (Tok_Tagged, Tok_Private);
Check_95_Keyword (Tok_Tagged, Tok_Limited);
end if;
case Token is
-- Mostly we can tell what we have from the initial token. The one
-- exception is ABSTRACT, where we have to scan ahead to see if we
-- have a formal derived type or a formal private type definition.
-- In addition, in Ada 2005 LIMITED may appear after abstract, so
-- that the lookahead must be extended by one more token.
when Tok_Abstract =>
Save_Scan_State (Scan_State);
Scan; -- past ABSTRACT
if Token = Tok_New then
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Derived_Type_Definition;
elsif Token = Tok_Limited then
Scan; -- past LIMITED
if Token = Tok_New then
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Derived_Type_Definition;
else
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Private_Type_Definition;
end if;
else
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Private_Type_Definition;
end if;
when Tok_Access =>
return P_Access_Type_Definition;
when Tok_Array =>
return P_Array_Type_Definition;
when Tok_Delta =>
return P_Formal_Fixed_Point_Definition;
when Tok_Digits =>
return P_Formal_Floating_Point_Definition;
when Tok_Interface => -- Ada 2005 (AI-251)
return P_Interface_Type_Definition (Is_Synchronized => False);
when Tok_Left_Paren =>
return P_Formal_Discrete_Type_Definition;
when Tok_Limited =>
Save_Scan_State (Scan_State);
Scan; -- past LIMITED
if Token = Tok_Interface then
Typedef_Node := P_Interface_Type_Definition
(Is_Synchronized => False);
Set_Limited_Present (Typedef_Node);
return Typedef_Node;
elsif Token = Tok_New then
Restore_Scan_State (Scan_State); -- to LIMITED
return P_Formal_Derived_Type_Definition;
else
if Token = Tok_Abstract then
Error_Msg_SC ("ABSTRACT must come before LIMITED");
Scan; -- past improper ABSTRACT
if Token = Tok_New then
Restore_Scan_State (Scan_State); -- to LIMITED
return P_Formal_Derived_Type_Definition;
else
Restore_Scan_State (Scan_State);
return P_Formal_Private_Type_Definition;
end if;
end if;
Restore_Scan_State (Scan_State);
return P_Formal_Private_Type_Definition;
end if;
when Tok_Mod =>
return P_Formal_Modular_Type_Definition;
when Tok_New =>
return P_Formal_Derived_Type_Definition;
when Tok_Private |
Tok_Tagged =>
return P_Formal_Private_Type_Definition;
when Tok_Range =>
return P_Formal_Signed_Integer_Type_Definition;
when Tok_Record =>
Error_Msg_SC ("record not allowed in generic type definition!");
Discard_Junk_Node (P_Record_Definition);
return Error;
-- Ada 2005 (AI-345)
when Tok_Protected |
Tok_Synchronized |
Tok_Task =>
Scan; -- past TASK, PROTECTED or SYNCHRONIZED
declare
Saved_Token : constant Token_Type := Token;
begin
Typedef_Node := P_Interface_Type_Definition
(Is_Synchronized => True);
case Saved_Token is
when Tok_Task =>
Set_Task_Present (Typedef_Node);
when Tok_Protected =>
Set_Protected_Present (Typedef_Node);
when Tok_Synchronized =>
Set_Synchronized_Present (Typedef_Node);
when others =>
null;
end case;
return Typedef_Node;
end;
when others =>
Error_Msg_BC ("expecting generic type definition here");
Resync_Past_Semicolon;
return Error;
end case;
end P_Formal_Type_Definition;
--------------------------------------------
-- 12.5.1 Formal Private Type Definition --
--------------------------------------------
-- FORMAL_PRIVATE_TYPE_DEFINITION ::=
-- [[abstract] tagged] [limited] private
-- The caller has checked the initial token is PRIVATE, ABSTRACT,
-- TAGGED or LIMITED
-- Error recovery: cannot raise Error_Resync
function P_Formal_Private_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node := New_Node (N_Formal_Private_Type_Definition, Token_Ptr);
if Token = Tok_Abstract then
Scan; -- past ABSTRACT
if Token_Name = Name_Tagged then
Check_95_Keyword (Tok_Tagged, Tok_Private);
Check_95_Keyword (Tok_Tagged, Tok_Limited);
end if;
if Token /= Tok_Tagged then
Error_Msg_SP ("ABSTRACT must be followed by TAGGED");
else
Set_Abstract_Present (Def_Node, True);
end if;
end if;
if Token = Tok_Tagged then
Set_Tagged_Present (Def_Node, True);
Scan; -- past TAGGED
end if;
if Token = Tok_Limited then
Set_Limited_Present (Def_Node, True);
Scan; -- past LIMITED
end if;
if Token = Tok_Abstract then
if Prev_Token = Tok_Tagged then
Error_Msg_SC ("ABSTRACT must come before TAGGED");
elsif Prev_Token = Tok_Limited then
Error_Msg_SC ("ABSTRACT must come before LIMITED");
end if;
Resync_Past_Semicolon;
elsif Token = Tok_Tagged then
Error_Msg_SC ("TAGGED must come before LIMITED");
Resync_Past_Semicolon;
end if;
Set_Sloc (Def_Node, Token_Ptr);
T_Private;
return Def_Node;
end P_Formal_Private_Type_Definition;
--------------------------------------------
-- 12.5.1 Formal Derived Type Definition --
--------------------------------------------
-- FORMAL_DERIVED_TYPE_DEFINITION ::=
-- [abstract] [limited]
-- new SUBTYPE_MARK [[AND interface_list] with private]
-- The caller has checked the initial token(s) is/are NEW, ASTRACT NEW
-- LIMITED NEW, or ABSTRACT LIMITED NEW
-- Error recovery: cannot raise Error_Resync
function P_Formal_Derived_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node := New_Node (N_Formal_Derived_Type_Definition, Token_Ptr);
if Token = Tok_Abstract then
Set_Abstract_Present (Def_Node);
Scan; -- past ABSTRACT
end if;
if Token = Tok_Limited then
Set_Limited_Present (Def_Node);
Scan; -- past Limited
if Ada_Version < Ada_05 then
Error_Msg_SP
("LIMITED in derived type is an Ada 2005 extension");
Error_Msg_SP
("\unit must be compiled with -gnat05 switch");
end if;
if Token = Tok_Abstract then
Scan; -- past ABSTRACT. diagnosed already in caller.
end if;
end if;
Scan; -- past NEW;
Set_Subtype_Mark (Def_Node, P_Subtype_Mark);
No_Constraint;
-- Ada 2005 (AI-251): Deal with interfaces
if Token = Tok_And then
Scan; -- past AND
if Ada_Version < Ada_05 then
Error_Msg_SP
("abstract interface is an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
Set_Interface_List (Def_Node, New_List);
loop
Append (P_Qualified_Simple_Name, Interface_List (Def_Node));
exit when Token /= Tok_And;
Scan; -- past AND
end loop;
end if;
if Token = Tok_With then
Scan; -- past WITH
Set_Private_Present (Def_Node, True);
T_Private;
elsif Token = Tok_Tagged then
Scan;
if Token = Tok_Private then
Error_Msg_SC ("TAGGED should be WITH");
Set_Private_Present (Def_Node, True);
T_Private;
else
Ignore (Tok_Tagged);
end if;
end if;
return Def_Node;
end P_Formal_Derived_Type_Definition;
---------------------------------------------
-- 12.5.2 Formal Discrete Type Definition --
---------------------------------------------
-- FORMAL_DISCRETE_TYPE_DEFINITION ::= (<>)
-- The caller has checked the initial token is left paren
-- Error recovery: cannot raise Error_Resync
function P_Formal_Discrete_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node := New_Node (N_Formal_Discrete_Type_Definition, Token_Ptr);
Scan; -- past left paren
T_Box;
T_Right_Paren;
return Def_Node;
end P_Formal_Discrete_Type_Definition;
---------------------------------------------------
-- 12.5.2 Formal Signed Integer Type Definition --
---------------------------------------------------
-- FORMAL_SIGNED_INTEGER_TYPE_DEFINITION ::= range <>
-- The caller has checked the initial token is RANGE
-- Error recovery: cannot raise Error_Resync
function P_Formal_Signed_Integer_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node :=
New_Node (N_Formal_Signed_Integer_Type_Definition, Token_Ptr);
Scan; -- past RANGE
T_Box;
return Def_Node;
end P_Formal_Signed_Integer_Type_Definition;
--------------------------------------------
-- 12.5.2 Formal Modular Type Definition --
--------------------------------------------
-- FORMAL_MODULAR_TYPE_DEFINITION ::= mod <>
-- The caller has checked the initial token is MOD
-- Error recovery: cannot raise Error_Resync
function P_Formal_Modular_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node :=
New_Node (N_Formal_Modular_Type_Definition, Token_Ptr);
Scan; -- past MOD
T_Box;
return Def_Node;
end P_Formal_Modular_Type_Definition;
----------------------------------------------
-- 12.5.2 Formal Floating Point Definition --
----------------------------------------------
-- FORMAL_FLOATING_POINT_DEFINITION ::= digits <>
-- The caller has checked the initial token is DIGITS
-- Error recovery: cannot raise Error_Resync
function P_Formal_Floating_Point_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node :=
New_Node (N_Formal_Floating_Point_Definition, Token_Ptr);
Scan; -- past DIGITS
T_Box;
return Def_Node;
end P_Formal_Floating_Point_Definition;
-------------------------------------------
-- 12.5.2 Formal Fixed Point Definition --
-------------------------------------------
-- This routine parses either a formal ordinary fixed point definition
-- or a formal decimal fixed point definition:
-- FORMAL_ORDINARY_FIXED_POINT_DEFINITION ::= delta <>
-- FORMAL_DECIMAL_FIXED_POINT_DEFINITION ::= delta <> digits <>
-- The caller has checked the initial token is DELTA
-- Error recovery: cannot raise Error_Resync
function P_Formal_Fixed_Point_Definition return Node_Id is
Def_Node : Node_Id;
Delta_Sloc : Source_Ptr;
begin
Delta_Sloc := Token_Ptr;
Scan; -- past DELTA
T_Box;
if Token = Tok_Digits then
Def_Node :=
New_Node (N_Formal_Decimal_Fixed_Point_Definition, Delta_Sloc);
Scan; -- past DIGITS
T_Box;
else
Def_Node :=
New_Node (N_Formal_Ordinary_Fixed_Point_Definition, Delta_Sloc);
end if;
return Def_Node;
end P_Formal_Fixed_Point_Definition;
----------------------------------------------------
-- 12.5.2 Formal Ordinary Fixed Point Definition --
----------------------------------------------------
-- Parsed by P_Formal_Fixed_Point_Definition (12.5.2)
---------------------------------------------------
-- 12.5.2 Formal Decimal Fixed Point Definition --
---------------------------------------------------
-- Parsed by P_Formal_Fixed_Point_Definition (12.5.2)
------------------------------------------
-- 12.5.3 Formal Array Type Definition --
------------------------------------------
-- Parsed by P_Formal_Type_Definition (12.5)
-------------------------------------------
-- 12.5.4 Formal Access Type Definition --
-------------------------------------------
-- Parsed by P_Formal_Type_Definition (12.5)
-----------------------------------------
-- 12.6 Formal Subprogram Declaration --
-----------------------------------------
-- FORMAL_SUBPROGRAM_DECLARATION ::=
-- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION
-- | FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION
-- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION ::=
-- with SUBPROGRAM_SPECIFICATION [is SUBPROGRAM_DEFAULT];
-- FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION ::=
-- with SUBPROGRAM_SPECIFICATION is abstract [SUBPROGRAM_DEFAULT];
-- SUBPROGRAM_DEFAULT ::= DEFAULT_NAME | <>
-- DEFAULT_NAME ::= NAME | null
-- The caller has checked that the initial tokens are WITH FUNCTION or
-- WITH PROCEDURE, and the initial WITH has been scanned out.
-- A null default is an Ada 2005 feature
-- Error recovery: cannot raise Error_Resync
function P_Formal_Subprogram_Declaration return Node_Id is
Prev_Sloc : constant Source_Ptr := Prev_Token_Ptr;
Spec_Node : constant Node_Id := P_Subprogram_Specification;
Def_Node : Node_Id;
begin
if Token = Tok_Is then
T_Is; -- past IS, skip extra IS or ";"
if Token = Tok_Abstract then
Def_Node :=
New_Node (N_Formal_Abstract_Subprogram_Declaration, Prev_Sloc);
Scan; -- past ABSTRACT
if Ada_Version < Ada_05 then
Error_Msg_SP
("formal abstract subprograms are an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
else
Def_Node :=
New_Node (N_Formal_Concrete_Subprogram_Declaration, Prev_Sloc);
end if;
Set_Specification (Def_Node, Spec_Node);
if Token = Tok_Semicolon then
Scan; -- past ";"
elsif Token = Tok_Box then
Set_Box_Present (Def_Node, True);
Scan; -- past <>
T_Semicolon;
elsif Token = Tok_Null then
if Ada_Version < Ada_05 then
Error_Msg_SP
("null default subprograms are an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
if Nkind (Spec_Node) = N_Procedure_Specification then
Set_Null_Present (Spec_Node);
else
Error_Msg_SP ("only procedures can be null");
end if;
Scan; -- past NULL
T_Semicolon;
else
Set_Default_Name (Def_Node, P_Name);
T_Semicolon;
end if;
else
Def_Node :=
New_Node (N_Formal_Concrete_Subprogram_Declaration, Prev_Sloc);
Set_Specification (Def_Node, Spec_Node);
T_Semicolon;
end if;
return Def_Node;
end P_Formal_Subprogram_Declaration;
------------------------------
-- 12.6 Subprogram Default --
------------------------------
-- Parsed by P_Formal_Procedure_Declaration (12.6)
------------------------
-- 12.6 Default Name --
------------------------
-- Parsed by P_Formal_Procedure_Declaration (12.6)
--------------------------------------
-- 12.7 Formal Package Declaration --
--------------------------------------
-- FORMAL_PACKAGE_DECLARATION ::=
-- with package DEFINING_IDENTIFIER
-- is new generic_package_NAME FORMAL_PACKAGE_ACTUAL_PART;
-- FORMAL_PACKAGE_ACTUAL_PART ::=
-- (<>) | [GENERIC_ACTUAL_PART]
-- The caller has checked that the initial tokens are WITH PACKAGE,
-- and the initial WITH has been scanned out (so Token = Tok_Package).
-- Error recovery: cannot raise Error_Resync
function P_Formal_Package_Declaration return Node_Id is
Def_Node : Node_Id;
Scan_State : Saved_Scan_State;
begin
Def_Node := New_Node (N_Formal_Package_Declaration, Prev_Token_Ptr);
Scan; -- past PACKAGE
Set_Defining_Identifier (Def_Node, P_Defining_Identifier (C_Is));
T_Is;
T_New;
Set_Name (Def_Node, P_Qualified_Simple_Name);
if Token = Tok_Left_Paren then
Save_Scan_State (Scan_State); -- at the left paren
Scan; -- past the left paren
if Token = Tok_Box then
Set_Box_Present (Def_Node, True);
Scan; -- past box
T_Right_Paren;
else
Restore_Scan_State (Scan_State); -- to the left paren
Set_Generic_Associations (Def_Node, P_Generic_Actual_Part_Opt);
end if;
end if;
T_Semicolon;
return Def_Node;
end P_Formal_Package_Declaration;
--------------------------------------
-- 12.7 Formal Package Actual Part --
--------------------------------------
-- Parsed by P_Formal_Package_Declaration (12.7)
end Ch12;
|
programs/oeis/037/A037314.asm | jmorken/loda | 1 | 85827 | <reponame>jmorken/loda
; A037314: Numbers n such that (sum of base-3 digits of n) = (sum of base-9 digits of n).
; 0,1,2,9,10,11,18,19,20,81,82,83,90,91,92,99,100,101,162,163,164,171,172,173,180,181,182,729,730,731,738,739,740,747,748,749,810,811,812,819,820,821,828,829,830,891,892,893,900,901,902,909,910,911
mov $20,$0
add $20,1
lpb $20
clr $0,18
sub $20,1
sub $0,$20
lpb $0
gcd $0,81
lpb $0
pow $0,2
mul $0,9
mov $4,$0
lpb $0
trn $0,2
lpe
lpe
add $1,$4
lpe
div $1,8
mul $1,2
add $1,1
add $19,$1
lpe
mov $1,$19
div $1,3
|
src/Holes/Cong/Propositional.agda | bch29/agda-holes | 24 | 11177 | <reponame>bch29/agda-holes
{-
Holey congruence for propositional equality.
-}
module Holes.Cong.Propositional where
open import Holes.Prelude
open PropEq using (_≡_; refl; cong; sym; trans)
import Holes.Cong.General as Cong
open Cong (quote cong) (quote sym) public
using (cong!)
|
src/fot/FOTC/Program/McCarthy91/ArithmeticATP.agda | asr/fotc | 11 | 14526 | ------------------------------------------------------------------------------
-- Arithmetic properties used by the McCarthy 91 function
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module FOTC.Program.McCarthy91.ArithmeticATP where
open import FOTC.Base
open import FOTC.Data.Nat
open import FOTC.Data.Nat.Inequalities
open import FOTC.Data.Nat.Inequalities.PropertiesATP
using ( x≤y+x∸y
; x≤y→x≯y
; x≤y→x+k≤y+k
)
open import FOTC.Data.Nat.PropertiesATP
using ( +-N
; ∸-N
; +-comm
; [x+Sy]∸y≡Sx
)
open import FOTC.Data.Nat.UnaryNumbers
open import FOTC.Data.Nat.UnaryNumbers.TotalityATP
using ( 10-N
; 11-N
; 89-N
; 100-N
)
------------------------------------------------------------------------------
postulate 91≡100+11∸10∸10 : 91' ≡ 100' + 11' ∸ 10' ∸ 10'
{-# ATP prove 91≡100+11∸10∸10 #-}
postulate
100≡89+11 : 100' ≡ 89' + 11'
101≡90+11 : 101' ≡ 90' + 11'
102≡91+11 : 102' ≡ 91' + 11'
103≡92+11 : 103' ≡ 92' + 11'
104≡93+11 : 104' ≡ 93' + 11'
105≡94+11 : 105' ≡ 94' + 11'
106≡95+11 : 106' ≡ 95' + 11'
107≡96+11 : 107' ≡ 96' + 11'
108≡97+11 : 108' ≡ 97' + 11'
109≡98+11 : 109' ≡ 98' + 11'
110≡99+11 : 110' ≡ 99' + 11'
111≡100+11 : 111' ≡ 100' + 11'
{-# ATP prove 100≡89+11 #-}
{-# ATP prove 101≡90+11 #-}
{-# ATP prove 102≡91+11 #-}
{-# ATP prove 103≡92+11 #-}
{-# ATP prove 104≡93+11 #-}
{-# ATP prove 105≡94+11 #-}
{-# ATP prove 106≡95+11 #-}
{-# ATP prove 107≡96+11 #-}
{-# ATP prove 108≡97+11 #-}
{-# ATP prove 109≡98+11 #-}
{-# ATP prove 110≡99+11 #-}
{-# ATP prove 111≡100+11 #-}
postulate 101≡100+11∸10 : 101' ≡ 100' + 11' ∸ 10'
{-# ATP prove 101≡100+11∸10 #-}
postulate
100+11∸10>100 : 100' + 11' ∸ 10' > 100'
100+11>100 : 100' + 11' > 100'
{-# ATP prove 100+11∸10>100 101≡100+11∸10 #-}
{-# ATP prove 100+11>100 111≡100+11 #-}
postulate
99+11>100 : 99' + 11' > 100'
98+11>100 : 98' + 11' > 100'
97+11>100 : 97' + 11' > 100'
96+11>100 : 96' + 11' > 100'
95+11>100 : 95' + 11' > 100'
94+11>100 : 94' + 11' > 100'
93+11>100 : 93' + 11' > 100'
92+11>100 : 92' + 11' > 100'
91+11>100 : 91' + 11' > 100'
90+11>100 : 90' + 11' > 100'
{-# ATP prove 99+11>100 110≡99+11 #-}
{-# ATP prove 98+11>100 109≡98+11 #-}
{-# ATP prove 97+11>100 108≡97+11 #-}
{-# ATP prove 96+11>100 107≡96+11 #-}
{-# ATP prove 95+11>100 106≡95+11 #-}
{-# ATP prove 94+11>100 105≡94+11 #-}
{-# ATP prove 93+11>100 104≡93+11 #-}
{-# ATP prove 92+11>100 103≡92+11 #-}
{-# ATP prove 91+11>100 102≡91+11 #-}
{-# ATP prove 90+11>100 101≡90+11 #-}
x+11-N : ∀ {n} → N n → N (n + 11')
x+11-N Nn = +-N Nn 11-N
x+11∸10≡Sx : ∀ {n} → N n → n + 11' ∸ 10' ≡ succ₁ n
x+11∸10≡Sx Nn = [x+Sy]∸y≡Sx Nn 10-N
postulate x+1≤x∸10+11 : ∀ {n} → N n → n + 1' ≤ (n ∸ 10') + 11'
{-# ATP prove x+1≤x∸10+11 x≤y+x∸y 10-N 11-N +-N ∸-N +-comm #-}
postulate x≤89→x+11≯100 : ∀ {n} → N n → n ≤ 89' → n + 11' ≯ 100'
{-# ATP prove x≤89→x+11≯100 x≤y→x≯y x≤y→x+k≤y+k x+11-N 89-N 100-N 100≡89+11 #-}
|
test/Succeed/TypeInTypeAndUnivPoly.agda | cruhland/agda | 1,989 | 16192 | {-# OPTIONS --type-in-type #-}
module TypeInTypeAndUnivPoly where
open import UniversePolymorphism
-- The level metas should be solved with 0 when we have --type-in-type
fst′ : ∀ {A B} → Σ A B → A
fst′ x = fst x
|
fdfparser/antlr-src/FDF.g4 | Grimgrents2/WarsmashModEngine | 23 | 4038 | /**
* Define a grammar called FDF
*/
grammar FDF;
@header {
package com.etheller.warsmash.fdfparser;
}
program :
(statement)*
;
statement:
STRING_LIST OPEN_CURLY (ID STRING_LITERAL COMMA)*? CLOSE_CURLY # StringListStatement
|
INCLUDE_FILE STRING_LITERAL COMMA # IncludeStatement
|
frame # FrameStatement
;
frame:
frame_type_qualifier OPEN_CURLY frame_element* CLOSE_CURLY # AnonymousCompDefinition
|
frame_type_qualifier INHERITS STRING_LITERAL OPEN_CURLY frame_element* CLOSE_CURLY # AnonymousCompSubTypeDefinition
|
frame_type_qualifier INHERITS WITHCHILDREN STRING_LITERAL OPEN_CURLY frame_element* CLOSE_CURLY # AnonymousCompSubTypeDefinitionWithChildren
|
frame_type_qualifier STRING_LITERAL OPEN_CURLY frame_element* CLOSE_CURLY # CompDefinition
|
frame_type_qualifier STRING_LITERAL INHERITS STRING_LITERAL OPEN_CURLY frame_element* CLOSE_CURLY # CompSubTypeDefinition
|
frame_type_qualifier STRING_LITERAL INHERITS WITHCHILDREN STRING_LITERAL OPEN_CURLY frame_element* CLOSE_CURLY # CompSubTypeDefinitionWithChildren
|
FRAME STRING_LITERAL STRING_LITERAL OPEN_CURLY frame_element* CLOSE_CURLY # FrameDefinition
|
FRAME STRING_LITERAL STRING_LITERAL INHERITS STRING_LITERAL OPEN_CURLY frame_element* CLOSE_CURLY # FrameSubTypeDefinition
|
FRAME STRING_LITERAL STRING_LITERAL INHERITS WITHCHILDREN STRING_LITERAL OPEN_CURLY frame_element* CLOSE_CURLY # FrameSubTypeDefinitionWithChildren
;
frame_element:
frame # FrameFrameElement
|
ID FLOAT COMMA # FloatElement
|
ID STRING_LITERAL COMMA # StringElement
|
ID STRING_LITERAL STRING_LITERAL COMMA # StringPairElement
|
ID FLOAT FLOAT COMMA # Vector2Element
|
ID COMMA # FlagElement
|
ID FLOAT FLOAT FLOAT FLOAT COMMA # Vector4Element
|
ID FLOAT COMMA FLOAT COMMA FLOAT COMMA FLOAT COMMA # Vector4CommaElement
|
SETPOINT frame_point COMMA STRING_LITERAL COMMA frame_point COMMA FLOAT COMMA FLOAT COMMA # SetPointElement
|
ANCHOR frame_point COMMA FLOAT COMMA FLOAT COMMA # AnchorElement
|
ID STRING_LITERAL COMMA FLOAT COMMA STRING_LITERAL COMMA # FontElement
|
ID FLOAT FLOAT FLOAT COMMA # Vector3Element
|
ID text_justify COMMA # TextJustifyElement
|
ID STRING_LITERAL COMMA FLOAT COMMA # SimpleFontElement
;
text_justify:
JUSTIFYTOP | JUSTIFYMIDDLE | JUSTIFYBOTTOM | JUSTIFYLEFT | JUSTIFYCENTER | JUSTIFYRIGHT;
frame_point:
FRAMEPOINT_TOPLEFT
| FRAMEPOINT_TOP
| FRAMEPOINT_TOPRIGHT
| FRAMEPOINT_LEFT
| FRAMEPOINT_CENTER
| FRAMEPOINT_RIGHT
| FRAMEPOINT_BOTTOMLEFT
| FRAMEPOINT_BOTTOM
| FRAMEPOINT_BOTTOMRIGHT;
color:
FLOAT FLOAT FLOAT
|
FLOAT FLOAT FLOAT FLOAT
;
frame_type_qualifier:
STRING
|
TEXTURE
|
LAYER
;
OPEN_CURLY : '{';
CLOSE_CURLY : '}';
STRING_LIST : 'StringList' ;
INCLUDE_FILE : 'IncludeFile' ;
FRAME : 'Frame' ;
STRING : 'String' ;
TEXTURE : 'Texture' ;
LAYER : 'Layer' ;
INHERITS : 'INHERITS' ;
WITHCHILDREN : 'WITHCHILDREN' ;
SETPOINT : 'SetPoint';
ANCHOR : 'Anchor';
JUSTIFYTOP : 'JUSTIFYTOP';
JUSTIFYMIDDLE : 'JUSTIFYMIDDLE';
JUSTIFYBOTTOM : 'JUSTIFYBOTTOM';
JUSTIFYLEFT : 'JUSTIFYLEFT';
JUSTIFYCENTER : 'JUSTIFYCENTER';
JUSTIFYRIGHT : 'JUSTIFYRIGHT';
FRAMEPOINT_TOPLEFT : 'TOPLEFT';
FRAMEPOINT_TOP : 'TOP';
FRAMEPOINT_TOPRIGHT : 'TOPRIGHT';
FRAMEPOINT_LEFT : 'LEFT';
FRAMEPOINT_CENTER : 'CENTER';
FRAMEPOINT_RIGHT : 'RIGHT';
FRAMEPOINT_BOTTOMLEFT : 'BOTTOMLEFT';
FRAMEPOINT_BOTTOM : 'BOTTOM';
FRAMEPOINT_BOTTOMRIGHT : 'BOTTOMRIGHT';
ID : ([a-zA-Z_][a-zA-Z_0-9]*) ;
COMMA : ',';
STRING_LITERAL : ('"'.*?'"');
WS : [ \t\r\n]+ -> skip ;
FLOAT : '-'?([0]|([1-9][0-9]*))('.'([0-9]*)?)?'f'? ;
MULTI_LINE_COMMENT : '/*'.*?'*/' -> skip ;
COMMENT : '//'.*?'\n' -> skip ;
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c99004a.ada | best08618/asylo | 7 | 18373 | <filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c99004a.ada
-- C99004A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT THE PREFIX OF 'TERMINATED AND 'CALLABLE CAN BE A
-- FUNCTION CALL RETURNING AN OBJECT HAVING A TASK TYPE.
-- NOTE: SEE TEST C38202A FOR CHECKS INVOLVING PREFIXES WHICH ARE
-- ACCESS TYPES DENOTING TASK TYPES OR WHICH ARE FUNCTIONS
-- RETURNING ACCESS TYPES DENOTING TASK TYPES.
-- HISTORY:
-- RJW 09/16/86 CREATED ORIGINAL TEST.
-- DHH 10/15/87 CORRECTED HEADER COMMENTS.
with Impdef;
WITH REPORT; USE REPORT;
PROCEDURE C99004A IS
TYPE ENUM IS (A, B, C, D);
EARRAY : ARRAY (ENUM) OF STRING (1 .. 17) :=
(A => "BEFORE ACTIVATION",
B => "DURING ACTIVATION",
C => "DURING EXECUTION ",
D => "AFTER TERMINATION" );
FUNCTION CHECK (S : STRING; CALL, B1, TERM, B2 : BOOLEAN;
E : ENUM) RETURN BOOLEAN IS
BEGIN
IF CALL /= B1 THEN
FAILED ( "INCORRECT VALUE FOR " & S & "'CALLABLE " &
EARRAY (E) & " OF TASK" );
END IF;
IF TERM /= B2 THEN
FAILED ( "INCORRECT VALUE FOR " & S & "'TERMINATED " &
EARRAY (E) & " OF TASK" );
END IF;
RETURN IDENT_BOOL (TRUE);
END CHECK;
BEGIN
TEST ( "C99004A", "CHECK THAT THE PREFIX OF 'TERMINATED AND " &
"'CALLABLE CAN BE A FUNCTION CALL RETURNING " &
"AN OBJECT HAVING A TASK TYPE" );
DECLARE
TASK TYPE TT IS
ENTRY E;
END TT;
PACKAGE PKG1 IS
T1 : TT;
END PKG1;
FUNCTION F RETURN TT IS
BEGIN
RETURN PKG1.T1;
END F;
PACKAGE PKG2 IS
A1 : BOOLEAN := CHECK ("F", F'CALLABLE, TRUE,
F'TERMINATED, FALSE, A);
END PKG2;
TASK MAIN_TASK IS
ENTRY E (INTEGER RANGE 1 .. 2);
END MAIN_TASK;
TASK BODY TT IS
B1 : BOOLEAN := CHECK ("F", F'CALLABLE, TRUE,
F'TERMINATED, FALSE, B);
C1 : BOOLEAN;
BEGIN
C1 := CHECK ("F", F'CALLABLE, TRUE,
F'TERMINATED, FALSE, C);
MAIN_TASK.E (1);
MAIN_TASK.E (2);
END TT;
PACKAGE BODY PKG1 IS
BEGIN
NULL;
END;
TASK BODY MAIN_TASK IS
D1 : BOOLEAN;
BEGIN
ACCEPT E (1);
ABORT PKG1.T1;
DELAY 5.0 * Impdef.One_Long_Second;
D1 := CHECK ("F", F'CALLABLE, FALSE,
F'TERMINATED, TRUE, D);
END MAIN_TASK;
BEGIN
NULL;
END;
DECLARE
TASK TYPE TT IS
ENTRY E;
END TT;
T2 : TT;
A2 : BOOLEAN := CHECK ("T2", T2'CALLABLE, TRUE,
T2'TERMINATED, FALSE, A);
TASK MAIN_TASK IS
ENTRY E (INTEGER RANGE 1 .. 2);
END MAIN_TASK;
TASK BODY TT IS
B2 : BOOLEAN := CHECK ("T2", T2'CALLABLE, TRUE,
T2'TERMINATED, FALSE, B);
C2 : BOOLEAN;
BEGIN
C2 := CHECK ("T2", T2'CALLABLE, TRUE,
T2'TERMINATED, FALSE, C);
MAIN_TASK.E (1);
MAIN_TASK.E (2);
END TT;
TASK BODY MAIN_TASK IS
D2 : BOOLEAN;
BEGIN
ACCEPT E (1);
ABORT T2;
DELAY 5.0 * Impdef.One_Long_Second;
D2 := CHECK ("T2", T2'CALLABLE, FALSE,
T2'TERMINATED, TRUE, D);
END MAIN_TASK;
BEGIN
NULL;
END;
RESULT;
END C99004A;
|
programs/oeis/288/A288707.asm | jmorken/loda | 1 | 88228 | <reponame>jmorken/loda
; A288707: 0-limiting word of the mapping 00->1000, 10->00, starting with 00.
; 0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0
mov $3,2
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
add $0,$3
sub $0,1
div $0,2
cal $0,189663 ; Partial sums of A189661.
mov $2,$3
mov $4,$0
mul $4,2
mov $6,$4
lpb $2
mov $1,$6
sub $2,1
lpe
lpe
lpb $5
sub $1,$6
mov $5,0
lpe
div $1,2
|
programs/oeis/048/A048058.asm | neoneye/loda | 22 | 101636 | <reponame>neoneye/loda
; A048058: a(n) = n^2 + n + 11.
; 11,13,17,23,31,41,53,67,83,101,121,143,167,193,221,251,283,317,353,391,431,473,517,563,611,661,713,767,823,881,941,1003,1067,1133,1201,1271,1343,1417,1493,1571,1651,1733,1817,1903,1991,2081,2173,2267,2363,2461,2561,2663,2767,2873,2981,3091,3203,3317,3433,3551,3671,3793,3917,4043,4171,4301,4433,4567,4703,4841,4981,5123,5267,5413,5561,5711,5863,6017,6173,6331,6491,6653,6817,6983,7151,7321,7493,7667,7843,8021,8201,8383,8567,8753,8941,9131,9323,9517,9713,9911
mov $1,$0
add $0,1
mul $0,$1
add $0,11
|
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_434.asm | ljhsiun2/medusa | 9 | 92490 | <filename>Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_434.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %r8
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x174b3, %rdi
nop
nop
dec %r13
mov (%rdi), %ebp
nop
nop
cmp %rsi, %rsi
lea addresses_normal_ht+0x12b83, %r11
nop
sub $55264, %r10
vmovups (%r11), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %r8
sub $22981, %rdi
lea addresses_A_ht+0x17ee3, %rsi
nop
nop
nop
nop
xor $25775, %r13
mov $0x6162636465666768, %rbp
movq %rbp, %xmm3
movups %xmm3, (%rsi)
nop
nop
inc %r13
lea addresses_normal_ht+0x1a573, %rbp
inc %rsi
movl $0x61626364, (%rbp)
nop
nop
nop
sub %r11, %r11
lea addresses_WC_ht+0x12fa3, %rdi
nop
inc %r11
movl $0x61626364, (%rdi)
and $32003, %rbp
lea addresses_WC_ht+0x1b943, %r13
dec %r11
mov (%r13), %r10
nop
nop
nop
inc %rbp
lea addresses_D_ht+0x16d4e, %rsi
lea addresses_UC_ht+0x8480, %rdi
nop
nop
cmp %rbp, %rbp
mov $124, %rcx
rep movsb
nop
nop
nop
and %r11, %r11
lea addresses_WT_ht+0x1ef6d, %rdi
nop
nop
nop
and $39627, %r10
movb $0x61, (%rdi)
nop
nop
nop
and %r11, %r11
lea addresses_UC_ht+0x15d43, %rsi
lea addresses_WT_ht+0x16b0b, %rdi
xor $5175, %r13
mov $110, %rcx
rep movsq
nop
nop
cmp %rsi, %rsi
lea addresses_normal_ht+0x11193, %rcx
nop
nop
nop
nop
cmp %r8, %r8
movl $0x61626364, (%rcx)
nop
nop
nop
nop
nop
xor $57877, %rdi
lea addresses_D_ht+0x65c3, %r13
clflush (%r13)
nop
cmp $21251, %rbp
mov (%r13), %si
nop
nop
nop
nop
nop
xor %r10, %r10
lea addresses_WT_ht+0x10a83, %r11
xor $40833, %r13
mov $0x6162636465666768, %rbp
movq %rbp, (%r11)
nop
nop
nop
nop
nop
sub $11958, %rcx
lea addresses_normal_ht+0x992b, %rcx
sub %rdi, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm4
movups %xmm4, (%rcx)
and $50127, %rbp
lea addresses_A_ht+0x18033, %rdi
nop
inc %rbp
mov $0x6162636465666768, %rcx
movq %rcx, %xmm3
movups %xmm3, (%rdi)
nop
nop
nop
and %r11, %r11
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %r9
push %rcx
push %rdx
push %rsi
// Store
lea addresses_PSE+0xf0c3, %rcx
nop
nop
nop
nop
dec %r15
movb $0x51, (%rcx)
nop
nop
xor $23569, %r15
// Faulty Load
lea addresses_WC+0xf143, %r15
nop
nop
nop
nop
nop
cmp $42951, %rsi
mov (%r15), %rdx
lea oracles, %rcx
and $0xff, %rdx
shlq $12, %rdx
mov (%rcx,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rcx
pop %r9
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 2, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 4, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 7, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 6, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
bsp/wire.ads | yannickmoy/SPARKZumo | 6 | 19915 | <filename>bsp/wire.ads
pragma SPARK_Mode;
with Types; use Types;
with Interfaces; use Interfaces;
-- @summary
-- Interface to Arduino Wire library
--
-- @description
-- Provides an interface to the Arudino Wire library. This is used for
-- I2C busses.
--
package Wire is
-- Return result of a transmission
-- @value Success success
-- @value Data_Too_Long data too long to fit in transmit buffer
-- @value Rx_NACK_Addr received NACK on transmit of address
-- @value Rx_NACK_Data received NACK on transmit of data
-- @value Other_Err other error
type Transmission_Status_Index is
(Success, Data_Too_Long, Rx_NACK_Addr, Rx_NACK_Data, Other_Err);
Transmission_Status : array (Transmission_Status_Index) of Byte :=
(Success => 0,
Data_Too_Long => 1,
Rx_NACK_Addr => 2,
Rx_NACK_Data => 3,
Other_Err => 4);
-- Translates a Byte to Transmission_Status_Index
-- @param BB the byte to cast
-- @return the Transmission_Status_Index corresponding to the value in BB
function Byte2TSI (BB : Byte)
return Transmission_Status_Index;
-- Initiate the Wire library and join the I2C bus as a master.
procedure Init_Master
with Global => null;
pragma Import (C, Init_Master, "Wire_Begin_Master");
-- Initiate the Wire library and join the I2C bus as a slave
-- @param Addr the 7-bit slave address
procedure Init_Slave (Addr : Byte)
with Global => null;
pragma Import (C, Init_Slave, "Wire_Begin_Slave");
-- This function modifies the clock frequency for I2C communication.
-- @param Freq the value (in Hertz) of desired communication clock
procedure SetClock (Freq : Unsigned_32)
with Global => null;
pragma Import (C, SetClock, "Wire_SetClock");
-- Read a byte from the Reg register on the device at Addr
-- @param Addr the address of the device to access
-- @param Reg the register to access on the device
-- @return the Byte read from the device
function Read_Byte (Addr : Byte;
Reg : Byte)
return Byte;
-- Read multiple bytes from the device at Addr start at register Reg
-- @param Addr the address of the device to access
-- @param Reg the starting register to access on the device
-- @param Data an array of Bytes read from the registers
procedure Read_Bytes (Addr : Byte;
Reg : Byte;
Data : out Byte_Array)
with Global => Transmission_Status,
Pre => (Data'Length > 0);
pragma Annotate (GNATprove,
False_Positive,
"""Data"" might not be initialized",
String'("Data is properly initialized by this loop"));
-- Write a byte to the register Reg on the device at Addr
-- @param Addr the address of the device to write to
-- @param Reg the register to write to on the device
-- @param Data the data to write to the device
-- @return the status of the write transaction
function Write_Byte (Addr : Byte;
Reg : Byte;
Data : Byte)
return Transmission_Status_Index;
private
-- Used by the master to request bytes from a slave device.
-- Ada wrapper around imported RequestFrom_C
-- @param Addr the 7-bit address of the device to request bytes from
-- @param Quant the number of bytes to request
-- @param Stop true will send a stop message after the request, releasing
-- the bus. false will continually send a restart after the request,
-- keeping the connection active.
-- @return the number of bytes returned from the slave device
function RequestFrom (Addr : Byte;
Quant : Byte;
Stop : Boolean)
return Byte;
-- See documentation for RequestFrom
function RequestFrom_C (Addr : Byte;
Quant : Byte;
Stop : Byte)
return Byte
with Global => null;
pragma Import (C, RequestFrom_C, "Wire_RequestFrom");
-- Begin a transmission to the I2C slave device with the given address
-- @param Addr the 7-bit address of the device to transmit to
procedure BeginTransmission (Addr : Byte)
with Global => null;
pragma Import (C, BeginTransmission, "Wire_BeginTransmission");
-- Ends a transmission to a slave device that was begun by
-- BeginTransmission () and transmits the bytes that were queued
-- by write (). Ada wrapper around EndTransmission_C
-- @param Stop true will send a stop message, releasing the bus after
-- transmission. false will send a restart, keeping the connection active
-- @return byte, which indicates the status of the transmission
function EndTransmission (Stop : Boolean) return Byte;
-- See documentation for EndTransmission
function EndTransmission_C (Stop : Byte) return Byte
with Global => null;
pragma Import (C, EndTransmission_C, "Wire_EndTransmission");
-- Queues bytes for transmission from a master to slave device
-- @param Val a value to send as a single byte
-- @return will return the number of bytes written
function Write_Value (Val : Byte) return Byte
with Global => null;
pragma Import (C, Write_Value, "Wire_Write_Value");
-- Returns the number of bytes available for retrieval with read()
-- @return The number of bytes available for reading.
function Available return Integer
with Global => null;
pragma Import (C, Available, "Wire_Available");
-- Reads a byte that was transmitted from a slave device to a master
-- @return The next byte received
function Read return Byte
with Global => null;
pragma Import (C, Read, "Wire_Read");
end Wire;
|
nicolai/thesis/Weakly_Constant_Functions.agda | nicolaikraus/HoTT-Agda | 1 | 9040 | <filename>nicolai/thesis/Weakly_Constant_Functions.agda
{-# OPTIONS --without-K #-}
open import lib.Basics hiding (_⊔_)
open import lib.types.Sigma
open import lib.NType2
open import Preliminaries
open import Truncation_Level_Criteria
open import Anonymous_Existence_CollSplit
open wtrunc
open with-weak-trunc
module Weakly_Constant_Functions where
-- Definition 5.1.1
factorizes-through : ∀ {i j} {X : Type i} {Y : Type j} → Type i → (X → Y) → Type (i ⊔ j)
factorizes-through {X = X} {Y = Y} Z f = Σ (X → Z) λ f₁ → Σ (Z → Y) λ f₂ → (x : X) → f₂ (f₁ x) == f x
-- Definition 5.1.1 addendum: 'factorizes through the truncation'
-- In the theory of the thesis, universes are cumulative.
-- Here, we ask all the types to be in the same universe.
factorizes : ∀ {i} {X : Type i} {Y : Type i} → (X → Y) → Type i
factorizes {X = X} = factorizes-through (∣∣ X ∣∣)
-- Principle 5.2.1
factorize-helper : ∀ {i} {X : Type i} {Y : Type i} → (f : X → Y) → (P : Type i) → (X → is-prop P) → (factorizes-through P f) → factorizes f
factorize-helper {X = X} {Y = Y} f P xpp (f₁ , f₂ , q) = f₁' , f₂' , q' where
f₁' : X → ∣∣ X ∣∣
f₁' = ∣_∣
f₂' : ∣∣ X ∣∣ → Y
f₂' z = f₂ (tr-rec {X = X} (tr-rec is-prop-is-prop xpp z) f₁ z)
q' : (x : X) → f₂' (f₁' x) == f x
q' x =
f₂' (f₁' x) =⟨ idp ⟩
f₂' ∣ x ∣ =⟨ idp ⟩
f₂ (tr-rec _ f₁ ∣ x ∣ ) =⟨ ap f₂ (trunc-β _ f₁ x) ⟩
f₂ (f₁ x) =⟨ q x ⟩
f x ∎
-- Proposition 5.2.2
module st522 {i : ULevel} {X : Type i} {Y : Type i} (f : X → Y) (c : const f) where
One = ¬ X
Two = X
Three = ∣∣ X ∣∣ → X
Four = coll X
Five = Y → X
One→Three : One → Three
One→Three nx z = Empty-elim {P = λ _ → X} (tr-rec Empty-elim nx z)
Two→Three : Two → Three
Two→Three x = λ _ → x
Five→Four : Five → Four
Five→Four g = g ∘ f , (λ x₁ x₂ → ap g (c x₁ x₂))
Three↔Four : Three ↔ Four
Three↔Four = snd coll↔splitSup , fst coll↔splitSup
Three→factorizes : Three → factorizes f
Three→factorizes s = ∣_∣ , f ∘ s , (λ x → c _ _)
-- Proposition 5.2.3 preparation
-- as a small preparation, let us define a function that applies the truncation tr-recursor twice.
-- Because of how we have defined the operator ∣∣_∣∣, we need everything to happen in the same universe
double-tr-rec : ∀ {i} {X₁ X₂ P : Type i} → (is-prop P) → (X₁ → X₂ → P) → ∣∣ X₁ ∣∣ → ∣∣ X₂ ∣∣ → P
double-tr-rec {i} {X₁} {X₂} {P} pp f z₁ z₂ = next-step z₁ z₂ where
step : X₁ → ∣∣ X₂ ∣∣ → P
step x₁ = tr-rec {X = X₂} {P = P} pp (f x₁)
step-switch : ∣∣ X₂ ∣∣ → X₁ → P
step-switch z₂ x₁ = step x₁ z₂
next-step : ∣∣ X₁ ∣∣ → ∣∣ X₂ ∣∣ → P
next-step z₁ z₂ = tr-rec pp (step-switch z₂) z₁ -- tr-rec pp (step-switch z₂)
-- now, the actual Proposition 5.2.3
factorize-codomain-set : ∀ {i} {X : Type i} {Y : Type i} → (f : X → Y) → const f → is-set Y → factorizes f
factorize-codomain-set {i} {X} {Y} f c h = factorize-helper f P (λ _ → pp) fact-through-p where
P : Type i
P = Σ Y λ y → ∣∣ (Σ X λ x → f x == y) ∣∣
pp : is-prop P
pp = all-paths-is-prop all-paths where
all-paths : has-all-paths P
all-paths (y₁ , t₁) (y₂ , t₂) = pair= ys ts where
ys = double-tr-rec {P = y₁ == y₂} (h _ _) (λ {(x₁ , p₁) (x₂ , p₂) → ! p₁ ∙ c _ _ ∙ p₂}) t₁ t₂
ts = from-transp _ ys (prop-has-all-paths tr-is-prop _ _)
fact-through-p : factorizes-through P f
fact-through-p = f₁ , f₂ , q where
f₁ : X → P
f₁ x = f x , ∣ x , idp ∣
f₂ : P → Y
f₂ = fst
q : (x : X) → f₂ (f₁ x) == f x
q x = idp
-- Theorem 5.2.6
-- We need function extensionality and thus import
-- the following:
open import lib.types.Pi
-- A general auxiliary function which switches the second
-- and third component of a Σ-type with four components
-- (provided that it is possible).
-- We formulate this explicitly as we will need it several times:
switch23 : ∀ {i} {X : Type i} → {Y Z : X → Type i} → {W : (x : X) → (Y x) → (Z x) → Type i} →
(Σ X λ x → Σ (Y x) λ y → Σ (Z x) λ z → (W x y z)) ≃
(Σ X λ x → Σ (Z x) λ z → Σ (Y x) λ y → (W x y z))
switch23 = equiv (λ {(y , s , t , coh) → (y , t , s , coh)}) (λ {(y , t , s , coh) → (y , s , t , coh)}) (λ _ → idp) (λ _ → idp)
-- Theorem 5.2.6, with the 'equivalence reasoning' tactic:
module thm526 {i : ULevel} {Q R Y : Type i} (qq : is-prop Q) (rr : is-prop R) (f : Coprod Q R → Y) (c : const f) where
P : Type i
P = Σ Y λ y →
Σ ((q : Q) → y == f(inl q)) λ s →
Σ ((r : R) → y == f(inr r)) λ t →
(q : Q) → (r : R) → ! (s q) ∙ (t r) == c (inl q) (inr r)
-- This is going to be tedious: if q₀ : Q is given, we can show that P is equivalent to the Unit type.
given-q-reduce-P : Q → P ≃ Unit
given-q-reduce-P q₀ =
P
≃⟨ switch23 ⟩
(Σ Y λ y →
Σ ((r : R) → y == f(inr r)) λ t →
Σ ((q : Q) → y == f(inl q)) λ s →
(q : Q) → (r : R) → ! (s q) ∙ (t r) == c (inl q) (inr r))
≃⟨ equiv-Σ-snd (λ y → equiv-Σ-snd (λ t → choice ⁻¹)) ⟩
(Σ Y λ y →
Σ ((r : R) → y == f(inr r)) λ t →
(q : Q) → Σ (y == f(inl q)) λ s-reduced →
(r : R) → ! s-reduced ∙ (t r) == c (inl q) (inr r))
≃⟨ equiv-Σ-snd (λ y → equiv-Σ-snd (λ t → Π₁-contr (q₀ , prop-has-all-paths qq q₀))) ⟩
(Σ Y λ y →
Σ ((r : R) → y == f(inr r)) λ t →
Σ (y == f(inl q₀)) λ s-reduced →
(r : R) → ! s-reduced ∙ (t r) == c (inl q₀) (inr r))
≃⟨ switch23 ⟩
(Σ Y λ y →
Σ (y == f(inl q₀)) λ s-reduced →
Σ ((r : R) → y == f(inr r)) λ t →
(r : R) → ! s-reduced ∙ (t r) == c (inl q₀) (inr r))
≃⟨ equiv-Σ-snd (λ y → equiv-Σ-snd (λ t → choice ⁻¹)) ⟩
(Σ Y λ y →
Σ (y == f(inl q₀)) λ s-reduced →
(r : R) → Σ (y == f(inr r)) λ t-reduced →
! s-reduced ∙ t-reduced == c (inl q₀) (inr r))
≃⟨ Σ-assoc ⁻¹ ⟩
(Σ (Σ Y λ y → (y == f(inl q₀))) λ {(y , s-reduced) →
(r : R) → Σ (y == f(inr r)) λ t-reduced →
! s-reduced ∙ t-reduced == c (inl q₀) (inr r)})
≃⟨ Σ₁-contr (pathto-is-contr _) ⟩
((r : R) → Σ (f(inl q₀) == f(inr r)) λ t-reduced →
idp ∙ t-reduced == c (inl q₀) (inr r))
≃⟨ Π₂-contr (λ r → pathto-is-contr _) ⟩
Unit ≃∎
given-r-reduce-P : R → P ≃ Unit
given-r-reduce-P r₀ =
P
≃⟨ equiv-Σ-snd (λ _ → equiv-Σ-snd (λ _ → equiv-Σ-snd (λ _ → switch-args))) ⟩
(Σ Y λ y →
Σ ((q : Q) → y == f(inl q)) λ s →
Σ ((r : R) → y == f(inr r)) λ t →
(r : R) → (q : Q) → ! (s q) ∙ (t r) == c (inl q) (inr r))
≃⟨ equiv-Σ-snd (λ y → equiv-Σ-snd (λ s → choice ⁻¹)) ⟩
(Σ Y λ y →
Σ ((q : Q) → y == f(inl q)) λ s →
(r : R) → Σ (y == f(inr r)) λ t-reduced →
(q : Q) → ! (s q) ∙ t-reduced == c (inl q) (inr r))
≃⟨ equiv-Σ-snd (λ y → equiv-Σ-snd (λ t → Π₁-contr (r₀ , prop-has-all-paths rr r₀))) ⟩
(Σ Y λ y →
Σ ((q : Q) → y == f(inl q)) λ s →
Σ (y == f(inr r₀)) λ t-reduced →
(q : Q) → ! (s q) ∙ t-reduced == c (inl q) (inr r₀))
≃⟨ switch23 ⟩
(Σ Y λ y →
Σ (y == f(inr r₀)) λ t-reduced →
Σ ((q : Q) → y == f(inl q)) λ s →
(q : Q) → ! (s q) ∙ t-reduced == c (inl q) (inr r₀))
≃⟨ equiv-Σ-snd (λ y → equiv-Σ-snd (λ s → choice ⁻¹)) ⟩
(Σ Y λ y →
Σ (y == f(inr r₀)) λ t-reduced →
(q : Q) → Σ (y == f(inl q)) λ s-reduced →
! s-reduced ∙ t-reduced == c (inl q) (inr r₀))
≃⟨ Σ-assoc ⁻¹ ⟩
(Σ (Σ Y λ y → (y == f(inr r₀))) λ {(y , t-reduced) →
(q : Q) → Σ (y == f(inl q)) λ s-reduced →
! s-reduced ∙ t-reduced == c (inl q) (inr r₀)})
≃⟨ Σ₁-contr (pathto-is-contr _) ⟩
((q : Q) → Σ (f(inr r₀) == f(inl q)) λ s-reduced →
! s-reduced ∙ idp == c (inl q) (inr r₀))
≃⟨ equiv-Π-r (λ q → equiv-Σ-snd (λ proof →
! proof ∙ idp == c (inl q) (inr r₀) ≃⟨ delete-idp _ _ ⟩
! proof == c (inl q) (inr r₀) ≃⟨ reverse-paths _ _ ⟩
proof == ! (c (inl q) (inr r₀)) ≃∎
)) ⟩
((q : Q) → Σ (f(inr r₀) == f(inl q)) λ s-reduced →
s-reduced == ! (c (inl q) (inr r₀)))
≃⟨ Π₂-contr (λ q → pathto-is-contr _) ⟩
Unit ≃∎
given-q+r-reduce-P : Coprod Q R → P ≃ Unit
given-q+r-reduce-P (inl q) = given-q-reduce-P q
given-q+r-reduce-P (inr r) = given-r-reduce-P r
Q+R→P : Coprod Q R → P
Q+R→P x = <– (given-q+r-reduce-P x) _
P→Y : P → Y
P→Y = fst
open import lib.types.Unit
-- Finally : the statement of Theorem 5.2.6
factorize-f : factorizes f
factorize-f = factorize-helper f P (λ x → equiv-preserves-level ((given-q+r-reduce-P x) ⁻¹) Unit-is-prop) (Q+R→P , P→Y , proof) where
proof : (x : Coprod Q R) → P→Y (Q+R→P x) == f x
proof (inl q) = idp
proof (inr r) = idp
-- and Theorem 5.2.6 again (outside of a specialized module)
Theorem526 : ∀ {i} {Q R Y : Type i} → (is-prop Q) → (is-prop R) → (f : Coprod Q R → Y) → (const f) → factorizes f
Theorem526 = thm526.factorize-f
|
src/main/antlr/net/jackofalltrades/taterbot/command/BotCommandLexer.g4 | bradhandy/tater-bot | 0 | 306 | lexer grammar BotCommandLexer;
options {
language = Java;
}
@header {
package net.jackofalltrades.taterbot.command;
}
UNKNOWN_SYMBOLS: ~' ' ;
SPACE: ' ';
PREFIX: [Tt] [Aa] [Tt] [Ee] [Rr] [Bb] [Oo] [Tt];
// command names
HELP: [Hh] [Ee] [Ll] [Pp];
RECORD: [Rr] [Ee] [Cc] [Oo] [Rr] [Dd];
SERVICE: [Ss] [Ee] [Rr] [Vv] [Ii] [Cc] [Ee];
// record command actions.
START_ACTION: [Ss] [Tt] [Aa] [Rr] [Tt];
STOP_ACTION: [Ss] [Tt] [Oo] [Pp];
// service command actions.
DISABLE_ACTION: [Dd] [Ii] [Ss] [Aa] [Bb] [Ll] [Ee];
ENABLE_ACTION: [Ee] [Nn] [Aa] [Bb] [Ll] [Ee];
STATUS_ACTION: [Ss] [Tt] [Aa] [Tt] [Uu] [Ss];
LIST_ACTION: [Ll] [Ii] [Ss] [Tt];
// service types.
SNARK: [Ss] [Nn] [Aa] [Rr] [Kk];
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.