
_echo:     file format elf32-i386

Disassembly of section .text:

00000000 <main>:
#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  0xfffffffc(%ecx)
   a:	55                   	push   %ebp
   b:	89 e5                	mov    %esp,%ebp
   d:	83 ec 28             	sub    $0x28,%esp
  10:	89 4d f0             	mov    %ecx,0xfffffff0(%ebp)
  13:	89 5d f4             	mov    %ebx,0xfffffff4(%ebp)
  16:	89 75 f8             	mov    %esi,0xfffffff8(%ebp)
  19:	89 7d fc             	mov    %edi,0xfffffffc(%ebp)
  1c:	8b 31                	mov    (%ecx),%esi
  1e:	8b 79 04             	mov    0x4(%ecx),%edi
  int i;

  for(i = 1; i < argc; i++)
  21:	83 fe 01             	cmp    $0x1,%esi
  24:	7e 5b                	jle    81 <main+0x81>
  26:	bb 01 00 00 00       	mov    $0x1,%ebx
    printf(1, "%s%s", argv[i], i+1 < argc ? " " : "\n");
  2b:	43                   	inc    %ebx
  2c:	39 de                	cmp    %ebx,%esi
  2e:	74 2b                	je     5b <main+0x5b>
  30:	b8 fa 06 00 00       	mov    $0x6fa,%eax
  35:	b9 fc 06 00 00       	mov    $0x6fc,%ecx
  3a:	89 44 24 0c          	mov    %eax,0xc(%esp)
  3e:	8b 44 9f fc          	mov    0xfffffffc(%edi,%ebx,4),%eax
  42:	43                   	inc    %ebx
  43:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  47:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  4e:	89 44 24 08          	mov    %eax,0x8(%esp)
  52:	e8 b9 03 00 00       	call   410 <printf>
  57:	39 de                	cmp    %ebx,%esi
  59:	75 d5                	jne    30 <main+0x30>
  5b:	ba 01 07 00 00       	mov    $0x701,%edx
  60:	89 54 24 0c          	mov    %edx,0xc(%esp)
  64:	8b 44 b7 fc          	mov    0xfffffffc(%edi,%esi,4),%eax
  68:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  6f:	89 44 24 08          	mov    %eax,0x8(%esp)
  73:	b8 fc 06 00 00       	mov    $0x6fc,%eax
  78:	89 44 24 04          	mov    %eax,0x4(%esp)
  7c:	e8 8f 03 00 00       	call   410 <printf>
  exit();
  81:	e8 26 02 00 00       	call   2ac <exit>
  86:	90                   	nop    
  87:	90                   	nop    
  88:	90                   	nop    
  89:	90                   	nop    
  8a:	90                   	nop    
  8b:	90                   	nop    
  8c:	90                   	nop    
  8d:	90                   	nop    
  8e:	90                   	nop    
  8f:	90                   	nop    

00000090 <strcpy>:
#include "user.h"

char*
strcpy(char *s, char *t)
{
  90:	55                   	push   %ebp
  91:	89 e5                	mov    %esp,%ebp
  93:	53                   	push   %ebx
  94:	8b 5d 08             	mov    0x8(%ebp),%ebx
  97:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  9a:	89 da                	mov    %ebx,%edx
  9c:	8d 74 26 00          	lea    0x0(%esi),%esi
  char *os;

  os = s;
  while((*s++ = *t++) != 0)
  a0:	0f b6 01             	movzbl (%ecx),%eax
  a3:	41                   	inc    %ecx
  a4:	88 02                	mov    %al,(%edx)
  a6:	42                   	inc    %edx
  a7:	84 c0                	test   %al,%al
  a9:	75 f5                	jne    a0 <strcpy+0x10>
    ;
  return os;
}
  ab:	89 d8                	mov    %ebx,%eax
  ad:	5b                   	pop    %ebx
  ae:	5d                   	pop    %ebp
  af:	c3                   	ret    

000000b0 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  b0:	55                   	push   %ebp
  b1:	89 e5                	mov    %esp,%ebp
  b3:	8b 55 08             	mov    0x8(%ebp),%edx
  b6:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  while(*p && *p == *q)
  b9:	0f b6 02             	movzbl (%edx),%eax
  bc:	84 c0                	test   %al,%al
  be:	75 0c                	jne    cc <strcmp+0x1c>
  c0:	eb 10                	jmp    d2 <strcmp+0x22>
  c2:	0f b6 42 01          	movzbl 0x1(%edx),%eax
    p++, q++;
  c6:	41                   	inc    %ecx
  c7:	84 c0                	test   %al,%al
  c9:	74 07                	je     d2 <strcmp+0x22>
  cb:	42                   	inc    %edx
  cc:	3a 01                	cmp    (%ecx),%al
  ce:	89 f6                	mov    %esi,%esi
  d0:	74 f0                	je     c2 <strcmp+0x12>
  d2:	0f b6 11             	movzbl (%ecx),%edx
  d5:	0f b6 c0             	movzbl %al,%eax
  return (uchar)*p - (uchar)*q;
}
  d8:	5d                   	pop    %ebp
  d9:	29 d0                	sub    %edx,%eax
  db:	c3                   	ret    
  dc:	8d 74 26 00          	lea    0x0(%esi),%esi

000000e0 <strlen>:

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

  for(n = 0; s[n]; n++)
  e1:	31 c0                	xor    %eax,%eax
  e3:	89 e5                	mov    %esp,%ebp
  e5:	8b 55 08             	mov    0x8(%ebp),%edx
  e8:	80 3a 00             	cmpb   $0x0,(%edx)
  eb:	74 0a                	je     f7 <strlen+0x17>
  ed:	8d 76 00             	lea    0x0(%esi),%esi
  f0:	40                   	inc    %eax
  f1:	80 3c 10 00          	cmpb   $0x0,(%eax,%edx,1)
  f5:	75 f9                	jne    f0 <strlen+0x10>
    ;
  return n;
}
  f7:	5d                   	pop    %ebp
  f8:	c3                   	ret    
  f9:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

00000100 <memset>:

void*
memset(void *dst, int c, uint n)
{
 100:	55                   	push   %ebp
 101:	89 e5                	mov    %esp,%ebp
 103:	8b 45 10             	mov    0x10(%ebp),%eax
 106:	53                   	push   %ebx
 107:	8b 5d 08             	mov    0x8(%ebp),%ebx
  char *d;
  
  d = dst;
  while(n-- > 0)
 10a:	85 c0                	test   %eax,%eax
 10c:	74 1a                	je     128 <memset+0x28>
 10e:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
 112:	31 d2                	xor    %edx,%edx
 114:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
 11a:	8d bf 00 00 00 00    	lea    0x0(%edi),%edi
    *d++ = c;
 120:	88 0c 1a             	mov    %cl,(%edx,%ebx,1)
 123:	42                   	inc    %edx
 124:	39 d0                	cmp    %edx,%eax
 126:	75 f8                	jne    120 <memset+0x20>
  return dst;
}
 128:	89 d8                	mov    %ebx,%eax
 12a:	5b                   	pop    %ebx
 12b:	5d                   	pop    %ebp
 12c:	c3                   	ret    
 12d:	8d 76 00             	lea    0x0(%esi),%esi

00000130 <strchr>:

char*
strchr(const char *s, char c)
{
 130:	55                   	push   %ebp
 131:	89 e5                	mov    %esp,%ebp
 133:	8b 45 08             	mov    0x8(%ebp),%eax
 136:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
  for(; *s; s++)
 13a:	0f b6 10             	movzbl (%eax),%edx
 13d:	84 d2                	test   %dl,%dl
 13f:	74 19                	je     15a <strchr+0x2a>
    if(*s == c)
 141:	38 d1                	cmp    %dl,%cl
 143:	75 0d                	jne    152 <strchr+0x22>
 145:	eb 15                	jmp    15c <strchr+0x2c>
 147:	38 ca                	cmp    %cl,%dl
 149:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
 150:	74 0a                	je     15c <strchr+0x2c>
 152:	40                   	inc    %eax
 153:	0f b6 10             	movzbl (%eax),%edx
 156:	84 d2                	test   %dl,%dl
 158:	75 ed                	jne    147 <strchr+0x17>
 15a:	31 c0                	xor    %eax,%eax
      return (char*) s;
  return 0;
}
 15c:	5d                   	pop    %ebp
 15d:	c3                   	ret    
 15e:	89 f6                	mov    %esi,%esi

00000160 <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)
{
 160:	55                   	push   %ebp
 161:	89 e5                	mov    %esp,%ebp
 163:	8b 4d 08             	mov    0x8(%ebp),%ecx
 166:	53                   	push   %ebx
  int n;

  n = 0;
  while('0' <= *s && *s <= '9')
 167:	31 db                	xor    %ebx,%ebx
 169:	0f b6 11             	movzbl (%ecx),%edx
 16c:	88 d0                	mov    %dl,%al
 16e:	2c 30                	sub    $0x30,%al
 170:	3c 09                	cmp    $0x9,%al
 172:	77 23                	ja     197 <atoi+0x37>
 174:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
 17a:	8d bf 00 00 00 00    	lea    0x0(%edi),%edi
    n = n*10 + *s++ - '0';
 180:	8d 04 9b             	lea    (%ebx,%ebx,4),%eax
 183:	0f be d2             	movsbl %dl,%edx
 186:	8d 5c 42 d0          	lea    0xffffffd0(%edx,%eax,2),%ebx
 18a:	0f b6 51 01          	movzbl 0x1(%ecx),%edx
 18e:	41                   	inc    %ecx
 18f:	88 d0                	mov    %dl,%al
 191:	2c 30                	sub    $0x30,%al
 193:	3c 09                	cmp    $0x9,%al
 195:	76 e9                	jbe    180 <atoi+0x20>
  return n;
}
 197:	89 d8                	mov    %ebx,%eax
 199:	5b                   	pop    %ebx
 19a:	5d                   	pop    %ebp
 19b:	c3                   	ret    
 19c:	8d 74 26 00          	lea    0x0(%esi),%esi

000001a0 <memmove>:

void*
memmove(void *vdst, void *vsrc, int n)
{
 1a0:	55                   	push   %ebp
 1a1:	89 e5                	mov    %esp,%ebp
 1a3:	8b 4d 10             	mov    0x10(%ebp),%ecx
 1a6:	56                   	push   %esi
 1a7:	8b 75 08             	mov    0x8(%ebp),%esi
 1aa:	53                   	push   %ebx
 1ab:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  char *dst, *src;
  
  dst = vdst;
  src = vsrc;
  while(n-- > 0)
 1ae:	85 c9                	test   %ecx,%ecx
 1b0:	7e 1a                	jle    1cc <memmove+0x2c>
 1b2:	31 d2                	xor    %edx,%edx
 1b4:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
 1ba:	8d bf 00 00 00 00    	lea    0x0(%edi),%edi
    *dst++ = *src++;
 1c0:	0f b6 04 1a          	movzbl (%edx,%ebx,1),%eax
 1c4:	88 04 32             	mov    %al,(%edx,%esi,1)
 1c7:	42                   	inc    %edx
 1c8:	39 ca                	cmp    %ecx,%edx
 1ca:	75 f4                	jne    1c0 <memmove+0x20>
  return vdst;
}
 1cc:	5b                   	pop    %ebx
 1cd:	89 f0                	mov    %esi,%eax
 1cf:	5e                   	pop    %esi
 1d0:	5d                   	pop    %ebp
 1d1:	c3                   	ret    
 1d2:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
 1d9:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

000001e0 <stat>:
 1e0:	55                   	push   %ebp
 1e1:	31 c0                	xor    %eax,%eax
 1e3:	89 e5                	mov    %esp,%ebp
 1e5:	83 ec 18             	sub    $0x18,%esp
 1e8:	89 44 24 04          	mov    %eax,0x4(%esp)
 1ec:	8b 45 08             	mov    0x8(%ebp),%eax
 1ef:	89 5d f8             	mov    %ebx,0xfffffff8(%ebp)
 1f2:	89 75 fc             	mov    %esi,0xfffffffc(%ebp)
 1f5:	be ff ff ff ff       	mov    $0xffffffff,%esi
 1fa:	89 04 24             	mov    %eax,(%esp)
 1fd:	e8 ea 00 00 00       	call   2ec <open>
 202:	85 c0                	test   %eax,%eax
 204:	89 c3                	mov    %eax,%ebx
 206:	78 19                	js     221 <stat+0x41>
 208:	8b 45 0c             	mov    0xc(%ebp),%eax
 20b:	89 1c 24             	mov    %ebx,(%esp)
 20e:	89 44 24 04          	mov    %eax,0x4(%esp)
 212:	e8 ed 00 00 00       	call   304 <fstat>
 217:	89 1c 24             	mov    %ebx,(%esp)
 21a:	89 c6                	mov    %eax,%esi
 21c:	e8 b3 00 00 00       	call   2d4 <close>
 221:	89 f0                	mov    %esi,%eax
 223:	8b 5d f8             	mov    0xfffffff8(%ebp),%ebx
 226:	8b 75 fc             	mov    0xfffffffc(%ebp),%esi
 229:	89 ec                	mov    %ebp,%esp
 22b:	5d                   	pop    %ebp
 22c:	c3                   	ret    
 22d:	8d 76 00             	lea    0x0(%esi),%esi

00000230 <gets>:
 230:	55                   	push   %ebp
 231:	89 e5                	mov    %esp,%ebp
 233:	57                   	push   %edi
 234:	56                   	push   %esi
 235:	31 f6                	xor    %esi,%esi
 237:	53                   	push   %ebx
 238:	83 ec 1c             	sub    $0x1c,%esp
 23b:	8d 5e 01             	lea    0x1(%esi),%ebx
 23e:	8b 7d 08             	mov    0x8(%ebp),%edi
 241:	3b 5d 0c             	cmp    0xc(%ebp),%ebx
 244:	7d 3e                	jge    284 <gets+0x54>
 246:	ba 01 00 00 00       	mov    $0x1,%edx
 24b:	8d 45 f3             	lea    0xfffffff3(%ebp),%eax
 24e:	89 54 24 08          	mov    %edx,0x8(%esp)
 252:	89 44 24 04          	mov    %eax,0x4(%esp)
 256:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 25d:	e8 62 00 00 00       	call   2c4 <read>
 262:	85 c0                	test   %eax,%eax
 264:	7e 1e                	jle    284 <gets+0x54>
 266:	0f b6 45 f3          	movzbl 0xfffffff3(%ebp),%eax
 26a:	88 44 3b ff          	mov    %al,0xffffffff(%ebx,%edi,1)
 26e:	0f b6 45 f3          	movzbl 0xfffffff3(%ebp),%eax
 272:	3c 0a                	cmp    $0xa,%al
 274:	74 1c                	je     292 <gets+0x62>
 276:	3c 0d                	cmp    $0xd,%al
 278:	74 18                	je     292 <gets+0x62>
 27a:	89 de                	mov    %ebx,%esi
 27c:	8d 5e 01             	lea    0x1(%esi),%ebx
 27f:	3b 5d 0c             	cmp    0xc(%ebp),%ebx
 282:	7c c2                	jl     246 <gets+0x16>
 284:	c6 04 3e 00          	movb   $0x0,(%esi,%edi,1)
 288:	83 c4 1c             	add    $0x1c,%esp
 28b:	89 f8                	mov    %edi,%eax
 28d:	5b                   	pop    %ebx
 28e:	5e                   	pop    %esi
 28f:	5f                   	pop    %edi
 290:	5d                   	pop    %ebp
 291:	c3                   	ret    
 292:	89 de                	mov    %ebx,%esi
 294:	89 f8                	mov    %edi,%eax
 296:	c6 04 3e 00          	movb   $0x0,(%esi,%edi,1)
 29a:	83 c4 1c             	add    $0x1c,%esp
 29d:	5b                   	pop    %ebx
 29e:	5e                   	pop    %esi
 29f:	5f                   	pop    %edi
 2a0:	5d                   	pop    %ebp
 2a1:	c3                   	ret    
 2a2:	90                   	nop    
 2a3:	90                   	nop    

000002a4 <fork>:
 2a4:	b8 01 00 00 00       	mov    $0x1,%eax
 2a9:	cd 30                	int    $0x30
 2ab:	c3                   	ret    

000002ac <exit>:
 2ac:	b8 02 00 00 00       	mov    $0x2,%eax
 2b1:	cd 30                	int    $0x30
 2b3:	c3                   	ret    

000002b4 <wait>:
 2b4:	b8 03 00 00 00       	mov    $0x3,%eax
 2b9:	cd 30                	int    $0x30
 2bb:	c3                   	ret    

000002bc <pipe>:
 2bc:	b8 04 00 00 00       	mov    $0x4,%eax
 2c1:	cd 30                	int    $0x30
 2c3:	c3                   	ret    

000002c4 <read>:
 2c4:	b8 06 00 00 00       	mov    $0x6,%eax
 2c9:	cd 30                	int    $0x30
 2cb:	c3                   	ret    

000002cc <write>:
 2cc:	b8 05 00 00 00       	mov    $0x5,%eax
 2d1:	cd 30                	int    $0x30
 2d3:	c3                   	ret    

000002d4 <close>:
 2d4:	b8 07 00 00 00       	mov    $0x7,%eax
 2d9:	cd 30                	int    $0x30
 2db:	c3                   	ret    

000002dc <kill>:
 2dc:	b8 08 00 00 00       	mov    $0x8,%eax
 2e1:	cd 30                	int    $0x30
 2e3:	c3                   	ret    

000002e4 <exec>:
 2e4:	b8 09 00 00 00       	mov    $0x9,%eax
 2e9:	cd 30                	int    $0x30
 2eb:	c3                   	ret    

000002ec <open>:
 2ec:	b8 0a 00 00 00       	mov    $0xa,%eax
 2f1:	cd 30                	int    $0x30
 2f3:	c3                   	ret    

000002f4 <mknod>:
 2f4:	b8 0b 00 00 00       	mov    $0xb,%eax
 2f9:	cd 30                	int    $0x30
 2fb:	c3                   	ret    

000002fc <unlink>:
 2fc:	b8 0c 00 00 00       	mov    $0xc,%eax
 301:	cd 30                	int    $0x30
 303:	c3                   	ret    

00000304 <fstat>:
 304:	b8 0d 00 00 00       	mov    $0xd,%eax
 309:	cd 30                	int    $0x30
 30b:	c3                   	ret    

0000030c <link>:
 30c:	b8 0e 00 00 00       	mov    $0xe,%eax
 311:	cd 30                	int    $0x30
 313:	c3                   	ret    

00000314 <mkdir>:
 314:	b8 0f 00 00 00       	mov    $0xf,%eax
 319:	cd 30                	int    $0x30
 31b:	c3                   	ret    

0000031c <chdir>:
 31c:	b8 10 00 00 00       	mov    $0x10,%eax
 321:	cd 30                	int    $0x30
 323:	c3                   	ret    

00000324 <dup>:
 324:	b8 11 00 00 00       	mov    $0x11,%eax
 329:	cd 30                	int    $0x30
 32b:	c3                   	ret    

0000032c <getpid>:
 32c:	b8 12 00 00 00       	mov    $0x12,%eax
 331:	cd 30                	int    $0x30
 333:	c3                   	ret    

00000334 <sbrk>:
 334:	b8 13 00 00 00       	mov    $0x13,%eax
 339:	cd 30                	int    $0x30
 33b:	c3                   	ret    

0000033c <sleep>:
 33c:	b8 14 00 00 00       	mov    $0x14,%eax
 341:	cd 30                	int    $0x30
 343:	c3                   	ret    
 344:	90                   	nop    
 345:	90                   	nop    
 346:	90                   	nop    
 347:	90                   	nop    
 348:	90                   	nop    
 349:	90                   	nop    
 34a:	90                   	nop    
 34b:	90                   	nop    
 34c:	90                   	nop    
 34d:	90                   	nop    
 34e:	90                   	nop    
 34f:	90                   	nop    

00000350 <putc>:
#include "user.h"

static void
putc(int fd, char c)
{
 350:	55                   	push   %ebp
 351:	89 e5                	mov    %esp,%ebp
 353:	83 ec 18             	sub    $0x18,%esp
 356:	88 55 fc             	mov    %dl,0xfffffffc(%ebp)
  write(fd, &c, 1);
 359:	ba 01 00 00 00       	mov    $0x1,%edx
 35e:	89 54 24 08          	mov    %edx,0x8(%esp)
 362:	8d 55 fc             	lea    0xfffffffc(%ebp),%edx
 365:	89 54 24 04          	mov    %edx,0x4(%esp)
 369:	89 04 24             	mov    %eax,(%esp)
 36c:	e8 5b ff ff ff       	call   2cc <write>
}
 371:	c9                   	leave  
 372:	c3                   	ret    
 373:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
 379:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00000380 <printint>:

static void
printint(int fd, int xx, int base, int sgn)
{
 380:	55                   	push   %ebp
 381:	89 e5                	mov    %esp,%ebp
 383:	57                   	push   %edi
 384:	56                   	push   %esi
 385:	89 ce                	mov    %ecx,%esi
 387:	53                   	push   %ebx
 388:	83 ec 1c             	sub    $0x1c,%esp
  static char digits[] = "0123456789ABCDEF";
  char buf[16];
  int i, neg;
  uint x;

  neg = 0;
  if(sgn && xx < 0){
 38b:	8b 5d 08             	mov    0x8(%ebp),%ebx
 38e:	89 45 dc             	mov    %eax,0xffffffdc(%ebp)
 391:	85 db                	test   %ebx,%ebx
 393:	74 04                	je     399 <printint+0x19>
 395:	85 d2                	test   %edx,%edx
 397:	78 62                	js     3fb <printint+0x7b>
    neg = 1;
    x = -xx;
  } else {
    x = xx;
 399:	89 d0                	mov    %edx,%eax
 39b:	c7 45 e0 00 00 00 00 	movl   $0x0,0xffffffe0(%ebp)
 3a2:	31 db                	xor    %ebx,%ebx
 3a4:	8d 7d e4             	lea    0xffffffe4(%ebp),%edi
 3a7:	89 f6                	mov    %esi,%esi
 3a9:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi
  }

  i = 0;
  do{
    buf[i++] = digits[x % base];
 3b0:	31 d2                	xor    %edx,%edx
 3b2:	f7 f6                	div    %esi
 3b4:	89 c1                	mov    %eax,%ecx
 3b6:	0f b6 82 0a 07 00 00 	movzbl 0x70a(%edx),%eax
 3bd:	88 04 3b             	mov    %al,(%ebx,%edi,1)
 3c0:	43                   	inc    %ebx
  }while((x /= base) != 0);
 3c1:	85 c9                	test   %ecx,%ecx
 3c3:	89 c8                	mov    %ecx,%eax
 3c5:	75 e9                	jne    3b0 <printint+0x30>
  if(neg)
 3c7:	8b 4d e0             	mov    0xffffffe0(%ebp),%ecx
 3ca:	85 c9                	test   %ecx,%ecx
 3cc:	74 06                	je     3d4 <printint+0x54>
    buf[i++] = '-';
 3ce:	c6 44 1d e4 2d       	movb   $0x2d,0xffffffe4(%ebp,%ebx,1)
 3d3:	43                   	inc    %ebx

  while(--i >= 0)
 3d4:	4b                   	dec    %ebx
 3d5:	78 1c                	js     3f3 <printint+0x73>
 3d7:	89 f6                	mov    %esi,%esi
 3d9:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi
    putc(fd, buf[i]);
 3e0:	0f be 54 1d e4       	movsbl 0xffffffe4(%ebp,%ebx,1),%edx
 3e5:	4b                   	dec    %ebx
 3e6:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
 3e9:	e8 62 ff ff ff       	call   350 <putc>
 3ee:	83 fb ff             	cmp    $0xffffffff,%ebx
 3f1:	75 ed                	jne    3e0 <printint+0x60>
}
 3f3:	83 c4 1c             	add    $0x1c,%esp
 3f6:	5b                   	pop    %ebx
 3f7:	5e                   	pop    %esi
 3f8:	5f                   	pop    %edi
 3f9:	5d                   	pop    %ebp
 3fa:	c3                   	ret    
 3fb:	89 d0                	mov    %edx,%eax
 3fd:	f7 d8                	neg    %eax
 3ff:	c7 45 e0 01 00 00 00 	movl   $0x1,0xffffffe0(%ebp)
 406:	eb 9a                	jmp    3a2 <printint+0x22>
 408:	90                   	nop    
 409:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

00000410 <printf>:

// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
 410:	55                   	push   %ebp
 411:	89 e5                	mov    %esp,%ebp
 413:	57                   	push   %edi
 414:	56                   	push   %esi
 415:	53                   	push   %ebx
 416:	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++){
 419:	8b 55 0c             	mov    0xc(%ebp),%edx
 41c:	0f b6 02             	movzbl (%edx),%eax
 41f:	84 c0                	test   %al,%al
 421:	0f 84 99 00 00 00    	je     4c0 <printf+0xb0>
 427:	8d 4d 10             	lea    0x10(%ebp),%ecx
 42a:	31 ff                	xor    %edi,%edi
 42c:	31 f6                	xor    %esi,%esi
 42e:	89 4d f0             	mov    %ecx,0xfffffff0(%ebp)
 431:	eb 26                	jmp    459 <printf+0x49>
    c = fmt[i] & 0xff;
    if(state == 0){
      if(c == '%'){
 433:	83 fb 25             	cmp    $0x25,%ebx
 436:	0f 85 8c 00 00 00    	jne    4c8 <printf+0xb8>
 43c:	be 25 00 00 00       	mov    $0x25,%esi
 441:	eb 0d                	jmp    450 <printf+0x40>
 443:	90                   	nop    
 444:	90                   	nop    
 445:	90                   	nop    
 446:	90                   	nop    
 447:	90                   	nop    
 448:	90                   	nop    
 449:	90                   	nop    
 44a:	90                   	nop    
 44b:	90                   	nop    
 44c:	90                   	nop    
 44d:	90                   	nop    
 44e:	90                   	nop    
 44f:	90                   	nop    
 450:	47                   	inc    %edi
 451:	0f b6 04 3a          	movzbl (%edx,%edi,1),%eax
 455:	84 c0                	test   %al,%al
 457:	74 67                	je     4c0 <printf+0xb0>
 459:	85 f6                	test   %esi,%esi
 45b:	0f b6 d8             	movzbl %al,%ebx
 45e:	74 d3                	je     433 <printf+0x23>
        state = '%';
      } else {
        putc(fd, c);
      }
    } else if(state == '%'){
 460:	83 fe 25             	cmp    $0x25,%esi
 463:	75 eb                	jne    450 <printf+0x40>
      if(c == 'd'){
 465:	83 fb 64             	cmp    $0x64,%ebx
 468:	0f 84 e0 00 00 00    	je     54e <printf+0x13e>
        printint(fd, *ap, 10, 1);
        ap++;
      } else if(c == 'x' || c == 'p'){
 46e:	83 fb 78             	cmp    $0x78,%ebx
 471:	74 68                	je     4db <printf+0xcb>
 473:	83 fb 70             	cmp    $0x70,%ebx
 476:	74 63                	je     4db <printf+0xcb>
        printint(fd, *ap, 16, 0);
        ap++;
      } else if(c == 's'){
 478:	83 fb 73             	cmp    $0x73,%ebx
 47b:	90                   	nop    
 47c:	8d 74 26 00          	lea    0x0(%esi),%esi
 480:	0f 84 7c 00 00 00    	je     502 <printf+0xf2>
        s = (char*)*ap;
        ap++;
        if(s == 0)
          s = "(null)";
        while(*s != 0){
          putc(fd, *s);
          s++;
        }
      } else if(c == 'c'){
 486:	83 fb 63             	cmp    $0x63,%ebx
 489:	0f 84 e4 00 00 00    	je     573 <printf+0x163>
        putc(fd, *ap);
        ap++;
      } else if(c == '%'){
 48f:	83 fb 25             	cmp    $0x25,%ebx
 492:	0f 84 c4 00 00 00    	je     55c <printf+0x14c>
        putc(fd, c);
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
 498:	8b 45 08             	mov    0x8(%ebp),%eax
 49b:	ba 25 00 00 00       	mov    $0x25,%edx
 4a0:	47                   	inc    %edi
        putc(fd, c);
 4a1:	31 f6                	xor    %esi,%esi
 4a3:	e8 a8 fe ff ff       	call   350 <putc>
 4a8:	8b 45 08             	mov    0x8(%ebp),%eax
 4ab:	0f be d3             	movsbl %bl,%edx
 4ae:	e8 9d fe ff ff       	call   350 <putc>
 4b3:	8b 55 0c             	mov    0xc(%ebp),%edx
 4b6:	0f b6 04 3a          	movzbl (%edx,%edi,1),%eax
 4ba:	84 c0                	test   %al,%al
 4bc:	75 9b                	jne    459 <printf+0x49>
 4be:	89 f6                	mov    %esi,%esi
      }
      state = 0;
    }
  }
}
 4c0:	83 c4 0c             	add    $0xc,%esp
 4c3:	5b                   	pop    %ebx
 4c4:	5e                   	pop    %esi
 4c5:	5f                   	pop    %edi
 4c6:	5d                   	pop    %ebp
 4c7:	c3                   	ret    
 4c8:	8b 45 08             	mov    0x8(%ebp),%eax
 4cb:	0f be d3             	movsbl %bl,%edx
 4ce:	e8 7d fe ff ff       	call   350 <putc>
 4d3:	8b 55 0c             	mov    0xc(%ebp),%edx
 4d6:	e9 75 ff ff ff       	jmp    450 <printf+0x40>
 4db:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 4e2:	b9 10 00 00 00       	mov    $0x10,%ecx
 4e7:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
 4ea:	31 f6                	xor    %esi,%esi
 4ec:	8b 10                	mov    (%eax),%edx
 4ee:	8b 45 08             	mov    0x8(%ebp),%eax
 4f1:	e8 8a fe ff ff       	call   380 <printint>
 4f6:	8b 55 0c             	mov    0xc(%ebp),%edx
 4f9:	83 45 f0 04          	addl   $0x4,0xfffffff0(%ebp)
 4fd:	e9 4e ff ff ff       	jmp    450 <printf+0x40>
 502:	8b 4d f0             	mov    0xfffffff0(%ebp),%ecx
 505:	8b 01                	mov    (%ecx),%eax
 507:	83 c1 04             	add    $0x4,%ecx
 50a:	89 4d f0             	mov    %ecx,0xfffffff0(%ebp)
 50d:	b9 03 07 00 00       	mov    $0x703,%ecx
 512:	85 c0                	test   %eax,%eax
 514:	74 02                	je     518 <printf+0x108>
 516:	89 c1                	mov    %eax,%ecx
 518:	0f b6 01             	movzbl (%ecx),%eax
 51b:	84 c0                	test   %al,%al
 51d:	74 28                	je     547 <printf+0x137>
 51f:	89 cb                	mov    %ecx,%ebx
 521:	eb 0d                	jmp    530 <printf+0x120>
 523:	90                   	nop    
 524:	90                   	nop    
 525:	90                   	nop    
 526:	90                   	nop    
 527:	90                   	nop    
 528:	90                   	nop    
 529:	90                   	nop    
 52a:	90                   	nop    
 52b:	90                   	nop    
 52c:	90                   	nop    
 52d:	90                   	nop    
 52e:	90                   	nop    
 52f:	90                   	nop    
 530:	0f be d0             	movsbl %al,%edx
 533:	8b 45 08             	mov    0x8(%ebp),%eax
 536:	e8 15 fe ff ff       	call   350 <putc>
 53b:	0f b6 43 01          	movzbl 0x1(%ebx),%eax
 53f:	43                   	inc    %ebx
 540:	84 c0                	test   %al,%al
 542:	75 ec                	jne    530 <printf+0x120>
 544:	8b 55 0c             	mov    0xc(%ebp),%edx
 547:	31 f6                	xor    %esi,%esi
 549:	e9 02 ff ff ff       	jmp    450 <printf+0x40>
 54e:	b9 0a 00 00 00       	mov    $0xa,%ecx
 553:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
 55a:	eb 8b                	jmp    4e7 <printf+0xd7>
 55c:	8b 45 08             	mov    0x8(%ebp),%eax
 55f:	ba 25 00 00 00       	mov    $0x25,%edx
 564:	31 f6                	xor    %esi,%esi
 566:	e8 e5 fd ff ff       	call   350 <putc>
 56b:	8b 55 0c             	mov    0xc(%ebp),%edx
 56e:	e9 dd fe ff ff       	jmp    450 <printf+0x40>
 573:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
 576:	31 f6                	xor    %esi,%esi
 578:	0f be 10             	movsbl (%eax),%edx
 57b:	8b 45 08             	mov    0x8(%ebp),%eax
 57e:	e8 cd fd ff ff       	call   350 <putc>
 583:	8b 55 0c             	mov    0xc(%ebp),%edx
 586:	83 45 f0 04          	addl   $0x4,0xfffffff0(%ebp)
 58a:	e9 c1 fe ff ff       	jmp    450 <printf+0x40>
 58f:	90                   	nop    

00000590 <free>:
static Header *freep;

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

  bp = (Header*) ap - 1;
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 591:	8b 0d 24 07 00 00    	mov    0x724,%ecx
 597:	89 e5                	mov    %esp,%ebp
 599:	56                   	push   %esi
 59a:	53                   	push   %ebx
 59b:	8b 5d 08             	mov    0x8(%ebp),%ebx
 59e:	83 eb 08             	sub    $0x8,%ebx
 5a1:	eb 0d                	jmp    5b0 <free+0x20>
 5a3:	90                   	nop    
 5a4:	90                   	nop    
 5a5:	90                   	nop    
 5a6:	90                   	nop    
 5a7:	90                   	nop    
 5a8:	90                   	nop    
 5a9:	90                   	nop    
 5aa:	90                   	nop    
 5ab:	90                   	nop    
 5ac:	90                   	nop    
 5ad:	90                   	nop    
 5ae:	90                   	nop    
 5af:	90                   	nop    
 5b0:	39 d9                	cmp    %ebx,%ecx
 5b2:	73 04                	jae    5b8 <free+0x28>
 5b4:	3b 19                	cmp    (%ecx),%ebx
 5b6:	72 12                	jb     5ca <free+0x3a>
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
 5b8:	8b 11                	mov    (%ecx),%edx
 5ba:	39 d1                	cmp    %edx,%ecx
 5bc:	72 08                	jb     5c6 <free+0x36>
 5be:	39 d9                	cmp    %ebx,%ecx
 5c0:	72 0a                	jb     5cc <free+0x3c>
 5c2:	39 d3                	cmp    %edx,%ebx
 5c4:	72 06                	jb     5cc <free+0x3c>
 5c6:	89 d1                	mov    %edx,%ecx
 5c8:	eb e6                	jmp    5b0 <free+0x20>
 5ca:	8b 11                	mov    (%ecx),%edx
      break;
  if(bp + bp->s.size == p->s.ptr){
 5cc:	8b 73 04             	mov    0x4(%ebx),%esi
 5cf:	8d 04 f3             	lea    (%ebx,%esi,8),%eax
 5d2:	39 d0                	cmp    %edx,%eax
 5d4:	74 2e                	je     604 <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;
 5d6:	89 13                	mov    %edx,(%ebx)
  if(p + p->s.size == bp){
 5d8:	8b 51 04             	mov    0x4(%ecx),%edx
 5db:	8d 04 d1             	lea    (%ecx,%edx,8),%eax
 5de:	39 c3                	cmp    %eax,%ebx
 5e0:	74 0c                	je     5ee <free+0x5e>
    p->s.size += bp->s.size;
    p->s.ptr = bp->s.ptr;
  } else
    p->s.ptr = bp;
 5e2:	89 19                	mov    %ebx,(%ecx)
  freep = p;
}
 5e4:	5b                   	pop    %ebx
 5e5:	89 0d 24 07 00 00    	mov    %ecx,0x724
 5eb:	5e                   	pop    %esi
 5ec:	5d                   	pop    %ebp
 5ed:	c3                   	ret    
 5ee:	8b 43 04             	mov    0x4(%ebx),%eax
 5f1:	01 c2                	add    %eax,%edx
 5f3:	8b 03                	mov    (%ebx),%eax
 5f5:	89 51 04             	mov    %edx,0x4(%ecx)
 5f8:	89 01                	mov    %eax,(%ecx)
 5fa:	5b                   	pop    %ebx
 5fb:	89 0d 24 07 00 00    	mov    %ecx,0x724
 601:	5e                   	pop    %esi
 602:	5d                   	pop    %ebp
 603:	c3                   	ret    
 604:	8b 42 04             	mov    0x4(%edx),%eax
 607:	01 c6                	add    %eax,%esi
 609:	8b 02                	mov    (%edx),%eax
 60b:	89 73 04             	mov    %esi,0x4(%ebx)
 60e:	89 03                	mov    %eax,(%ebx)
 610:	eb c6                	jmp    5d8 <free+0x48>
 612:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
 619:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00000620 <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)
{
 620:	55                   	push   %ebp
 621:	89 e5                	mov    %esp,%ebp
 623:	57                   	push   %edi
 624:	56                   	push   %esi
 625:	53                   	push   %ebx
 626:	83 ec 0c             	sub    $0xc,%esp
  Header *p, *prevp;
  uint nunits;

  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
 629:	8b 45 08             	mov    0x8(%ebp),%eax
  if((prevp = freep) == 0){
 62c:	8b 15 24 07 00 00    	mov    0x724,%edx
 632:	83 c0 07             	add    $0x7,%eax
 635:	c1 e8 03             	shr    $0x3,%eax
 638:	85 d2                	test   %edx,%edx
 63a:	8d 58 01             	lea    0x1(%eax),%ebx
 63d:	0f 84 92 00 00 00    	je     6d5 <malloc+0xb5>
    base.s.ptr = freep = prevp = &base;
    base.s.size = 0;
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
 643:	8b 0a                	mov    (%edx),%ecx
    if(p->s.size >= nunits){
 645:	8b 41 04             	mov    0x4(%ecx),%eax
 648:	39 c3                	cmp    %eax,%ebx
 64a:	76 63                	jbe    6af <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);
 64c:	8d 3c dd 00 00 00 00 	lea    0x0(,%ebx,8),%edi
 653:	eb 09                	jmp    65e <malloc+0x3e>
 655:	8b 0a                	mov    (%edx),%ecx
 657:	8b 41 04             	mov    0x4(%ecx),%eax
 65a:	39 c3                	cmp    %eax,%ebx
 65c:	76 51                	jbe    6af <malloc+0x8f>
    }
    if(p == freep)
 65e:	39 0d 24 07 00 00    	cmp    %ecx,0x724
 664:	89 ca                	mov    %ecx,%edx
 666:	75 ed                	jne    655 <malloc+0x35>
 668:	81 fb ff 0f 00 00    	cmp    $0xfff,%ebx
 66e:	77 39                	ja     6a9 <malloc+0x89>
 670:	be 00 10 00 00       	mov    $0x1000,%esi
 675:	b8 00 80 00 00       	mov    $0x8000,%eax
 67a:	89 04 24             	mov    %eax,(%esp)
 67d:	e8 b2 fc ff ff       	call   334 <sbrk>
 682:	83 f8 ff             	cmp    $0xffffffff,%eax
 685:	74 18                	je     69f <malloc+0x7f>
 687:	89 70 04             	mov    %esi,0x4(%eax)
 68a:	83 c0 08             	add    $0x8,%eax
 68d:	89 04 24             	mov    %eax,(%esp)
 690:	e8 fb fe ff ff       	call   590 <free>
 695:	8b 15 24 07 00 00    	mov    0x724,%edx
      if((p = morecore(nunits)) == 0)
 69b:	85 d2                	test   %edx,%edx
 69d:	75 b6                	jne    655 <malloc+0x35>
        return 0;
  }
}
 69f:	83 c4 0c             	add    $0xc,%esp
 6a2:	31 c0                	xor    %eax,%eax
 6a4:	5b                   	pop    %ebx
 6a5:	5e                   	pop    %esi
 6a6:	5f                   	pop    %edi
 6a7:	5d                   	pop    %ebp
 6a8:	c3                   	ret    
 6a9:	89 de                	mov    %ebx,%esi
 6ab:	89 f8                	mov    %edi,%eax
 6ad:	eb cb                	jmp    67a <malloc+0x5a>
 6af:	39 c3                	cmp    %eax,%ebx
 6b1:	74 1c                	je     6cf <malloc+0xaf>
 6b3:	29 d8                	sub    %ebx,%eax
 6b5:	89 41 04             	mov    %eax,0x4(%ecx)
 6b8:	8d 0c c1             	lea    (%ecx,%eax,8),%ecx
 6bb:	89 59 04             	mov    %ebx,0x4(%ecx)
 6be:	89 15 24 07 00 00    	mov    %edx,0x724
 6c4:	83 c4 0c             	add    $0xc,%esp
 6c7:	5b                   	pop    %ebx
 6c8:	8d 41 08             	lea    0x8(%ecx),%eax
 6cb:	5e                   	pop    %esi
 6cc:	5f                   	pop    %edi
 6cd:	5d                   	pop    %ebp
 6ce:	c3                   	ret    
 6cf:	8b 01                	mov    (%ecx),%eax
 6d1:	89 02                	mov    %eax,(%edx)
 6d3:	eb e9                	jmp    6be <malloc+0x9e>
 6d5:	b8 1c 07 00 00       	mov    $0x71c,%eax
 6da:	ba 1c 07 00 00       	mov    $0x71c,%edx
 6df:	a3 24 07 00 00       	mov    %eax,0x724
 6e4:	b8 1c 07 00 00       	mov    $0x71c,%eax
 6e9:	a3 1c 07 00 00       	mov    %eax,0x71c
 6ee:	31 c0                	xor    %eax,%eax
 6f0:	a3 20 07 00 00       	mov    %eax,0x720
 6f5:	e9 49 ff ff ff       	jmp    643 <malloc+0x23>
