
_sh:     file format elf32-i386

Disassembly of section .text:

00000000 <nulterminate>:

// NUL-terminate all the counted strings.
struct cmd*
nulterminate(struct cmd *cmd)
{
       0:	55                   	push   %ebp
       1:	89 e5                	mov    %esp,%ebp
       3:	53                   	push   %ebx
       4:	83 ec 04             	sub    $0x4,%esp
       7:	8b 5d 08             	mov    0x8(%ebp),%ebx
  int i;
  struct backcmd *bcmd;
  struct execcmd *ecmd;
  struct listcmd *lcmd;
  struct pipecmd *pcmd;
  struct redircmd *rcmd;

  if(cmd == 0)
       a:	85 db                	test   %ebx,%ebx
       c:	74 05                	je     13 <nulterminate+0x13>
    return 0;
  
  switch(cmd->type){
       e:	83 3b 05             	cmpl   $0x5,(%ebx)
      11:	76 0d                	jbe    20 <nulterminate+0x20>
  case EXEC:
    ecmd = (struct execcmd*)cmd;
    for(i=0; ecmd->argv[i]; i++)
      *ecmd->eargv[i] = 0;
    break;

  case REDIR:
    rcmd = (struct redircmd*)cmd;
    nulterminate(rcmd->cmd);
    *rcmd->efile = 0;
    break;

  case PIPE:
    pcmd = (struct pipecmd*)cmd;
    nulterminate(pcmd->left);
    nulterminate(pcmd->right);
    break;
    
  case LIST:
    lcmd = (struct listcmd*)cmd;
    nulterminate(lcmd->left);
    nulterminate(lcmd->right);
    break;

  case BACK:
    bcmd = (struct backcmd*)cmd;
    nulterminate(bcmd->cmd);
    break;
  }
  return cmd;
}
      13:	5a                   	pop    %edx
      14:	89 d8                	mov    %ebx,%eax
      16:	5b                   	pop    %ebx
      17:	5d                   	pop    %ebp
      18:	c3                   	ret    
      19:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
      20:	8b 03                	mov    (%ebx),%eax
      22:	ff 24 85 7c 12 00 00 	jmp    *0x127c(,%eax,4)
      29:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
      30:	8b 43 04             	mov    0x4(%ebx),%eax
      33:	89 04 24             	mov    %eax,(%esp)
      36:	e8 c5 ff ff ff       	call   0 <nulterminate>
      3b:	8b 43 08             	mov    0x8(%ebx),%eax
      3e:	89 04 24             	mov    %eax,(%esp)
      41:	e8 ba ff ff ff       	call   0 <nulterminate>
      46:	89 d8                	mov    %ebx,%eax
      48:	5a                   	pop    %edx
      49:	5b                   	pop    %ebx
      4a:	5d                   	pop    %ebp
      4b:	c3                   	ret    
      4c:	8b 43 04             	mov    0x4(%ebx),%eax
      4f:	89 04 24             	mov    %eax,(%esp)
      52:	e8 a9 ff ff ff       	call   0 <nulterminate>
      57:	eb ba                	jmp    13 <nulterminate+0x13>
      59:	8b 43 04             	mov    0x4(%ebx),%eax
      5c:	85 c0                	test   %eax,%eax
      5e:	74 b3                	je     13 <nulterminate+0x13>
      60:	89 d9                	mov    %ebx,%ecx
      62:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
      69:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi
      70:	8b 41 2c             	mov    0x2c(%ecx),%eax
      73:	89 ca                	mov    %ecx,%edx
      75:	83 c1 04             	add    $0x4,%ecx
      78:	c6 00 00             	movb   $0x0,(%eax)
      7b:	8b 42 08             	mov    0x8(%edx),%eax
      7e:	85 c0                	test   %eax,%eax
      80:	75 ee                	jne    70 <nulterminate+0x70>
      82:	eb 8f                	jmp    13 <nulterminate+0x13>
      84:	8b 43 04             	mov    0x4(%ebx),%eax
      87:	89 04 24             	mov    %eax,(%esp)
      8a:	e8 71 ff ff ff       	call   0 <nulterminate>
      8f:	8b 43 0c             	mov    0xc(%ebx),%eax
      92:	c6 00 00             	movb   $0x0,(%eax)
      95:	e9 79 ff ff ff       	jmp    13 <nulterminate+0x13>
      9a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

000000a0 <peek>:
      a0:	55                   	push   %ebp
      a1:	89 e5                	mov    %esp,%ebp
      a3:	57                   	push   %edi
      a4:	56                   	push   %esi
      a5:	53                   	push   %ebx
      a6:	83 ec 0c             	sub    $0xc,%esp
      a9:	8b 7d 08             	mov    0x8(%ebp),%edi
      ac:	8b 55 0c             	mov    0xc(%ebp),%edx
      af:	8b 07                	mov    (%edi),%eax
      b1:	89 d6                	mov    %edx,%esi
      b3:	39 d0                	cmp    %edx,%eax
      b5:	89 c3                	mov    %eax,%ebx
      b7:	72 0c                	jb     c5 <peek+0x25>
      b9:	eb 21                	jmp    dc <peek+0x3c>
      bb:	90                   	nop    
      bc:	8d 74 26 00          	lea    0x0(%esi),%esi
      c0:	43                   	inc    %ebx
      c1:	39 f3                	cmp    %esi,%ebx
      c3:	74 17                	je     dc <peek+0x3c>
      c5:	0f be 03             	movsbl (%ebx),%eax
      c8:	c7 04 24 7c 13 00 00 	movl   $0x137c,(%esp)
      cf:	89 44 24 04          	mov    %eax,0x4(%esp)
      d3:	e8 d8 0b 00 00       	call   cb0 <strchr>
      d8:	85 c0                	test   %eax,%eax
      da:	75 e4                	jne    c0 <peek+0x20>
      dc:	89 1f                	mov    %ebx,(%edi)
      de:	31 d2                	xor    %edx,%edx
      e0:	0f b6 03             	movzbl (%ebx),%eax
      e3:	84 c0                	test   %al,%al
      e5:	74 19                	je     100 <peek+0x60>
      e7:	0f be c0             	movsbl %al,%eax
      ea:	89 44 24 04          	mov    %eax,0x4(%esp)
      ee:	8b 45 10             	mov    0x10(%ebp),%eax
      f1:	89 04 24             	mov    %eax,(%esp)
      f4:	e8 b7 0b 00 00       	call   cb0 <strchr>
      f9:	31 d2                	xor    %edx,%edx
      fb:	85 c0                	test   %eax,%eax
      fd:	0f 95 c2             	setne  %dl
     100:	83 c4 0c             	add    $0xc,%esp
     103:	89 d0                	mov    %edx,%eax
     105:	5b                   	pop    %ebx
     106:	5e                   	pop    %esi
     107:	5f                   	pop    %edi
     108:	5d                   	pop    %ebp
     109:	c3                   	ret    
     10a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

00000110 <gettoken>:
     110:	55                   	push   %ebp
     111:	89 e5                	mov    %esp,%ebp
     113:	57                   	push   %edi
     114:	56                   	push   %esi
     115:	53                   	push   %ebx
     116:	83 ec 0c             	sub    $0xc,%esp
     119:	8b 55 08             	mov    0x8(%ebp),%edx
     11c:	8b 7d 10             	mov    0x10(%ebp),%edi
     11f:	8b 02                	mov    (%edx),%eax
     121:	3b 45 0c             	cmp    0xc(%ebp),%eax
     124:	89 c6                	mov    %eax,%esi
     126:	73 24                	jae    14c <gettoken+0x3c>
     128:	8b 5d 0c             	mov    0xc(%ebp),%ebx
     12b:	eb 08                	jmp    135 <gettoken+0x25>
     12d:	8d 76 00             	lea    0x0(%esi),%esi
     130:	46                   	inc    %esi
     131:	39 de                	cmp    %ebx,%esi
     133:	74 17                	je     14c <gettoken+0x3c>
     135:	0f be 06             	movsbl (%esi),%eax
     138:	c7 04 24 7c 13 00 00 	movl   $0x137c,(%esp)
     13f:	89 44 24 04          	mov    %eax,0x4(%esp)
     143:	e8 68 0b 00 00       	call   cb0 <strchr>
     148:	85 c0                	test   %eax,%eax
     14a:	75 e4                	jne    130 <gettoken+0x20>
     14c:	85 ff                	test   %edi,%edi
     14e:	74 02                	je     152 <gettoken+0x42>
     150:	89 37                	mov    %esi,(%edi)
     152:	0f b6 06             	movzbl (%esi),%eax
     155:	3c 3c                	cmp    $0x3c,%al
     157:	0f be f8             	movsbl %al,%edi
     15a:	7f 4f                	jg     1ab <gettoken+0x9b>
     15c:	3c 3b                	cmp    $0x3b,%al
     15e:	0f 8c 9e 00 00 00    	jl     202 <gettoken+0xf2>
     164:	46                   	inc    %esi
     165:	8b 45 14             	mov    0x14(%ebp),%eax
     168:	85 c0                	test   %eax,%eax
     16a:	74 05                	je     171 <gettoken+0x61>
     16c:	8b 45 14             	mov    0x14(%ebp),%eax
     16f:	89 30                	mov    %esi,(%eax)
     171:	3b 75 0c             	cmp    0xc(%ebp),%esi
     174:	89 f3                	mov    %esi,%ebx
     176:	73 24                	jae    19c <gettoken+0x8c>
     178:	8b 75 0c             	mov    0xc(%ebp),%esi
     17b:	eb 08                	jmp    185 <gettoken+0x75>
     17d:	8d 76 00             	lea    0x0(%esi),%esi
     180:	43                   	inc    %ebx
     181:	39 f3                	cmp    %esi,%ebx
     183:	74 17                	je     19c <gettoken+0x8c>
     185:	0f be 03             	movsbl (%ebx),%eax
     188:	c7 04 24 7c 13 00 00 	movl   $0x137c,(%esp)
     18f:	89 44 24 04          	mov    %eax,0x4(%esp)
     193:	e8 18 0b 00 00       	call   cb0 <strchr>
     198:	85 c0                	test   %eax,%eax
     19a:	75 e4                	jne    180 <gettoken+0x70>
     19c:	8b 55 08             	mov    0x8(%ebp),%edx
     19f:	89 f8                	mov    %edi,%eax
     1a1:	89 1a                	mov    %ebx,(%edx)
     1a3:	83 c4 0c             	add    $0xc,%esp
     1a6:	5b                   	pop    %ebx
     1a7:	5e                   	pop    %esi
     1a8:	5f                   	pop    %edi
     1a9:	5d                   	pop    %ebp
     1aa:	c3                   	ret    
     1ab:	3c 3e                	cmp    $0x3e,%al
     1ad:	74 76                	je     225 <gettoken+0x115>
     1af:	3c 7c                	cmp    $0x7c,%al
     1b1:	74 b1                	je     164 <gettoken+0x54>
     1b3:	39 75 0c             	cmp    %esi,0xc(%ebp)
     1b6:	bf 61 00 00 00       	mov    $0x61,%edi
     1bb:	89 f3                	mov    %esi,%ebx
     1bd:	77 20                	ja     1df <gettoken+0xcf>
     1bf:	90                   	nop    
     1c0:	eb a3                	jmp    165 <gettoken+0x55>
     1c2:	0f be 03             	movsbl (%ebx),%eax
     1c5:	c7 04 24 82 13 00 00 	movl   $0x1382,(%esp)
     1cc:	89 44 24 04          	mov    %eax,0x4(%esp)
     1d0:	e8 db 0a 00 00       	call   cb0 <strchr>
     1d5:	85 c0                	test   %eax,%eax
     1d7:	75 1d                	jne    1f6 <gettoken+0xe6>
     1d9:	43                   	inc    %ebx
     1da:	3b 5d 0c             	cmp    0xc(%ebp),%ebx
     1dd:	74 17                	je     1f6 <gettoken+0xe6>
     1df:	0f be 03             	movsbl (%ebx),%eax
     1e2:	c7 04 24 7c 13 00 00 	movl   $0x137c,(%esp)
     1e9:	89 44 24 04          	mov    %eax,0x4(%esp)
     1ed:	e8 be 0a 00 00       	call   cb0 <strchr>
     1f2:	85 c0                	test   %eax,%eax
     1f4:	74 cc                	je     1c2 <gettoken+0xb2>
     1f6:	89 de                	mov    %ebx,%esi
     1f8:	bf 61 00 00 00       	mov    $0x61,%edi
     1fd:	e9 63 ff ff ff       	jmp    165 <gettoken+0x55>
     202:	3c 29                	cmp    $0x29,%al
     204:	7f ad                	jg     1b3 <gettoken+0xa3>
     206:	3c 28                	cmp    $0x28,%al
     208:	0f 8d 56 ff ff ff    	jge    164 <gettoken+0x54>
     20e:	84 c0                	test   %al,%al
     210:	0f 84 4f ff ff ff    	je     165 <gettoken+0x55>
     216:	3c 26                	cmp    $0x26,%al
     218:	75 99                	jne    1b3 <gettoken+0xa3>
     21a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
     220:	e9 3f ff ff ff       	jmp    164 <gettoken+0x54>
     225:	46                   	inc    %esi
     226:	80 3e 3e             	cmpb   $0x3e,(%esi)
     229:	0f 85 36 ff ff ff    	jne    165 <gettoken+0x55>
     22f:	46                   	inc    %esi
     230:	bf 2b 00 00 00       	mov    $0x2b,%edi
     235:	e9 2b ff ff ff       	jmp    165 <gettoken+0x55>
     23a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

00000240 <backcmd>:
     240:	55                   	push   %ebp
     241:	89 e5                	mov    %esp,%ebp
     243:	53                   	push   %ebx
     244:	83 ec 14             	sub    $0x14,%esp
     247:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
     24e:	e8 4d 0f 00 00       	call   11a0 <malloc>
     253:	89 c3                	mov    %eax,%ebx
     255:	b8 08 00 00 00       	mov    $0x8,%eax
     25a:	89 44 24 08          	mov    %eax,0x8(%esp)
     25e:	31 c0                	xor    %eax,%eax
     260:	89 1c 24             	mov    %ebx,(%esp)
     263:	89 44 24 04          	mov    %eax,0x4(%esp)
     267:	e8 14 0a 00 00       	call   c80 <memset>
     26c:	8b 45 08             	mov    0x8(%ebp),%eax
     26f:	c7 03 05 00 00 00    	movl   $0x5,(%ebx)
     275:	89 43 04             	mov    %eax,0x4(%ebx)
     278:	83 c4 14             	add    $0x14,%esp
     27b:	89 d8                	mov    %ebx,%eax
     27d:	5b                   	pop    %ebx
     27e:	5d                   	pop    %ebp
     27f:	c3                   	ret    

00000280 <listcmd>:
     280:	55                   	push   %ebp
     281:	89 e5                	mov    %esp,%ebp
     283:	53                   	push   %ebx
     284:	83 ec 14             	sub    $0x14,%esp
     287:	c7 04 24 0c 00 00 00 	movl   $0xc,(%esp)
     28e:	e8 0d 0f 00 00       	call   11a0 <malloc>
     293:	ba 0c 00 00 00       	mov    $0xc,%edx
     298:	89 54 24 08          	mov    %edx,0x8(%esp)
     29c:	89 c3                	mov    %eax,%ebx
     29e:	31 c0                	xor    %eax,%eax
     2a0:	89 1c 24             	mov    %ebx,(%esp)
     2a3:	89 44 24 04          	mov    %eax,0x4(%esp)
     2a7:	e8 d4 09 00 00       	call   c80 <memset>
     2ac:	8b 45 08             	mov    0x8(%ebp),%eax
     2af:	c7 03 04 00 00 00    	movl   $0x4,(%ebx)
     2b5:	89 43 04             	mov    %eax,0x4(%ebx)
     2b8:	8b 45 0c             	mov    0xc(%ebp),%eax
     2bb:	89 43 08             	mov    %eax,0x8(%ebx)
     2be:	83 c4 14             	add    $0x14,%esp
     2c1:	89 d8                	mov    %ebx,%eax
     2c3:	5b                   	pop    %ebx
     2c4:	5d                   	pop    %ebp
     2c5:	c3                   	ret    
     2c6:	8d 76 00             	lea    0x0(%esi),%esi
     2c9:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

000002d0 <pipecmd>:
     2d0:	55                   	push   %ebp
     2d1:	89 e5                	mov    %esp,%ebp
     2d3:	53                   	push   %ebx
     2d4:	83 ec 14             	sub    $0x14,%esp
     2d7:	c7 04 24 0c 00 00 00 	movl   $0xc,(%esp)
     2de:	e8 bd 0e 00 00       	call   11a0 <malloc>
     2e3:	31 c9                	xor    %ecx,%ecx
     2e5:	89 4c 24 04          	mov    %ecx,0x4(%esp)
     2e9:	89 c3                	mov    %eax,%ebx
     2eb:	b8 0c 00 00 00       	mov    $0xc,%eax
     2f0:	89 1c 24             	mov    %ebx,(%esp)
     2f3:	89 44 24 08          	mov    %eax,0x8(%esp)
     2f7:	e8 84 09 00 00       	call   c80 <memset>
     2fc:	8b 45 08             	mov    0x8(%ebp),%eax
     2ff:	c7 03 03 00 00 00    	movl   $0x3,(%ebx)
     305:	89 43 04             	mov    %eax,0x4(%ebx)
     308:	8b 45 0c             	mov    0xc(%ebp),%eax
     30b:	89 43 08             	mov    %eax,0x8(%ebx)
     30e:	83 c4 14             	add    $0x14,%esp
     311:	89 d8                	mov    %ebx,%eax
     313:	5b                   	pop    %ebx
     314:	5d                   	pop    %ebp
     315:	c3                   	ret    
     316:	8d 76 00             	lea    0x0(%esi),%esi
     319:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00000320 <redircmd>:
     320:	55                   	push   %ebp
     321:	89 e5                	mov    %esp,%ebp
     323:	53                   	push   %ebx
     324:	83 ec 14             	sub    $0x14,%esp
     327:	c7 04 24 18 00 00 00 	movl   $0x18,(%esp)
     32e:	e8 6d 0e 00 00       	call   11a0 <malloc>
     333:	89 c3                	mov    %eax,%ebx
     335:	b8 18 00 00 00       	mov    $0x18,%eax
     33a:	89 44 24 08          	mov    %eax,0x8(%esp)
     33e:	31 c0                	xor    %eax,%eax
     340:	89 1c 24             	mov    %ebx,(%esp)
     343:	89 44 24 04          	mov    %eax,0x4(%esp)
     347:	e8 34 09 00 00       	call   c80 <memset>
     34c:	8b 45 08             	mov    0x8(%ebp),%eax
     34f:	c7 03 02 00 00 00    	movl   $0x2,(%ebx)
     355:	89 43 04             	mov    %eax,0x4(%ebx)
     358:	8b 45 0c             	mov    0xc(%ebp),%eax
     35b:	89 43 08             	mov    %eax,0x8(%ebx)
     35e:	8b 45 10             	mov    0x10(%ebp),%eax
     361:	89 43 0c             	mov    %eax,0xc(%ebx)
     364:	8b 45 14             	mov    0x14(%ebp),%eax
     367:	89 43 10             	mov    %eax,0x10(%ebx)
     36a:	8b 45 18             	mov    0x18(%ebp),%eax
     36d:	89 43 14             	mov    %eax,0x14(%ebx)
     370:	83 c4 14             	add    $0x14,%esp
     373:	89 d8                	mov    %ebx,%eax
     375:	5b                   	pop    %ebx
     376:	5d                   	pop    %ebp
     377:	c3                   	ret    
     378:	90                   	nop    
     379:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

00000380 <execcmd>:
     380:	55                   	push   %ebp
     381:	89 e5                	mov    %esp,%ebp
     383:	53                   	push   %ebx
     384:	83 ec 14             	sub    $0x14,%esp
     387:	c7 04 24 54 00 00 00 	movl   $0x54,(%esp)
     38e:	e8 0d 0e 00 00       	call   11a0 <malloc>
     393:	89 c3                	mov    %eax,%ebx
     395:	b8 54 00 00 00       	mov    $0x54,%eax
     39a:	89 44 24 08          	mov    %eax,0x8(%esp)
     39e:	31 c0                	xor    %eax,%eax
     3a0:	89 1c 24             	mov    %ebx,(%esp)
     3a3:	89 44 24 04          	mov    %eax,0x4(%esp)
     3a7:	e8 d4 08 00 00       	call   c80 <memset>
     3ac:	89 d8                	mov    %ebx,%eax
     3ae:	c7 03 01 00 00 00    	movl   $0x1,(%ebx)
     3b4:	83 c4 14             	add    $0x14,%esp
     3b7:	5b                   	pop    %ebx
     3b8:	5d                   	pop    %ebp
     3b9:	c3                   	ret    
     3ba:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

000003c0 <panic>:
     3c0:	55                   	push   %ebp
     3c1:	89 e5                	mov    %esp,%ebp
     3c3:	83 ec 18             	sub    $0x18,%esp
     3c6:	8b 45 08             	mov    0x8(%ebp),%eax
     3c9:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
     3d0:	89 44 24 08          	mov    %eax,0x8(%esp)
     3d4:	b8 15 13 00 00       	mov    $0x1315,%eax
     3d9:	89 44 24 04          	mov    %eax,0x4(%esp)
     3dd:	e8 ae 0b 00 00       	call   f90 <printf>
     3e2:	e8 45 0a 00 00       	call   e2c <exit>
     3e7:	89 f6                	mov    %esi,%esi
     3e9:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

000003f0 <parseredirs>:
     3f0:	55                   	push   %ebp
     3f1:	89 e5                	mov    %esp,%ebp
     3f3:	57                   	push   %edi
     3f4:	56                   	push   %esi
     3f5:	53                   	push   %ebx
     3f6:	83 ec 2c             	sub    $0x2c,%esp
     3f9:	8b 75 08             	mov    0x8(%ebp),%esi
     3fc:	8b 7d 10             	mov    0x10(%ebp),%edi
     3ff:	90                   	nop    
     400:	8b 45 0c             	mov    0xc(%ebp),%eax
     403:	ba c9 12 00 00       	mov    $0x12c9,%edx
     408:	89 54 24 08          	mov    %edx,0x8(%esp)
     40c:	89 7c 24 04          	mov    %edi,0x4(%esp)
     410:	89 04 24             	mov    %eax,(%esp)
     413:	e8 88 fc ff ff       	call   a0 <peek>
     418:	85 c0                	test   %eax,%eax
     41a:	0f 84 9e 00 00 00    	je     4be <parseredirs+0xce>
     420:	31 c0                	xor    %eax,%eax
     422:	89 44 24 0c          	mov    %eax,0xc(%esp)
     426:	31 c0                	xor    %eax,%eax
     428:	89 44 24 08          	mov    %eax,0x8(%esp)
     42c:	8b 45 0c             	mov    0xc(%ebp),%eax
     42f:	89 7c 24 04          	mov    %edi,0x4(%esp)
     433:	89 04 24             	mov    %eax,(%esp)
     436:	e8 d5 fc ff ff       	call   110 <gettoken>
     43b:	89 7c 24 04          	mov    %edi,0x4(%esp)
     43f:	89 c3                	mov    %eax,%ebx
     441:	8d 45 ec             	lea    0xffffffec(%ebp),%eax
     444:	89 44 24 0c          	mov    %eax,0xc(%esp)
     448:	8d 45 f0             	lea    0xfffffff0(%ebp),%eax
     44b:	89 44 24 08          	mov    %eax,0x8(%esp)
     44f:	8b 45 0c             	mov    0xc(%ebp),%eax
     452:	89 04 24             	mov    %eax,(%esp)
     455:	e8 b6 fc ff ff       	call   110 <gettoken>
     45a:	83 f8 61             	cmp    $0x61,%eax
     45d:	74 0c                	je     46b <parseredirs+0x7b>
     45f:	c7 04 24 ac 12 00 00 	movl   $0x12ac,(%esp)
     466:	e8 55 ff ff ff       	call   3c0 <panic>
     46b:	83 fb 3c             	cmp    $0x3c,%ebx
     46e:	74 40                	je     4b0 <parseredirs+0xc0>
     470:	83 fb 3e             	cmp    $0x3e,%ebx
     473:	74 05                	je     47a <parseredirs+0x8a>
     475:	83 fb 2b             	cmp    $0x2b,%ebx
     478:	75 86                	jne    400 <parseredirs+0x10>
     47a:	bb 01 00 00 00       	mov    $0x1,%ebx
     47f:	b9 01 02 00 00       	mov    $0x201,%ecx
     484:	89 5c 24 10          	mov    %ebx,0x10(%esp)
     488:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
     48c:	8b 45 ec             	mov    0xffffffec(%ebp),%eax
     48f:	89 34 24             	mov    %esi,(%esp)
     492:	89 44 24 08          	mov    %eax,0x8(%esp)
     496:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
     499:	89 44 24 04          	mov    %eax,0x4(%esp)
     49d:	e8 7e fe ff ff       	call   320 <redircmd>
     4a2:	89 c6                	mov    %eax,%esi
     4a4:	e9 57 ff ff ff       	jmp    400 <parseredirs+0x10>
     4a9:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
     4b0:	31 c0                	xor    %eax,%eax
     4b2:	89 44 24 10          	mov    %eax,0x10(%esp)
     4b6:	31 c0                	xor    %eax,%eax
     4b8:	89 44 24 0c          	mov    %eax,0xc(%esp)
     4bc:	eb ce                	jmp    48c <parseredirs+0x9c>
     4be:	83 c4 2c             	add    $0x2c,%esp
     4c1:	89 f0                	mov    %esi,%eax
     4c3:	5b                   	pop    %ebx
     4c4:	5e                   	pop    %esi
     4c5:	5f                   	pop    %edi
     4c6:	5d                   	pop    %ebp
     4c7:	c3                   	ret    
     4c8:	90                   	nop    
     4c9:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

000004d0 <parseblock>:
     4d0:	55                   	push   %ebp
     4d1:	b8 cc 12 00 00       	mov    $0x12cc,%eax
     4d6:	89 e5                	mov    %esp,%ebp
     4d8:	83 ec 28             	sub    $0x28,%esp
     4db:	89 5d f4             	mov    %ebx,0xfffffff4(%ebp)
     4de:	8b 5d 0c             	mov    0xc(%ebp),%ebx
     4e1:	89 75 f8             	mov    %esi,0xfffffff8(%ebp)
     4e4:	8b 75 08             	mov    0x8(%ebp),%esi
     4e7:	89 7d fc             	mov    %edi,0xfffffffc(%ebp)
     4ea:	89 44 24 08          	mov    %eax,0x8(%esp)
     4ee:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     4f2:	89 34 24             	mov    %esi,(%esp)
     4f5:	e8 a6 fb ff ff       	call   a0 <peek>
     4fa:	85 c0                	test   %eax,%eax
     4fc:	0f 84 80 00 00 00    	je     582 <parseblock+0xb2>
     502:	31 c9                	xor    %ecx,%ecx
     504:	31 ff                	xor    %edi,%edi
     506:	89 4c 24 08          	mov    %ecx,0x8(%esp)
     50a:	89 7c 24 0c          	mov    %edi,0xc(%esp)
     50e:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     512:	89 34 24             	mov    %esi,(%esp)
     515:	e8 f6 fb ff ff       	call   110 <gettoken>
     51a:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     51e:	89 34 24             	mov    %esi,(%esp)
     521:	e8 2a 02 00 00       	call   750 <parseline>
     526:	ba ea 12 00 00       	mov    $0x12ea,%edx
     52b:	89 54 24 08          	mov    %edx,0x8(%esp)
     52f:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     533:	89 34 24             	mov    %esi,(%esp)
     536:	89 c7                	mov    %eax,%edi
     538:	e8 63 fb ff ff       	call   a0 <peek>
     53d:	85 c0                	test   %eax,%eax
     53f:	75 0c                	jne    54d <parseblock+0x7d>
     541:	c7 04 24 d9 12 00 00 	movl   $0x12d9,(%esp)
     548:	e8 73 fe ff ff       	call   3c0 <panic>
     54d:	31 c0                	xor    %eax,%eax
     54f:	89 44 24 0c          	mov    %eax,0xc(%esp)
     553:	31 c0                	xor    %eax,%eax
     555:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     559:	89 34 24             	mov    %esi,(%esp)
     55c:	89 44 24 08          	mov    %eax,0x8(%esp)
     560:	e8 ab fb ff ff       	call   110 <gettoken>
     565:	89 5c 24 08          	mov    %ebx,0x8(%esp)
     569:	89 74 24 04          	mov    %esi,0x4(%esp)
     56d:	89 3c 24             	mov    %edi,(%esp)
     570:	e8 7b fe ff ff       	call   3f0 <parseredirs>
     575:	8b 5d f4             	mov    0xfffffff4(%ebp),%ebx
     578:	8b 75 f8             	mov    0xfffffff8(%ebp),%esi
     57b:	8b 7d fc             	mov    0xfffffffc(%ebp),%edi
     57e:	89 ec                	mov    %ebp,%esp
     580:	5d                   	pop    %ebp
     581:	c3                   	ret    
     582:	c7 04 24 ce 12 00 00 	movl   $0x12ce,(%esp)
     589:	e8 32 fe ff ff       	call   3c0 <panic>
     58e:	e9 6f ff ff ff       	jmp    502 <parseblock+0x32>
     593:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
     599:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

000005a0 <parseexec>:
     5a0:	55                   	push   %ebp
     5a1:	b8 cc 12 00 00       	mov    $0x12cc,%eax
     5a6:	89 e5                	mov    %esp,%ebp
     5a8:	57                   	push   %edi
     5a9:	56                   	push   %esi
     5aa:	53                   	push   %ebx
     5ab:	83 ec 2c             	sub    $0x2c,%esp
     5ae:	89 44 24 08          	mov    %eax,0x8(%esp)
     5b2:	8b 45 0c             	mov    0xc(%ebp),%eax
     5b5:	89 44 24 04          	mov    %eax,0x4(%esp)
     5b9:	8b 45 08             	mov    0x8(%ebp),%eax
     5bc:	89 04 24             	mov    %eax,(%esp)
     5bf:	e8 dc fa ff ff       	call   a0 <peek>
     5c4:	85 c0                	test   %eax,%eax
     5c6:	74 1e                	je     5e6 <parseexec+0x46>
     5c8:	8b 45 0c             	mov    0xc(%ebp),%eax
     5cb:	89 44 24 04          	mov    %eax,0x4(%esp)
     5cf:	8b 45 08             	mov    0x8(%ebp),%eax
     5d2:	89 04 24             	mov    %eax,(%esp)
     5d5:	e8 f6 fe ff ff       	call   4d0 <parseblock>
     5da:	83 c4 2c             	add    $0x2c,%esp
     5dd:	5b                   	pop    %ebx
     5de:	89 c6                	mov    %eax,%esi
     5e0:	89 f0                	mov    %esi,%eax
     5e2:	5e                   	pop    %esi
     5e3:	5f                   	pop    %edi
     5e4:	5d                   	pop    %ebp
     5e5:	c3                   	ret    
     5e6:	e8 95 fd ff ff       	call   380 <execcmd>
     5eb:	31 db                	xor    %ebx,%ebx
     5ed:	89 c7                	mov    %eax,%edi
     5ef:	8b 45 0c             	mov    0xc(%ebp),%eax
     5f2:	89 44 24 08          	mov    %eax,0x8(%esp)
     5f6:	8b 45 08             	mov    0x8(%ebp),%eax
     5f9:	89 3c 24             	mov    %edi,(%esp)
     5fc:	89 44 24 04          	mov    %eax,0x4(%esp)
     600:	e8 eb fd ff ff       	call   3f0 <parseredirs>
     605:	89 c6                	mov    %eax,%esi
     607:	eb 1f                	jmp    628 <parseexec+0x88>
     609:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
     610:	8b 45 0c             	mov    0xc(%ebp),%eax
     613:	89 44 24 08          	mov    %eax,0x8(%esp)
     617:	8b 45 08             	mov    0x8(%ebp),%eax
     61a:	89 34 24             	mov    %esi,(%esp)
     61d:	89 44 24 04          	mov    %eax,0x4(%esp)
     621:	e8 ca fd ff ff       	call   3f0 <parseredirs>
     626:	89 c6                	mov    %eax,%esi
     628:	b8 01 13 00 00       	mov    $0x1301,%eax
     62d:	89 44 24 08          	mov    %eax,0x8(%esp)
     631:	8b 45 0c             	mov    0xc(%ebp),%eax
     634:	89 44 24 04          	mov    %eax,0x4(%esp)
     638:	8b 45 08             	mov    0x8(%ebp),%eax
     63b:	89 04 24             	mov    %eax,(%esp)
     63e:	e8 5d fa ff ff       	call   a0 <peek>
     643:	85 c0                	test   %eax,%eax
     645:	75 5a                	jne    6a1 <parseexec+0x101>
     647:	8d 45 ec             	lea    0xffffffec(%ebp),%eax
     64a:	89 44 24 0c          	mov    %eax,0xc(%esp)
     64e:	8d 45 f0             	lea    0xfffffff0(%ebp),%eax
     651:	89 44 24 08          	mov    %eax,0x8(%esp)
     655:	8b 45 0c             	mov    0xc(%ebp),%eax
     658:	89 44 24 04          	mov    %eax,0x4(%esp)
     65c:	8b 45 08             	mov    0x8(%ebp),%eax
     65f:	89 04 24             	mov    %eax,(%esp)
     662:	e8 a9 fa ff ff       	call   110 <gettoken>
     667:	85 c0                	test   %eax,%eax
     669:	74 36                	je     6a1 <parseexec+0x101>
     66b:	83 f8 61             	cmp    $0x61,%eax
     66e:	74 0c                	je     67c <parseexec+0xdc>
     670:	c7 04 24 ec 12 00 00 	movl   $0x12ec,(%esp)
     677:	e8 44 fd ff ff       	call   3c0 <panic>
     67c:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
     67f:	89 44 9f 04          	mov    %eax,0x4(%edi,%ebx,4)
     683:	8b 45 ec             	mov    0xffffffec(%ebp),%eax
     686:	89 44 9f 2c          	mov    %eax,0x2c(%edi,%ebx,4)
     68a:	43                   	inc    %ebx
     68b:	83 fb 09             	cmp    $0x9,%ebx
     68e:	7e 80                	jle    610 <parseexec+0x70>
     690:	c7 04 24 f3 12 00 00 	movl   $0x12f3,(%esp)
     697:	e8 24 fd ff ff       	call   3c0 <panic>
     69c:	e9 6f ff ff ff       	jmp    610 <parseexec+0x70>
     6a1:	31 c0                	xor    %eax,%eax
     6a3:	89 44 9f 04          	mov    %eax,0x4(%edi,%ebx,4)
     6a7:	31 c0                	xor    %eax,%eax
     6a9:	89 44 9f 2c          	mov    %eax,0x2c(%edi,%ebx,4)
     6ad:	83 c4 2c             	add    $0x2c,%esp
     6b0:	89 f0                	mov    %esi,%eax
     6b2:	5b                   	pop    %ebx
     6b3:	5e                   	pop    %esi
     6b4:	5f                   	pop    %edi
     6b5:	5d                   	pop    %ebp
     6b6:	c3                   	ret    
     6b7:	89 f6                	mov    %esi,%esi
     6b9:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

000006c0 <parsepipe>:
     6c0:	55                   	push   %ebp
     6c1:	89 e5                	mov    %esp,%ebp
     6c3:	83 ec 28             	sub    $0x28,%esp
     6c6:	89 5d f4             	mov    %ebx,0xfffffff4(%ebp)
     6c9:	8b 5d 0c             	mov    0xc(%ebp),%ebx
     6cc:	89 75 f8             	mov    %esi,0xfffffff8(%ebp)
     6cf:	8b 75 08             	mov    0x8(%ebp),%esi
     6d2:	89 7d fc             	mov    %edi,0xfffffffc(%ebp)
     6d5:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     6d9:	89 34 24             	mov    %esi,(%esp)
     6dc:	e8 bf fe ff ff       	call   5a0 <parseexec>
     6e1:	b9 06 13 00 00       	mov    $0x1306,%ecx
     6e6:	89 4c 24 08          	mov    %ecx,0x8(%esp)
     6ea:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     6ee:	89 34 24             	mov    %esi,(%esp)
     6f1:	89 c7                	mov    %eax,%edi
     6f3:	e8 a8 f9 ff ff       	call   a0 <peek>
     6f8:	85 c0                	test   %eax,%eax
     6fa:	75 14                	jne    710 <parsepipe+0x50>
     6fc:	89 f8                	mov    %edi,%eax
     6fe:	8b 5d f4             	mov    0xfffffff4(%ebp),%ebx
     701:	8b 75 f8             	mov    0xfffffff8(%ebp),%esi
     704:	8b 7d fc             	mov    0xfffffffc(%ebp),%edi
     707:	89 ec                	mov    %ebp,%esp
     709:	5d                   	pop    %ebp
     70a:	c3                   	ret    
     70b:	90                   	nop    
     70c:	8d 74 26 00          	lea    0x0(%esi),%esi
     710:	31 d2                	xor    %edx,%edx
     712:	31 c0                	xor    %eax,%eax
     714:	89 54 24 0c          	mov    %edx,0xc(%esp)
     718:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     71c:	89 34 24             	mov    %esi,(%esp)
     71f:	89 44 24 08          	mov    %eax,0x8(%esp)
     723:	e8 e8 f9 ff ff       	call   110 <gettoken>
     728:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     72c:	89 34 24             	mov    %esi,(%esp)
     72f:	e8 8c ff ff ff       	call   6c0 <parsepipe>
     734:	8b 5d f4             	mov    0xfffffff4(%ebp),%ebx
     737:	89 7d 08             	mov    %edi,0x8(%ebp)
     73a:	8b 75 f8             	mov    0xfffffff8(%ebp),%esi
     73d:	8b 7d fc             	mov    0xfffffffc(%ebp),%edi
     740:	89 45 0c             	mov    %eax,0xc(%ebp)
     743:	89 ec                	mov    %ebp,%esp
     745:	5d                   	pop    %ebp
     746:	e9 85 fb ff ff       	jmp    2d0 <pipecmd>
     74b:	90                   	nop    
     74c:	8d 74 26 00          	lea    0x0(%esi),%esi

00000750 <parseline>:
     750:	55                   	push   %ebp
     751:	89 e5                	mov    %esp,%ebp
     753:	57                   	push   %edi
     754:	56                   	push   %esi
     755:	53                   	push   %ebx
     756:	83 ec 1c             	sub    $0x1c,%esp
     759:	8b 75 08             	mov    0x8(%ebp),%esi
     75c:	8b 5d 0c             	mov    0xc(%ebp),%ebx
     75f:	89 34 24             	mov    %esi,(%esp)
     762:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     766:	e8 55 ff ff ff       	call   6c0 <parsepipe>
     76b:	89 c7                	mov    %eax,%edi
     76d:	eb 23                	jmp    792 <parseline+0x42>
     76f:	90                   	nop    
     770:	31 c0                	xor    %eax,%eax
     772:	89 44 24 0c          	mov    %eax,0xc(%esp)
     776:	31 c0                	xor    %eax,%eax
     778:	89 44 24 08          	mov    %eax,0x8(%esp)
     77c:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     780:	89 34 24             	mov    %esi,(%esp)
     783:	e8 88 f9 ff ff       	call   110 <gettoken>
     788:	89 3c 24             	mov    %edi,(%esp)
     78b:	e8 b0 fa ff ff       	call   240 <backcmd>
     790:	89 c7                	mov    %eax,%edi
     792:	b8 08 13 00 00       	mov    $0x1308,%eax
     797:	89 44 24 08          	mov    %eax,0x8(%esp)
     79b:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     79f:	89 34 24             	mov    %esi,(%esp)
     7a2:	e8 f9 f8 ff ff       	call   a0 <peek>
     7a7:	85 c0                	test   %eax,%eax
     7a9:	75 c5                	jne    770 <parseline+0x20>
     7ab:	b8 04 13 00 00       	mov    $0x1304,%eax
     7b0:	89 44 24 08          	mov    %eax,0x8(%esp)
     7b4:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     7b8:	89 34 24             	mov    %esi,(%esp)
     7bb:	e8 e0 f8 ff ff       	call   a0 <peek>
     7c0:	85 c0                	test   %eax,%eax
     7c2:	75 0a                	jne    7ce <parseline+0x7e>
     7c4:	83 c4 1c             	add    $0x1c,%esp
     7c7:	89 f8                	mov    %edi,%eax
     7c9:	5b                   	pop    %ebx
     7ca:	5e                   	pop    %esi
     7cb:	5f                   	pop    %edi
     7cc:	5d                   	pop    %ebp
     7cd:	c3                   	ret    
     7ce:	31 c0                	xor    %eax,%eax
     7d0:	89 44 24 0c          	mov    %eax,0xc(%esp)
     7d4:	31 c0                	xor    %eax,%eax
     7d6:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     7da:	89 34 24             	mov    %esi,(%esp)
     7dd:	89 44 24 08          	mov    %eax,0x8(%esp)
     7e1:	e8 2a f9 ff ff       	call   110 <gettoken>
     7e6:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     7ea:	89 34 24             	mov    %esi,(%esp)
     7ed:	e8 5e ff ff ff       	call   750 <parseline>
     7f2:	89 7d 08             	mov    %edi,0x8(%ebp)
     7f5:	89 45 0c             	mov    %eax,0xc(%ebp)
     7f8:	83 c4 1c             	add    $0x1c,%esp
     7fb:	5b                   	pop    %ebx
     7fc:	5e                   	pop    %esi
     7fd:	5f                   	pop    %edi
     7fe:	5d                   	pop    %ebp
     7ff:	e9 7c fa ff ff       	jmp    280 <listcmd>
     804:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
     80a:	8d bf 00 00 00 00    	lea    0x0(%edi),%edi

00000810 <parsecmd>:
     810:	55                   	push   %ebp
     811:	89 e5                	mov    %esp,%ebp
     813:	56                   	push   %esi
     814:	53                   	push   %ebx
     815:	83 ec 10             	sub    $0x10,%esp
     818:	8b 45 08             	mov    0x8(%ebp),%eax
     81b:	89 04 24             	mov    %eax,(%esp)
     81e:	e8 3d 04 00 00       	call   c60 <strlen>
     823:	8b 75 08             	mov    0x8(%ebp),%esi
     826:	89 c3                	mov    %eax,%ebx
     828:	01 f3                	add    %esi,%ebx
     82a:	8d 45 08             	lea    0x8(%ebp),%eax
     82d:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     831:	89 04 24             	mov    %eax,(%esp)
     834:	e8 17 ff ff ff       	call   750 <parseline>
     839:	b9 37 13 00 00       	mov    $0x1337,%ecx
     83e:	89 4c 24 08          	mov    %ecx,0x8(%esp)
     842:	89 5c 24 04          	mov    %ebx,0x4(%esp)
     846:	89 c6                	mov    %eax,%esi
     848:	8d 45 08             	lea    0x8(%ebp),%eax
     84b:	89 04 24             	mov    %eax,(%esp)
     84e:	e8 4d f8 ff ff       	call   a0 <peek>
     853:	8b 45 08             	mov    0x8(%ebp),%eax
     856:	39 c3                	cmp    %eax,%ebx
     858:	74 25                	je     87f <parsecmd+0x6f>
     85a:	ba 0a 13 00 00       	mov    $0x130a,%edx
     85f:	89 44 24 08          	mov    %eax,0x8(%esp)
     863:	89 54 24 04          	mov    %edx,0x4(%esp)
     867:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
     86e:	e8 1d 07 00 00       	call   f90 <printf>
     873:	c7 04 24 ec 12 00 00 	movl   $0x12ec,(%esp)
     87a:	e8 41 fb ff ff       	call   3c0 <panic>
     87f:	89 34 24             	mov    %esi,(%esp)
     882:	e8 79 f7 ff ff       	call   0 <nulterminate>
     887:	83 c4 10             	add    $0x10,%esp
     88a:	89 f0                	mov    %esi,%eax
     88c:	5b                   	pop    %ebx
     88d:	5e                   	pop    %esi
     88e:	5d                   	pop    %ebp
     88f:	c3                   	ret    

00000890 <fork1>:
     890:	55                   	push   %ebp
     891:	89 e5                	mov    %esp,%ebp
     893:	53                   	push   %ebx
     894:	83 ec 04             	sub    $0x4,%esp
     897:	e8 88 05 00 00       	call   e24 <fork>
     89c:	83 f8 ff             	cmp    $0xffffffff,%eax
     89f:	89 c3                	mov    %eax,%ebx
     8a1:	74 0d                	je     8b0 <fork1+0x20>
     8a3:	5a                   	pop    %edx
     8a4:	89 d8                	mov    %ebx,%eax
     8a6:	5b                   	pop    %ebx
     8a7:	5d                   	pop    %ebp
     8a8:	c3                   	ret    
     8a9:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
     8b0:	c7 04 24 19 13 00 00 	movl   $0x1319,(%esp)
     8b7:	e8 04 fb ff ff       	call   3c0 <panic>
     8bc:	89 d8                	mov    %ebx,%eax
     8be:	5a                   	pop    %edx
     8bf:	5b                   	pop    %ebx
     8c0:	5d                   	pop    %ebp
     8c1:	c3                   	ret    
     8c2:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
     8c9:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

000008d0 <getcmd>:
     8d0:	55                   	push   %ebp
     8d1:	b8 1e 13 00 00       	mov    $0x131e,%eax
     8d6:	89 e5                	mov    %esp,%ebp
     8d8:	83 ec 18             	sub    $0x18,%esp
     8db:	89 5d f8             	mov    %ebx,0xfffffff8(%ebp)
     8de:	8b 5d 08             	mov    0x8(%ebp),%ebx
     8e1:	89 75 fc             	mov    %esi,0xfffffffc(%ebp)
     8e4:	8b 75 0c             	mov    0xc(%ebp),%esi
     8e7:	89 44 24 04          	mov    %eax,0x4(%esp)
     8eb:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
     8f2:	e8 99 06 00 00       	call   f90 <printf>
     8f7:	31 c9                	xor    %ecx,%ecx
     8f9:	89 74 24 08          	mov    %esi,0x8(%esp)
     8fd:	89 4c 24 04          	mov    %ecx,0x4(%esp)
     901:	89 1c 24             	mov    %ebx,(%esp)
     904:	e8 77 03 00 00       	call   c80 <memset>
     909:	89 74 24 04          	mov    %esi,0x4(%esp)
     90d:	89 1c 24             	mov    %ebx,(%esp)
     910:	e8 9b 04 00 00       	call   db0 <gets>
     915:	8b 75 fc             	mov    0xfffffffc(%ebp),%esi
     918:	80 3b 01             	cmpb   $0x1,(%ebx)
     91b:	8b 5d f8             	mov    0xfffffff8(%ebp),%ebx
     91e:	19 c0                	sbb    %eax,%eax
     920:	89 ec                	mov    %ebp,%esp
     922:	5d                   	pop    %ebp
     923:	c3                   	ret    
     924:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
     92a:	8d bf 00 00 00 00    	lea    0x0(%edi),%edi

00000930 <runcmd>:
     930:	55                   	push   %ebp
     931:	89 e5                	mov    %esp,%ebp
     933:	53                   	push   %ebx
     934:	83 ec 24             	sub    $0x24,%esp
     937:	8b 5d 08             	mov    0x8(%ebp),%ebx
     93a:	85 db                	test   %ebx,%ebx
     93c:	74 43                	je     981 <runcmd+0x51>
     93e:	83 3b 05             	cmpl   $0x5,(%ebx)
     941:	76 43                	jbe    986 <runcmd+0x56>
     943:	c7 04 24 21 13 00 00 	movl   $0x1321,(%esp)
     94a:	e8 71 fa ff ff       	call   3c0 <panic>
     94f:	8b 53 04             	mov    0x4(%ebx),%edx
     952:	85 d2                	test   %edx,%edx
     954:	74 2b                	je     981 <runcmd+0x51>
     956:	8d 43 04             	lea    0x4(%ebx),%eax
     959:	89 44 24 04          	mov    %eax,0x4(%esp)
     95d:	89 14 24             	mov    %edx,(%esp)
     960:	e8 ff 04 00 00       	call   e64 <exec>
     965:	8b 43 04             	mov    0x4(%ebx),%eax
     968:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
     96f:	89 44 24 08          	mov    %eax,0x8(%esp)
     973:	b8 28 13 00 00       	mov    $0x1328,%eax
     978:	89 44 24 04          	mov    %eax,0x4(%esp)
     97c:	e8 0f 06 00 00       	call   f90 <printf>
     981:	e8 a6 04 00 00       	call   e2c <exit>
     986:	8b 03                	mov    (%ebx),%eax
     988:	ff 24 85 94 12 00 00 	jmp    *0x1294(,%eax,4)
     98f:	8b 43 14             	mov    0x14(%ebx),%eax
     992:	89 04 24             	mov    %eax,(%esp)
     995:	e8 ba 04 00 00       	call   e54 <close>
     99a:	8b 43 10             	mov    0x10(%ebx),%eax
     99d:	89 44 24 04          	mov    %eax,0x4(%esp)
     9a1:	8b 43 08             	mov    0x8(%ebx),%eax
     9a4:	89 04 24             	mov    %eax,(%esp)
     9a7:	e8 c0 04 00 00       	call   e6c <open>
     9ac:	85 c0                	test   %eax,%eax
     9ae:	0f 88 31 01 00 00    	js     ae5 <runcmd+0x1b5>
     9b4:	8b 43 04             	mov    0x4(%ebx),%eax
     9b7:	89 04 24             	mov    %eax,(%esp)
     9ba:	e8 71 ff ff ff       	call   930 <runcmd>
     9bf:	90                   	nop    
     9c0:	eb bf                	jmp    981 <runcmd+0x51>
     9c2:	8d 45 f4             	lea    0xfffffff4(%ebp),%eax
     9c5:	89 04 24             	mov    %eax,(%esp)
     9c8:	e8 6f 04 00 00       	call   e3c <pipe>
     9cd:	85 c0                	test   %eax,%eax
     9cf:	90                   	nop    
     9d0:	0f 88 fc 00 00 00    	js     ad2 <runcmd+0x1a2>
     9d6:	e8 b5 fe ff ff       	call   890 <fork1>
     9db:	85 c0                	test   %eax,%eax
     9dd:	8d 76 00             	lea    0x0(%esi),%esi
     9e0:	74 69                	je     a4b <runcmd+0x11b>
     9e2:	e8 a9 fe ff ff       	call   890 <fork1>
     9e7:	85 c0                	test   %eax,%eax
     9e9:	0f 84 a6 00 00 00    	je     a95 <runcmd+0x165>
     9ef:	8b 45 f4             	mov    0xfffffff4(%ebp),%eax
     9f2:	89 04 24             	mov    %eax,(%esp)
     9f5:	e8 5a 04 00 00       	call   e54 <close>
     9fa:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
     9fd:	89 04 24             	mov    %eax,(%esp)
     a00:	e8 4f 04 00 00       	call   e54 <close>
     a05:	e8 2a 04 00 00       	call   e34 <wait>
     a0a:	e8 25 04 00 00       	call   e34 <wait>
     a0f:	90                   	nop    
     a10:	e9 6c ff ff ff       	jmp    981 <runcmd+0x51>
     a15:	e8 76 fe ff ff       	call   890 <fork1>
     a1a:	85 c0                	test   %eax,%eax
     a1c:	8d 74 26 00          	lea    0x0(%esi),%esi
     a20:	74 66                	je     a88 <runcmd+0x158>
     a22:	e8 0d 04 00 00       	call   e34 <wait>
     a27:	8b 43 08             	mov    0x8(%ebx),%eax
     a2a:	89 04 24             	mov    %eax,(%esp)
     a2d:	e8 fe fe ff ff       	call   930 <runcmd>
     a32:	e9 4a ff ff ff       	jmp    981 <runcmd+0x51>
     a37:	e8 54 fe ff ff       	call   890 <fork1>
     a3c:	85 c0                	test   %eax,%eax
     a3e:	89 f6                	mov    %esi,%esi
     a40:	0f 85 3b ff ff ff    	jne    981 <runcmd+0x51>
     a46:	e9 69 ff ff ff       	jmp    9b4 <runcmd+0x84>
     a4b:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
     a52:	e8 fd 03 00 00       	call   e54 <close>
     a57:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
     a5a:	89 04 24             	mov    %eax,(%esp)
     a5d:	e8 42 04 00 00       	call   ea4 <dup>
     a62:	8b 45 f4             	mov    0xfffffff4(%ebp),%eax
     a65:	89 04 24             	mov    %eax,(%esp)
     a68:	e8 e7 03 00 00       	call   e54 <close>
     a6d:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
     a70:	89 04 24             	mov    %eax,(%esp)
     a73:	e8 dc 03 00 00       	call   e54 <close>
     a78:	8b 43 04             	mov    0x4(%ebx),%eax
     a7b:	89 04 24             	mov    %eax,(%esp)
     a7e:	e8 ad fe ff ff       	call   930 <runcmd>
     a83:	e9 5a ff ff ff       	jmp    9e2 <runcmd+0xb2>
     a88:	8b 43 04             	mov    0x4(%ebx),%eax
     a8b:	89 04 24             	mov    %eax,(%esp)
     a8e:	e8 9d fe ff ff       	call   930 <runcmd>
     a93:	eb 8d                	jmp    a22 <runcmd+0xf2>
     a95:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
     a9c:	e8 b3 03 00 00       	call   e54 <close>
     aa1:	8b 45 f4             	mov    0xfffffff4(%ebp),%eax
     aa4:	89 04 24             	mov    %eax,(%esp)
     aa7:	e8 f8 03 00 00       	call   ea4 <dup>
     aac:	8b 45 f4             	mov    0xfffffff4(%ebp),%eax
     aaf:	89 04 24             	mov    %eax,(%esp)
     ab2:	e8 9d 03 00 00       	call   e54 <close>
     ab7:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
     aba:	89 04 24             	mov    %eax,(%esp)
     abd:	e8 92 03 00 00       	call   e54 <close>
     ac2:	8b 43 08             	mov    0x8(%ebx),%eax
     ac5:	89 04 24             	mov    %eax,(%esp)
     ac8:	e8 63 fe ff ff       	call   930 <runcmd>
     acd:	e9 1d ff ff ff       	jmp    9ef <runcmd+0xbf>
     ad2:	c7 04 24 48 13 00 00 	movl   $0x1348,(%esp)
     ad9:	e8 e2 f8 ff ff       	call   3c0 <panic>
     ade:	89 f6                	mov    %esi,%esi
     ae0:	e9 f1 fe ff ff       	jmp    9d6 <runcmd+0xa6>
     ae5:	8b 43 08             	mov    0x8(%ebx),%eax
     ae8:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
     aef:	89 44 24 08          	mov    %eax,0x8(%esp)
     af3:	b8 38 13 00 00       	mov    $0x1338,%eax
     af8:	89 44 24 04          	mov    %eax,0x4(%esp)
     afc:	e8 8f 04 00 00       	call   f90 <printf>
     b01:	e8 26 03 00 00       	call   e2c <exit>
     b06:	8d 76 00             	lea    0x0(%esi),%esi
     b09:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00000b10 <main>:
     b10:	8d 4c 24 04          	lea    0x4(%esp),%ecx
     b14:	83 e4 f0             	and    $0xfffffff0,%esp
     b17:	ff 71 fc             	pushl  0xfffffffc(%ecx)
     b1a:	55                   	push   %ebp
     b1b:	89 e5                	mov    %esp,%ebp
     b1d:	51                   	push   %ecx
     b1e:	83 ec 14             	sub    $0x14,%esp
     b21:	eb 0d                	jmp    b30 <main+0x20>
     b23:	90                   	nop    
     b24:	90                   	nop    
     b25:	90                   	nop    
     b26:	90                   	nop    
     b27:	90                   	nop    
     b28:	90                   	nop    
     b29:	90                   	nop    
     b2a:	90                   	nop    
     b2b:	90                   	nop    
     b2c:	90                   	nop    
     b2d:	90                   	nop    
     b2e:	90                   	nop    
     b2f:	90                   	nop    
     b30:	ba 02 00 00 00       	mov    $0x2,%edx
     b35:	89 54 24 04          	mov    %edx,0x4(%esp)
     b39:	c7 04 24 4d 13 00 00 	movl   $0x134d,(%esp)
     b40:	e8 27 03 00 00       	call   e6c <open>
     b45:	85 c0                	test   %eax,%eax
     b47:	78 2c                	js     b75 <main+0x65>
     b49:	83 f8 02             	cmp    $0x2,%eax
     b4c:	7e e2                	jle    b30 <main+0x20>
     b4e:	89 04 24             	mov    %eax,(%esp)
     b51:	e8 fe 02 00 00       	call   e54 <close>
     b56:	eb 1d                	jmp    b75 <main+0x65>
     b58:	c7 04 24 a0 13 00 00 	movl   $0x13a0,(%esp)
     b5f:	e8 ac fc ff ff       	call   810 <parsecmd>
     b64:	89 04 24             	mov    %eax,(%esp)
     b67:	e8 c4 fd ff ff       	call   930 <runcmd>
     b6c:	8d 74 26 00          	lea    0x0(%esi),%esi
     b70:	e8 bf 02 00 00       	call   e34 <wait>
     b75:	b8 64 00 00 00       	mov    $0x64,%eax
     b7a:	89 44 24 04          	mov    %eax,0x4(%esp)
     b7e:	c7 04 24 a0 13 00 00 	movl   $0x13a0,(%esp)
     b85:	e8 46 fd ff ff       	call   8d0 <getcmd>
     b8a:	85 c0                	test   %eax,%eax
     b8c:	78 72                	js     c00 <main+0xf0>
     b8e:	80 3d a0 13 00 00 63 	cmpb   $0x63,0x13a0
     b95:	75 09                	jne    ba0 <main+0x90>
     b97:	80 3d a1 13 00 00 64 	cmpb   $0x64,0x13a1
     b9e:	74 10                	je     bb0 <main+0xa0>
     ba0:	e8 eb fc ff ff       	call   890 <fork1>
     ba5:	85 c0                	test   %eax,%eax
     ba7:	75 c7                	jne    b70 <main+0x60>
     ba9:	eb ad                	jmp    b58 <main+0x48>
     bab:	90                   	nop    
     bac:	8d 74 26 00          	lea    0x0(%esi),%esi
     bb0:	80 3d a2 13 00 00 20 	cmpb   $0x20,0x13a2
     bb7:	75 e7                	jne    ba0 <main+0x90>
     bb9:	c7 04 24 a0 13 00 00 	movl   $0x13a0,(%esp)
     bc0:	e8 9b 00 00 00       	call   c60 <strlen>
     bc5:	c7 04 24 a3 13 00 00 	movl   $0x13a3,(%esp)
     bcc:	c6 80 9f 13 00 00 00 	movb   $0x0,0x139f(%eax)
     bd3:	e8 c4 02 00 00       	call   e9c <chdir>
     bd8:	85 c0                	test   %eax,%eax
     bda:	79 99                	jns    b75 <main+0x65>
     bdc:	b8 a3 13 00 00       	mov    $0x13a3,%eax
     be1:	89 44 24 08          	mov    %eax,0x8(%esp)
     be5:	b8 55 13 00 00       	mov    $0x1355,%eax
     bea:	89 44 24 04          	mov    %eax,0x4(%esp)
     bee:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
     bf5:	e8 96 03 00 00       	call   f90 <printf>
     bfa:	e9 76 ff ff ff       	jmp    b75 <main+0x65>
     bff:	90                   	nop    
     c00:	e8 27 02 00 00       	call   e2c <exit>
     c05:	90                   	nop    
     c06:	90                   	nop    
     c07:	90                   	nop    
     c08:	90                   	nop    
     c09:	90                   	nop    
     c0a:	90                   	nop    
     c0b:	90                   	nop    
     c0c:	90                   	nop    
     c0d:	90                   	nop    
     c0e:	90                   	nop    
     c0f:	90                   	nop    

00000c10 <strcpy>:
#include "user.h"

char*
strcpy(char *s, char *t)
{
     c10:	55                   	push   %ebp
     c11:	89 e5                	mov    %esp,%ebp
     c13:	53                   	push   %ebx
     c14:	8b 5d 08             	mov    0x8(%ebp),%ebx
     c17:	8b 4d 0c             	mov    0xc(%ebp),%ecx
     c1a:	89 da                	mov    %ebx,%edx
     c1c:	8d 74 26 00          	lea    0x0(%esi),%esi
  char *os;

  os = s;
  while((*s++ = *t++) != 0)
     c20:	0f b6 01             	movzbl (%ecx),%eax
     c23:	41                   	inc    %ecx
     c24:	88 02                	mov    %al,(%edx)
     c26:	42                   	inc    %edx
     c27:	84 c0                	test   %al,%al
     c29:	75 f5                	jne    c20 <strcpy+0x10>
    ;
  return os;
}
     c2b:	89 d8                	mov    %ebx,%eax
     c2d:	5b                   	pop    %ebx
     c2e:	5d                   	pop    %ebp
     c2f:	c3                   	ret    

00000c30 <strcmp>:

int
strcmp(const char *p, const char *q)
{
     c30:	55                   	push   %ebp
     c31:	89 e5                	mov    %esp,%ebp
     c33:	8b 55 08             	mov    0x8(%ebp),%edx
     c36:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  while(*p && *p == *q)
     c39:	0f b6 02             	movzbl (%edx),%eax
     c3c:	84 c0                	test   %al,%al
     c3e:	75 0c                	jne    c4c <strcmp+0x1c>
     c40:	eb 10                	jmp    c52 <strcmp+0x22>
     c42:	0f b6 42 01          	movzbl 0x1(%edx),%eax
    p++, q++;
     c46:	41                   	inc    %ecx
     c47:	84 c0                	test   %al,%al
     c49:	74 07                	je     c52 <strcmp+0x22>
     c4b:	42                   	inc    %edx
     c4c:	3a 01                	cmp    (%ecx),%al
     c4e:	89 f6                	mov    %esi,%esi
     c50:	74 f0                	je     c42 <strcmp+0x12>
     c52:	0f b6 11             	movzbl (%ecx),%edx
     c55:	0f b6 c0             	movzbl %al,%eax
  return (uchar)*p - (uchar)*q;
}
     c58:	5d                   	pop    %ebp
     c59:	29 d0                	sub    %edx,%eax
     c5b:	c3                   	ret    
     c5c:	8d 74 26 00          	lea    0x0(%esi),%esi

00000c60 <strlen>:

uint
strlen(char *s)
{
     c60:	55                   	push   %ebp
  int n;

  for(n = 0; s[n]; n++)
     c61:	31 c0                	xor    %eax,%eax
     c63:	89 e5                	mov    %esp,%ebp
     c65:	8b 55 08             	mov    0x8(%ebp),%edx
     c68:	80 3a 00             	cmpb   $0x0,(%edx)
     c6b:	74 0a                	je     c77 <strlen+0x17>
     c6d:	8d 76 00             	lea    0x0(%esi),%esi
     c70:	40                   	inc    %eax
     c71:	80 3c 10 00          	cmpb   $0x0,(%eax,%edx,1)
     c75:	75 f9                	jne    c70 <strlen+0x10>
    ;
  return n;
}
     c77:	5d                   	pop    %ebp
     c78:	c3                   	ret    
     c79:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

00000c80 <memset>:

void*
memset(void *dst, int c, uint n)
{
     c80:	55                   	push   %ebp
     c81:	89 e5                	mov    %esp,%ebp
     c83:	8b 45 10             	mov    0x10(%ebp),%eax
     c86:	53                   	push   %ebx
     c87:	8b 5d 08             	mov    0x8(%ebp),%ebx
  char *d;
  
  d = dst;
  while(n-- > 0)
     c8a:	85 c0                	test   %eax,%eax
     c8c:	74 1a                	je     ca8 <memset+0x28>
     c8e:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
     c92:	31 d2                	xor    %edx,%edx
     c94:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
     c9a:	8d bf 00 00 00 00    	lea    0x0(%edi),%edi
    *d++ = c;
     ca0:	88 0c 1a             	mov    %cl,(%edx,%ebx,1)
     ca3:	42                   	inc    %edx
     ca4:	39 d0                	cmp    %edx,%eax
     ca6:	75 f8                	jne    ca0 <memset+0x20>
  return dst;
}
     ca8:	89 d8                	mov    %ebx,%eax
     caa:	5b                   	pop    %ebx
     cab:	5d                   	pop    %ebp
     cac:	c3                   	ret    
     cad:	8d 76 00             	lea    0x0(%esi),%esi

00000cb0 <strchr>:

char*
strchr(const char *s, char c)
{
     cb0:	55                   	push   %ebp
     cb1:	89 e5                	mov    %esp,%ebp
     cb3:	8b 45 08             	mov    0x8(%ebp),%eax
     cb6:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
  for(; *s; s++)
     cba:	0f b6 10             	movzbl (%eax),%edx
     cbd:	84 d2                	test   %dl,%dl
     cbf:	74 19                	je     cda <strchr+0x2a>
    if(*s == c)
     cc1:	38 d1                	cmp    %dl,%cl
     cc3:	75 0d                	jne    cd2 <strchr+0x22>
     cc5:	eb 15                	jmp    cdc <strchr+0x2c>
     cc7:	38 ca                	cmp    %cl,%dl
     cc9:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
     cd0:	74 0a                	je     cdc <strchr+0x2c>
     cd2:	40                   	inc    %eax
     cd3:	0f b6 10             	movzbl (%eax),%edx
     cd6:	84 d2                	test   %dl,%dl
     cd8:	75 ed                	jne    cc7 <strchr+0x17>
     cda:	31 c0                	xor    %eax,%eax
      return (char*) s;
  return 0;
}
     cdc:	5d                   	pop    %ebp
     cdd:	c3                   	ret    
     cde:	89 f6                	mov    %esi,%esi

00000ce0 <atoi>:

char*
gets(char *buf, int max)
{
  int i, cc;
  char c;

  for(i=0; i+1 < max; ){
    cc = read(0, &c, 1);
    if(cc < 1)
      break;
    buf[i++] = c;
    if(c == '\n' || c == '\r')
      break;
  }
  buf[i] = '\0';
  return buf;
}

int
stat(char *n, struct stat *st)
{
  int fd;
  int r;

  fd = open(n, O_RDONLY);
  if(fd < 0)
    return -1;
  r = fstat(fd, st);
  close(fd);
  return r;
}

int
atoi(const char *s)
{
     ce0:	55                   	push   %ebp
     ce1:	89 e5                	mov    %esp,%ebp
     ce3:	8b 4d 08             	mov    0x8(%ebp),%ecx
     ce6:	53                   	push   %ebx
  int n;

  n = 0;
  while('0' <= *s && *s <= '9')
     ce7:	31 db                	xor    %ebx,%ebx
     ce9:	0f b6 11             	movzbl (%ecx),%edx
     cec:	88 d0                	mov    %dl,%al
     cee:	2c 30                	sub    $0x30,%al
     cf0:	3c 09                	cmp    $0x9,%al
     cf2:	77 23                	ja     d17 <atoi+0x37>
     cf4:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
     cfa:	8d bf 00 00 00 00    	lea    0x0(%edi),%edi
    n = n*10 + *s++ - '0';
     d00:	8d 04 9b             	lea    (%ebx,%ebx,4),%eax
     d03:	0f be d2             	movsbl %dl,%edx
     d06:	8d 5c 42 d0          	lea    0xffffffd0(%edx,%eax,2),%ebx
     d0a:	0f b6 51 01          	movzbl 0x1(%ecx),%edx
     d0e:	41                   	inc    %ecx
     d0f:	88 d0                	mov    %dl,%al
     d11:	2c 30                	sub    $0x30,%al
     d13:	3c 09                	cmp    $0x9,%al
     d15:	76 e9                	jbe    d00 <atoi+0x20>
  return n;
}
     d17:	89 d8                	mov    %ebx,%eax
     d19:	5b                   	pop    %ebx
     d1a:	5d                   	pop    %ebp
     d1b:	c3                   	ret    
     d1c:	8d 74 26 00          	lea    0x0(%esi),%esi

00000d20 <memmove>:

void*
memmove(void *vdst, void *vsrc, int n)
{
     d20:	55                   	push   %ebp
     d21:	89 e5                	mov    %esp,%ebp
     d23:	8b 4d 10             	mov    0x10(%ebp),%ecx
     d26:	56                   	push   %esi
     d27:	8b 75 08             	mov    0x8(%ebp),%esi
     d2a:	53                   	push   %ebx
     d2b:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  char *dst, *src;
  
  dst = vdst;
  src = vsrc;
  while(n-- > 0)
     d2e:	85 c9                	test   %ecx,%ecx
     d30:	7e 1a                	jle    d4c <memmove+0x2c>
     d32:	31 d2                	xor    %edx,%edx
     d34:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
     d3a:	8d bf 00 00 00 00    	lea    0x0(%edi),%edi
    *dst++ = *src++;
     d40:	0f b6 04 1a          	movzbl (%edx,%ebx,1),%eax
     d44:	88 04 32             	mov    %al,(%edx,%esi,1)
     d47:	42                   	inc    %edx
     d48:	39 ca                	cmp    %ecx,%edx
     d4a:	75 f4                	jne    d40 <memmove+0x20>
  return vdst;
}
     d4c:	5b                   	pop    %ebx
     d4d:	89 f0                	mov    %esi,%eax
     d4f:	5e                   	pop    %esi
     d50:	5d                   	pop    %ebp
     d51:	c3                   	ret    
     d52:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
     d59:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00000d60 <stat>:
     d60:	55                   	push   %ebp
     d61:	31 c0                	xor    %eax,%eax
     d63:	89 e5                	mov    %esp,%ebp
     d65:	83 ec 18             	sub    $0x18,%esp
     d68:	89 44 24 04          	mov    %eax,0x4(%esp)
     d6c:	8b 45 08             	mov    0x8(%ebp),%eax
     d6f:	89 5d f8             	mov    %ebx,0xfffffff8(%ebp)
     d72:	89 75 fc             	mov    %esi,0xfffffffc(%ebp)
     d75:	be ff ff ff ff       	mov    $0xffffffff,%esi
     d7a:	89 04 24             	mov    %eax,(%esp)
     d7d:	e8 ea 00 00 00       	call   e6c <open>
     d82:	85 c0                	test   %eax,%eax
     d84:	89 c3                	mov    %eax,%ebx
     d86:	78 19                	js     da1 <stat+0x41>
     d88:	8b 45 0c             	mov    0xc(%ebp),%eax
     d8b:	89 1c 24             	mov    %ebx,(%esp)
     d8e:	89 44 24 04          	mov    %eax,0x4(%esp)
     d92:	e8 ed 00 00 00       	call   e84 <fstat>
     d97:	89 1c 24             	mov    %ebx,(%esp)
     d9a:	89 c6                	mov    %eax,%esi
     d9c:	e8 b3 00 00 00       	call   e54 <close>
     da1:	89 f0                	mov    %esi,%eax
     da3:	8b 5d f8             	mov    0xfffffff8(%ebp),%ebx
     da6:	8b 75 fc             	mov    0xfffffffc(%ebp),%esi
     da9:	89 ec                	mov    %ebp,%esp
     dab:	5d                   	pop    %ebp
     dac:	c3                   	ret    
     dad:	8d 76 00             	lea    0x0(%esi),%esi

00000db0 <gets>:
     db0:	55                   	push   %ebp
     db1:	89 e5                	mov    %esp,%ebp
     db3:	57                   	push   %edi
     db4:	56                   	push   %esi
     db5:	31 f6                	xor    %esi,%esi
     db7:	53                   	push   %ebx
     db8:	83 ec 1c             	sub    $0x1c,%esp
     dbb:	8d 5e 01             	lea    0x1(%esi),%ebx
     dbe:	8b 7d 08             	mov    0x8(%ebp),%edi
     dc1:	3b 5d 0c             	cmp    0xc(%ebp),%ebx
     dc4:	7d 3e                	jge    e04 <gets+0x54>
     dc6:	ba 01 00 00 00       	mov    $0x1,%edx
     dcb:	8d 45 f3             	lea    0xfffffff3(%ebp),%eax
     dce:	89 54 24 08          	mov    %edx,0x8(%esp)
     dd2:	89 44 24 04          	mov    %eax,0x4(%esp)
     dd6:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
     ddd:	e8 62 00 00 00       	call   e44 <read>
     de2:	85 c0                	test   %eax,%eax
     de4:	7e 1e                	jle    e04 <gets+0x54>
     de6:	0f b6 45 f3          	movzbl 0xfffffff3(%ebp),%eax
     dea:	88 44 3b ff          	mov    %al,0xffffffff(%ebx,%edi,1)
     dee:	0f b6 45 f3          	movzbl 0xfffffff3(%ebp),%eax
     df2:	3c 0a                	cmp    $0xa,%al
     df4:	74 1c                	je     e12 <gets+0x62>
     df6:	3c 0d                	cmp    $0xd,%al
     df8:	74 18                	je     e12 <gets+0x62>
     dfa:	89 de                	mov    %ebx,%esi
     dfc:	8d 5e 01             	lea    0x1(%esi),%ebx
     dff:	3b 5d 0c             	cmp    0xc(%ebp),%ebx
     e02:	7c c2                	jl     dc6 <gets+0x16>
     e04:	c6 04 3e 00          	movb   $0x0,(%esi,%edi,1)
     e08:	83 c4 1c             	add    $0x1c,%esp
     e0b:	89 f8                	mov    %edi,%eax
     e0d:	5b                   	pop    %ebx
     e0e:	5e                   	pop    %esi
     e0f:	5f                   	pop    %edi
     e10:	5d                   	pop    %ebp
     e11:	c3                   	ret    
     e12:	89 de                	mov    %ebx,%esi
     e14:	89 f8                	mov    %edi,%eax
     e16:	c6 04 3e 00          	movb   $0x0,(%esi,%edi,1)
     e1a:	83 c4 1c             	add    $0x1c,%esp
     e1d:	5b                   	pop    %ebx
     e1e:	5e                   	pop    %esi
     e1f:	5f                   	pop    %edi
     e20:	5d                   	pop    %ebp
     e21:	c3                   	ret    
     e22:	90                   	nop    
     e23:	90                   	nop    

00000e24 <fork>:
     e24:	b8 01 00 00 00       	mov    $0x1,%eax
     e29:	cd 30                	int    $0x30
     e2b:	c3                   	ret    

00000e2c <exit>:
     e2c:	b8 02 00 00 00       	mov    $0x2,%eax
     e31:	cd 30                	int    $0x30
     e33:	c3                   	ret    

00000e34 <wait>:
     e34:	b8 03 00 00 00       	mov    $0x3,%eax
     e39:	cd 30                	int    $0x30
     e3b:	c3                   	ret    

00000e3c <pipe>:
     e3c:	b8 04 00 00 00       	mov    $0x4,%eax
     e41:	cd 30                	int    $0x30
     e43:	c3                   	ret    

00000e44 <read>:
     e44:	b8 06 00 00 00       	mov    $0x6,%eax
     e49:	cd 30                	int    $0x30
     e4b:	c3                   	ret    

00000e4c <write>:
     e4c:	b8 05 00 00 00       	mov    $0x5,%eax
     e51:	cd 30                	int    $0x30
     e53:	c3                   	ret    

00000e54 <close>:
     e54:	b8 07 00 00 00       	mov    $0x7,%eax
     e59:	cd 30                	int    $0x30
     e5b:	c3                   	ret    

00000e5c <kill>:
     e5c:	b8 08 00 00 00       	mov    $0x8,%eax
     e61:	cd 30                	int    $0x30
     e63:	c3                   	ret    

00000e64 <exec>:
     e64:	b8 09 00 00 00       	mov    $0x9,%eax
     e69:	cd 30                	int    $0x30
     e6b:	c3                   	ret    

00000e6c <open>:
     e6c:	b8 0a 00 00 00       	mov    $0xa,%eax
     e71:	cd 30                	int    $0x30
     e73:	c3                   	ret    

00000e74 <mknod>:
     e74:	b8 0b 00 00 00       	mov    $0xb,%eax
     e79:	cd 30                	int    $0x30
     e7b:	c3                   	ret    

00000e7c <unlink>:
     e7c:	b8 0c 00 00 00       	mov    $0xc,%eax
     e81:	cd 30                	int    $0x30
     e83:	c3                   	ret    

00000e84 <fstat>:
     e84:	b8 0d 00 00 00       	mov    $0xd,%eax
     e89:	cd 30                	int    $0x30
     e8b:	c3                   	ret    

00000e8c <link>:
     e8c:	b8 0e 00 00 00       	mov    $0xe,%eax
     e91:	cd 30                	int    $0x30
     e93:	c3                   	ret    

00000e94 <mkdir>:
     e94:	b8 0f 00 00 00       	mov    $0xf,%eax
     e99:	cd 30                	int    $0x30
     e9b:	c3                   	ret    

00000e9c <chdir>:
     e9c:	b8 10 00 00 00       	mov    $0x10,%eax
     ea1:	cd 30                	int    $0x30
     ea3:	c3                   	ret    

00000ea4 <dup>:
     ea4:	b8 11 00 00 00       	mov    $0x11,%eax
     ea9:	cd 30                	int    $0x30
     eab:	c3                   	ret    

00000eac <getpid>:
     eac:	b8 12 00 00 00       	mov    $0x12,%eax
     eb1:	cd 30                	int    $0x30
     eb3:	c3                   	ret    

00000eb4 <sbrk>:
     eb4:	b8 13 00 00 00       	mov    $0x13,%eax
     eb9:	cd 30                	int    $0x30
     ebb:	c3                   	ret    

00000ebc <sleep>:
     ebc:	b8 14 00 00 00       	mov    $0x14,%eax
     ec1:	cd 30                	int    $0x30
     ec3:	c3                   	ret    
     ec4:	90                   	nop    
     ec5:	90                   	nop    
     ec6:	90                   	nop    
     ec7:	90                   	nop    
     ec8:	90                   	nop    
     ec9:	90                   	nop    
     eca:	90                   	nop    
     ecb:	90                   	nop    
     ecc:	90                   	nop    
     ecd:	90                   	nop    
     ece:	90                   	nop    
     ecf:	90                   	nop    

00000ed0 <putc>:
#include "user.h"

static void
putc(int fd, char c)
{
     ed0:	55                   	push   %ebp
     ed1:	89 e5                	mov    %esp,%ebp
     ed3:	83 ec 18             	sub    $0x18,%esp
     ed6:	88 55 fc             	mov    %dl,0xfffffffc(%ebp)
  write(fd, &c, 1);
     ed9:	ba 01 00 00 00       	mov    $0x1,%edx
     ede:	89 54 24 08          	mov    %edx,0x8(%esp)
     ee2:	8d 55 fc             	lea    0xfffffffc(%ebp),%edx
     ee5:	89 54 24 04          	mov    %edx,0x4(%esp)
     ee9:	89 04 24             	mov    %eax,(%esp)
     eec:	e8 5b ff ff ff       	call   e4c <write>
}
     ef1:	c9                   	leave  
     ef2:	c3                   	ret    
     ef3:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
     ef9:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00000f00 <printint>:

static void
printint(int fd, int xx, int base, int sgn)
{
     f00:	55                   	push   %ebp
     f01:	89 e5                	mov    %esp,%ebp
     f03:	57                   	push   %edi
     f04:	56                   	push   %esi
     f05:	89 ce                	mov    %ecx,%esi
     f07:	53                   	push   %ebx
     f08:	83 ec 1c             	sub    $0x1c,%esp
  static char digits[] = "0123456789ABCDEF";
  char buf[16];
  int i, neg;
  uint x;

  neg = 0;
  if(sgn && xx < 0){
     f0b:	8b 5d 08             	mov    0x8(%ebp),%ebx
     f0e:	89 45 dc             	mov    %eax,0xffffffdc(%ebp)
     f11:	85 db                	test   %ebx,%ebx
     f13:	74 04                	je     f19 <printint+0x19>
     f15:	85 d2                	test   %edx,%edx
     f17:	78 62                	js     f7b <printint+0x7b>
    neg = 1;
    x = -xx;
  } else {
    x = xx;
     f19:	89 d0                	mov    %edx,%eax
     f1b:	c7 45 e0 00 00 00 00 	movl   $0x0,0xffffffe0(%ebp)
     f22:	31 db                	xor    %ebx,%ebx
     f24:	8d 7d e4             	lea    0xffffffe4(%ebp),%edi
     f27:	89 f6                	mov    %esi,%esi
     f29:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi
  }

  i = 0;
  do{
    buf[i++] = digits[x % base];
     f30:	31 d2                	xor    %edx,%edx
     f32:	f7 f6                	div    %esi
     f34:	89 c1                	mov    %eax,%ecx
     f36:	0f b6 82 6a 13 00 00 	movzbl 0x136a(%edx),%eax
     f3d:	88 04 3b             	mov    %al,(%ebx,%edi,1)
     f40:	43                   	inc    %ebx
  }while((x /= base) != 0);
     f41:	85 c9                	test   %ecx,%ecx
     f43:	89 c8                	mov    %ecx,%eax
     f45:	75 e9                	jne    f30 <printint+0x30>
  if(neg)
     f47:	8b 4d e0             	mov    0xffffffe0(%ebp),%ecx
     f4a:	85 c9                	test   %ecx,%ecx
     f4c:	74 06                	je     f54 <printint+0x54>
    buf[i++] = '-';
     f4e:	c6 44 1d e4 2d       	movb   $0x2d,0xffffffe4(%ebp,%ebx,1)
     f53:	43                   	inc    %ebx

  while(--i >= 0)
     f54:	4b                   	dec    %ebx
     f55:	78 1c                	js     f73 <printint+0x73>
     f57:	89 f6                	mov    %esi,%esi
     f59:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi
    putc(fd, buf[i]);
     f60:	0f be 54 1d e4       	movsbl 0xffffffe4(%ebp,%ebx,1),%edx
     f65:	4b                   	dec    %ebx
     f66:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
     f69:	e8 62 ff ff ff       	call   ed0 <putc>
     f6e:	83 fb ff             	cmp    $0xffffffff,%ebx
     f71:	75 ed                	jne    f60 <printint+0x60>
}
     f73:	83 c4 1c             	add    $0x1c,%esp
     f76:	5b                   	pop    %ebx
     f77:	5e                   	pop    %esi
     f78:	5f                   	pop    %edi
     f79:	5d                   	pop    %ebp
     f7a:	c3                   	ret    
     f7b:	89 d0                	mov    %edx,%eax
     f7d:	f7 d8                	neg    %eax
     f7f:	c7 45 e0 01 00 00 00 	movl   $0x1,0xffffffe0(%ebp)
     f86:	eb 9a                	jmp    f22 <printint+0x22>
     f88:	90                   	nop    
     f89:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

00000f90 <printf>:

// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
     f90:	55                   	push   %ebp
     f91:	89 e5                	mov    %esp,%ebp
     f93:	57                   	push   %edi
     f94:	56                   	push   %esi
     f95:	53                   	push   %ebx
     f96:	83 ec 0c             	sub    $0xc,%esp
  char *s;
  int c, i, state;
  uint *ap;

  state = 0;
  ap = (uint*)(void*)&fmt + 1;
  for(i = 0; fmt[i]; i++){
     f99:	8b 55 0c             	mov    0xc(%ebp),%edx
     f9c:	0f b6 02             	movzbl (%edx),%eax
     f9f:	84 c0                	test   %al,%al
     fa1:	0f 84 99 00 00 00    	je     1040 <printf+0xb0>
     fa7:	8d 4d 10             	lea    0x10(%ebp),%ecx
     faa:	31 ff                	xor    %edi,%edi
     fac:	31 f6                	xor    %esi,%esi
     fae:	89 4d f0             	mov    %ecx,0xfffffff0(%ebp)
     fb1:	eb 26                	jmp    fd9 <printf+0x49>
    c = fmt[i] & 0xff;
    if(state == 0){
      if(c == '%'){
     fb3:	83 fb 25             	cmp    $0x25,%ebx
     fb6:	0f 85 8c 00 00 00    	jne    1048 <printf+0xb8>
     fbc:	be 25 00 00 00       	mov    $0x25,%esi
     fc1:	eb 0d                	jmp    fd0 <printf+0x40>
     fc3:	90                   	nop    
     fc4:	90                   	nop    
     fc5:	90                   	nop    
     fc6:	90                   	nop    
     fc7:	90                   	nop    
     fc8:	90                   	nop    
     fc9:	90                   	nop    
     fca:	90                   	nop    
     fcb:	90                   	nop    
     fcc:	90                   	nop    
     fcd:	90                   	nop    
     fce:	90                   	nop    
     fcf:	90                   	nop    
     fd0:	47                   	inc    %edi
     fd1:	0f b6 04 3a          	movzbl (%edx,%edi,1),%eax
     fd5:	84 c0                	test   %al,%al
     fd7:	74 67                	je     1040 <printf+0xb0>
     fd9:	85 f6                	test   %esi,%esi
     fdb:	0f b6 d8             	movzbl %al,%ebx
     fde:	74 d3                	je     fb3 <printf+0x23>
        state = '%';
      } else {
        putc(fd, c);
      }
    } else if(state == '%'){
     fe0:	83 fe 25             	cmp    $0x25,%esi
     fe3:	75 eb                	jne    fd0 <printf+0x40>
      if(c == 'd'){
     fe5:	83 fb 64             	cmp    $0x64,%ebx
     fe8:	0f 84 e0 00 00 00    	je     10ce <printf+0x13e>
        printint(fd, *ap, 10, 1);
        ap++;
      } else if(c == 'x' || c == 'p'){
     fee:	83 fb 78             	cmp    $0x78,%ebx
     ff1:	74 68                	je     105b <printf+0xcb>
     ff3:	83 fb 70             	cmp    $0x70,%ebx
     ff6:	74 63                	je     105b <printf+0xcb>
        printint(fd, *ap, 16, 0);
        ap++;
      } else if(c == 's'){
     ff8:	83 fb 73             	cmp    $0x73,%ebx
     ffb:	90                   	nop    
     ffc:	8d 74 26 00          	lea    0x0(%esi),%esi
    1000:	0f 84 7c 00 00 00    	je     1082 <printf+0xf2>
        s = (char*)*ap;
        ap++;
        if(s == 0)
          s = "(null)";
        while(*s != 0){
          putc(fd, *s);
          s++;
        }
      } else if(c == 'c'){
    1006:	83 fb 63             	cmp    $0x63,%ebx
    1009:	0f 84 e4 00 00 00    	je     10f3 <printf+0x163>
        putc(fd, *ap);
        ap++;
      } else if(c == '%'){
    100f:	83 fb 25             	cmp    $0x25,%ebx
    1012:	0f 84 c4 00 00 00    	je     10dc <printf+0x14c>
        putc(fd, c);
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
    1018:	8b 45 08             	mov    0x8(%ebp),%eax
    101b:	ba 25 00 00 00       	mov    $0x25,%edx
    1020:	47                   	inc    %edi
        putc(fd, c);
    1021:	31 f6                	xor    %esi,%esi
    1023:	e8 a8 fe ff ff       	call   ed0 <putc>
    1028:	8b 45 08             	mov    0x8(%ebp),%eax
    102b:	0f be d3             	movsbl %bl,%edx
    102e:	e8 9d fe ff ff       	call   ed0 <putc>
    1033:	8b 55 0c             	mov    0xc(%ebp),%edx
    1036:	0f b6 04 3a          	movzbl (%edx,%edi,1),%eax
    103a:	84 c0                	test   %al,%al
    103c:	75 9b                	jne    fd9 <printf+0x49>
    103e:	89 f6                	mov    %esi,%esi
      }
      state = 0;
    }
  }
}
    1040:	83 c4 0c             	add    $0xc,%esp
    1043:	5b                   	pop    %ebx
    1044:	5e                   	pop    %esi
    1045:	5f                   	pop    %edi
    1046:	5d                   	pop    %ebp
    1047:	c3                   	ret    
    1048:	8b 45 08             	mov    0x8(%ebp),%eax
    104b:	0f be d3             	movsbl %bl,%edx
    104e:	e8 7d fe ff ff       	call   ed0 <putc>
    1053:	8b 55 0c             	mov    0xc(%ebp),%edx
    1056:	e9 75 ff ff ff       	jmp    fd0 <printf+0x40>
    105b:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
    1062:	b9 10 00 00 00       	mov    $0x10,%ecx
    1067:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
    106a:	31 f6                	xor    %esi,%esi
    106c:	8b 10                	mov    (%eax),%edx
    106e:	8b 45 08             	mov    0x8(%ebp),%eax
    1071:	e8 8a fe ff ff       	call   f00 <printint>
    1076:	8b 55 0c             	mov    0xc(%ebp),%edx
    1079:	83 45 f0 04          	addl   $0x4,0xfffffff0(%ebp)
    107d:	e9 4e ff ff ff       	jmp    fd0 <printf+0x40>
    1082:	8b 4d f0             	mov    0xfffffff0(%ebp),%ecx
    1085:	8b 01                	mov    (%ecx),%eax
    1087:	83 c1 04             	add    $0x4,%ecx
    108a:	89 4d f0             	mov    %ecx,0xfffffff0(%ebp)
    108d:	b9 63 13 00 00       	mov    $0x1363,%ecx
    1092:	85 c0                	test   %eax,%eax
    1094:	74 02                	je     1098 <printf+0x108>
    1096:	89 c1                	mov    %eax,%ecx
    1098:	0f b6 01             	movzbl (%ecx),%eax
    109b:	84 c0                	test   %al,%al
    109d:	74 28                	je     10c7 <printf+0x137>
    109f:	89 cb                	mov    %ecx,%ebx
    10a1:	eb 0d                	jmp    10b0 <printf+0x120>
    10a3:	90                   	nop    
    10a4:	90                   	nop    
    10a5:	90                   	nop    
    10a6:	90                   	nop    
    10a7:	90                   	nop    
    10a8:	90                   	nop    
    10a9:	90                   	nop    
    10aa:	90                   	nop    
    10ab:	90                   	nop    
    10ac:	90                   	nop    
    10ad:	90                   	nop    
    10ae:	90                   	nop    
    10af:	90                   	nop    
    10b0:	0f be d0             	movsbl %al,%edx
    10b3:	8b 45 08             	mov    0x8(%ebp),%eax
    10b6:	e8 15 fe ff ff       	call   ed0 <putc>
    10bb:	0f b6 43 01          	movzbl 0x1(%ebx),%eax
    10bf:	43                   	inc    %ebx
    10c0:	84 c0                	test   %al,%al
    10c2:	75 ec                	jne    10b0 <printf+0x120>
    10c4:	8b 55 0c             	mov    0xc(%ebp),%edx
    10c7:	31 f6                	xor    %esi,%esi
    10c9:	e9 02 ff ff ff       	jmp    fd0 <printf+0x40>
    10ce:	b9 0a 00 00 00       	mov    $0xa,%ecx
    10d3:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
    10da:	eb 8b                	jmp    1067 <printf+0xd7>
    10dc:	8b 45 08             	mov    0x8(%ebp),%eax
    10df:	ba 25 00 00 00       	mov    $0x25,%edx
    10e4:	31 f6                	xor    %esi,%esi
    10e6:	e8 e5 fd ff ff       	call   ed0 <putc>
    10eb:	8b 55 0c             	mov    0xc(%ebp),%edx
    10ee:	e9 dd fe ff ff       	jmp    fd0 <printf+0x40>
    10f3:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
    10f6:	31 f6                	xor    %esi,%esi
    10f8:	0f be 10             	movsbl (%eax),%edx
    10fb:	8b 45 08             	mov    0x8(%ebp),%eax
    10fe:	e8 cd fd ff ff       	call   ed0 <putc>
    1103:	8b 55 0c             	mov    0xc(%ebp),%edx
    1106:	83 45 f0 04          	addl   $0x4,0xfffffff0(%ebp)
    110a:	e9 c1 fe ff ff       	jmp    fd0 <printf+0x40>
    110f:	90                   	nop    

00001110 <free>:
static Header *freep;

void
free(void *ap)
{
    1110:	55                   	push   %ebp
  Header *bp, *p;

  bp = (Header*) ap - 1;
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
    1111:	8b 0d 0c 14 00 00    	mov    0x140c,%ecx
    1117:	89 e5                	mov    %esp,%ebp
    1119:	56                   	push   %esi
    111a:	53                   	push   %ebx
    111b:	8b 5d 08             	mov    0x8(%ebp),%ebx
    111e:	83 eb 08             	sub    $0x8,%ebx
    1121:	eb 0d                	jmp    1130 <free+0x20>
    1123:	90                   	nop    
    1124:	90                   	nop    
    1125:	90                   	nop    
    1126:	90                   	nop    
    1127:	90                   	nop    
    1128:	90                   	nop    
    1129:	90                   	nop    
    112a:	90                   	nop    
    112b:	90                   	nop    
    112c:	90                   	nop    
    112d:	90                   	nop    
    112e:	90                   	nop    
    112f:	90                   	nop    
    1130:	39 d9                	cmp    %ebx,%ecx
    1132:	73 04                	jae    1138 <free+0x28>
    1134:	3b 19                	cmp    (%ecx),%ebx
    1136:	72 12                	jb     114a <free+0x3a>
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
    1138:	8b 11                	mov    (%ecx),%edx
    113a:	39 d1                	cmp    %edx,%ecx
    113c:	72 08                	jb     1146 <free+0x36>
    113e:	39 d9                	cmp    %ebx,%ecx
    1140:	72 0a                	jb     114c <free+0x3c>
    1142:	39 d3                	cmp    %edx,%ebx
    1144:	72 06                	jb     114c <free+0x3c>
    1146:	89 d1                	mov    %edx,%ecx
    1148:	eb e6                	jmp    1130 <free+0x20>
    114a:	8b 11                	mov    (%ecx),%edx
      break;
  if(bp + bp->s.size == p->s.ptr){
    114c:	8b 73 04             	mov    0x4(%ebx),%esi
    114f:	8d 04 f3             	lea    (%ebx,%esi,8),%eax
    1152:	39 d0                	cmp    %edx,%eax
    1154:	74 2e                	je     1184 <free+0x74>
    bp->s.size += p->s.ptr->s.size;
    bp->s.ptr = p->s.ptr->s.ptr;
  } else
    bp->s.ptr = p->s.ptr;
    1156:	89 13                	mov    %edx,(%ebx)
  if(p + p->s.size == bp){
    1158:	8b 51 04             	mov    0x4(%ecx),%edx
    115b:	8d 04 d1             	lea    (%ecx,%edx,8),%eax
    115e:	39 c3                	cmp    %eax,%ebx
    1160:	74 0c                	je     116e <free+0x5e>
    p->s.size += bp->s.size;
    p->s.ptr = bp->s.ptr;
  } else
    p->s.ptr = bp;
    1162:	89 19                	mov    %ebx,(%ecx)
  freep = p;
}
    1164:	5b                   	pop    %ebx
    1165:	89 0d 0c 14 00 00    	mov    %ecx,0x140c
    116b:	5e                   	pop    %esi
    116c:	5d                   	pop    %ebp
    116d:	c3                   	ret    
    116e:	8b 43 04             	mov    0x4(%ebx),%eax
    1171:	01 c2                	add    %eax,%edx
    1173:	8b 03                	mov    (%ebx),%eax
    1175:	89 51 04             	mov    %edx,0x4(%ecx)
    1178:	89 01                	mov    %eax,(%ecx)
    117a:	5b                   	pop    %ebx
    117b:	89 0d 0c 14 00 00    	mov    %ecx,0x140c
    1181:	5e                   	pop    %esi
    1182:	5d                   	pop    %ebp
    1183:	c3                   	ret    
    1184:	8b 42 04             	mov    0x4(%edx),%eax
    1187:	01 c6                	add    %eax,%esi
    1189:	8b 02                	mov    (%edx),%eax
    118b:	89 73 04             	mov    %esi,0x4(%ebx)
    118e:	89 03                	mov    %eax,(%ebx)
    1190:	eb c6                	jmp    1158 <free+0x48>
    1192:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
    1199:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

000011a0 <malloc>:

static Header*
morecore(uint nu)
{
  char *p;
  Header *hp;

  if(nu < PAGE)
    nu = PAGE;
  p = sbrk(nu * sizeof(Header));
  if(p == (char*) -1)
    return 0;
  hp = (Header*)p;
  hp->s.size = nu;
  free((void*)(hp + 1));
  return freep;
}

void*
malloc(uint nbytes)
{
    11a0:	55                   	push   %ebp
    11a1:	89 e5                	mov    %esp,%ebp
    11a3:	57                   	push   %edi
    11a4:	56                   	push   %esi
    11a5:	53                   	push   %ebx
    11a6:	83 ec 0c             	sub    $0xc,%esp
  Header *p, *prevp;
  uint nunits;

  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
    11a9:	8b 45 08             	mov    0x8(%ebp),%eax
  if((prevp = freep) == 0){
    11ac:	8b 15 0c 14 00 00    	mov    0x140c,%edx
    11b2:	83 c0 07             	add    $0x7,%eax
    11b5:	c1 e8 03             	shr    $0x3,%eax
    11b8:	85 d2                	test   %edx,%edx
    11ba:	8d 58 01             	lea    0x1(%eax),%ebx
    11bd:	0f 84 92 00 00 00    	je     1255 <malloc+0xb5>
    base.s.ptr = freep = prevp = &base;
    base.s.size = 0;
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
    11c3:	8b 0a                	mov    (%edx),%ecx
    if(p->s.size >= nunits){
    11c5:	8b 41 04             	mov    0x4(%ecx),%eax
    11c8:	39 c3                	cmp    %eax,%ebx
    11ca:	76 63                	jbe    122f <malloc+0x8f>
      if(p->s.size == nunits)
        prevp->s.ptr = p->s.ptr;
      else {
        p->s.size -= nunits;
        p += p->s.size;
        p->s.size = nunits;
      }
      freep = prevp;
      return (void*) (p + 1);
    11cc:	8d 3c dd 00 00 00 00 	lea    0x0(,%ebx,8),%edi
    11d3:	eb 09                	jmp    11de <malloc+0x3e>
    11d5:	8b 0a                	mov    (%edx),%ecx
    11d7:	8b 41 04             	mov    0x4(%ecx),%eax
    11da:	39 c3                	cmp    %eax,%ebx
    11dc:	76 51                	jbe    122f <malloc+0x8f>
    }
    if(p == freep)
    11de:	39 0d 0c 14 00 00    	cmp    %ecx,0x140c
    11e4:	89 ca                	mov    %ecx,%edx
    11e6:	75 ed                	jne    11d5 <malloc+0x35>
    11e8:	81 fb ff 0f 00 00    	cmp    $0xfff,%ebx
    11ee:	77 39                	ja     1229 <malloc+0x89>
    11f0:	be 00 10 00 00       	mov    $0x1000,%esi
    11f5:	b8 00 80 00 00       	mov    $0x8000,%eax
    11fa:	89 04 24             	mov    %eax,(%esp)
    11fd:	e8 b2 fc ff ff       	call   eb4 <sbrk>
    1202:	83 f8 ff             	cmp    $0xffffffff,%eax
    1205:	74 18                	je     121f <malloc+0x7f>
    1207:	89 70 04             	mov    %esi,0x4(%eax)
    120a:	83 c0 08             	add    $0x8,%eax
    120d:	89 04 24             	mov    %eax,(%esp)
    1210:	e8 fb fe ff ff       	call   1110 <free>
    1215:	8b 15 0c 14 00 00    	mov    0x140c,%edx
      if((p = morecore(nunits)) == 0)
    121b:	85 d2                	test   %edx,%edx
    121d:	75 b6                	jne    11d5 <malloc+0x35>
        return 0;
  }
}
    121f:	83 c4 0c             	add    $0xc,%esp
    1222:	31 c0                	xor    %eax,%eax
    1224:	5b                   	pop    %ebx
    1225:	5e                   	pop    %esi
    1226:	5f                   	pop    %edi
    1227:	5d                   	pop    %ebp
    1228:	c3                   	ret    
    1229:	89 de                	mov    %ebx,%esi
    122b:	89 f8                	mov    %edi,%eax
    122d:	eb cb                	jmp    11fa <malloc+0x5a>
    122f:	39 c3                	cmp    %eax,%ebx
    1231:	74 1c                	je     124f <malloc+0xaf>
    1233:	29 d8                	sub    %ebx,%eax
    1235:	89 41 04             	mov    %eax,0x4(%ecx)
    1238:	8d 0c c1             	lea    (%ecx,%eax,8),%ecx
    123b:	89 59 04             	mov    %ebx,0x4(%ecx)
    123e:	89 15 0c 14 00 00    	mov    %edx,0x140c
    1244:	83 c4 0c             	add    $0xc,%esp
    1247:	5b                   	pop    %ebx
    1248:	8d 41 08             	lea    0x8(%ecx),%eax
    124b:	5e                   	pop    %esi
    124c:	5f                   	pop    %edi
    124d:	5d                   	pop    %ebp
    124e:	c3                   	ret    
    124f:	8b 01                	mov    (%ecx),%eax
    1251:	89 02                	mov    %eax,(%edx)
    1253:	eb e9                	jmp    123e <malloc+0x9e>
    1255:	b8 04 14 00 00       	mov    $0x1404,%eax
    125a:	ba 04 14 00 00       	mov    $0x1404,%edx
    125f:	a3 0c 14 00 00       	mov    %eax,0x140c
    1264:	b8 04 14 00 00       	mov    $0x1404,%eax
    1269:	a3 04 14 00 00       	mov    %eax,0x1404
    126e:	31 c0                	xor    %eax,%eax
    1270:	a3 08 14 00 00       	mov    %eax,0x1408
    1275:	e9 49 ff ff ff       	jmp    11c3 <malloc+0x23>
