; generated by Component: ARM Compiler 5.05 update 2 (build 169) Tool: ArmCC [4d0f38]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\http_parse.o --asm_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --list_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --depend=..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\http_parse.d --cpu=Cortex-M4.fp --apcs=interwork -O0 --diag_suppress=9931,1,1293 -I..\..\..\..\Board\fire_F429 -I..\..\..\..\Demos\fire\ov2640 -I..\..\..\..\include -I..\..\..\..\libraries\utilities -I..\..\..\..\libraries\utilities\json_c -I..\..\..\..\MICO\core -I..\..\..\..\MICO\security -I..\..\..\..\MICO\system -I..\..\..\..\MICO\system\command_console -I..\..\..\..\Platform\include -I..\..\..\..\Platform\Cortex-M4 -I..\..\..\..\Platform\Cortex-M4\CMSIS -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries -I..\..\..\..\Platform\MCU\STM32F4xx\wlan_bus_driver -I..\..\..\..\Platform\Drivers\spi_flash -I..\..\..\..\Platform\Drivers -I..\..\..\..\libraries\daemons\homekit_server -I..\..\..\..\libraries\daemons\http_server -I..\..\..\..\Platform\Drivers\malloc -I..\..\..\..\Platform\Drivers\SDRAM -I..\..\..\..\Platform\Drivers\ov5640 -IG:\GIT_OSC\STM32_develop\F429-V2\develop\6-WIFI\STM32-WiFi\3.wifi_ov5640\Projects\STM32F429\demo\RVMDK\RTE -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -IC:\Keil_v5\ARM\CMSIS\Include -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0 -D__UVISION_VERSION=515 -DSTM32F429xx -DUSE_STDPERIPH_DRIVER -DDEBUG -DHSE_VALUE=25000000 -DOV5640 --omf_browse=..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\http_parse.crf ..\..\..\..\libraries\daemons\http_server\http_parse.c]
                          THUMB

                          AREA ||i.__httpd_parse_all_tags||, CODE, READONLY, ALIGN=1

                  __httpd_parse_all_tags PROC
;;;636    
;;;637    static int __httpd_parse_all_tags(char *inbuf, const char *tag,
000000  e92d41fc          PUSH     {r2-r8,lr}
;;;638    				  char *val, unsigned val_len)
;;;639    
;;;640    {
000004  4604              MOV      r4,r0
000006  460e              MOV      r6,r1
000008  4617              MOV      r7,r2
00000a  4698              MOV      r8,r3
;;;641      short found = 0;
00000c  2000              MOVS     r0,#0
00000e  9001              STR      r0,[sp,#4]
;;;642      char *ptr;
;;;643      
;;;644      ptr = inbuf;
000010  4625              MOV      r5,r4
;;;645      while (1) {
000012  e011              B        |L1.56|
                  |L1.20|
;;;646        ptr = httpd_parse_msgbody(ptr, tag, val, val_len, &found);
000014  a801              ADD      r0,sp,#4
000016  4643              MOV      r3,r8
000018  463a              MOV      r2,r7
00001a  4631              MOV      r1,r6
00001c  9000              STR      r0,[sp,#0]
00001e  4628              MOV      r0,r5
000020  f7fffffe          BL       httpd_parse_msgbody
000024  4605              MOV      r5,r0
;;;647        if (ptr < 0) {
000026  bf00              NOP      
;;;648          httpd_d("Failed to parse request");
;;;649          return -kInProgressErr;
;;;650        }
;;;651        if (found)
000028  f8bd0004          LDRH     r0,[sp,#4]
00002c  b110              CBZ      r0,|L1.52|
;;;652          return kNoErr;
00002e  2000              MOVS     r0,#0
                  |L1.48|
;;;653        
;;;654        if (ptr == NULL)
;;;655          break;
;;;656      }
;;;657      
;;;658      return -kInProgressErr;
;;;659    }
000030  e8bd81fc          POP      {r2-r8,pc}
                  |L1.52|
000034  b905              CBNZ     r5,|L1.56|
000036  e000              B        |L1.58|
                  |L1.56|
000038  e7ec              B        |L1.20|
                  |L1.58|
00003a  bf00              NOP                            ;655
00003c  f04f30ff          MOV      r0,#0xffffffff        ;658
000040  e7f6              B        |L1.48|
;;;660    
                          ENDP


                          AREA ||i.__httpd_parse_hdr_tags||, CODE, READONLY, ALIGN=2

                  __httpd_parse_hdr_tags PROC
;;;298    * httpd_request_t structure. */
;;;299    static int __httpd_parse_hdr_tags(char *data_p, int len,
000000  e92d47f0          PUSH     {r4-r10,lr}
;;;300    				  httpd_request_t *req_p, uint8_t *done)
;;;301    {
000004  4605              MOV      r5,r0
000006  4689              MOV      r9,r1
000008  4614              MOV      r4,r2
00000a  461e              MOV      r6,r3
;;;302      //	ASSERT((data_p != NULL) && (req_p != NULL));
;;;303      
;;;304      if ((*data_p == ISO_nl) || (*data_p == ISO_cr) || (*data_p == 0)) {
00000c  7828              LDRB     r0,[r5,#0]
00000e  280a              CMP      r0,#0xa
000010  d004              BEQ      |L2.28|
000012  7828              LDRB     r0,[r5,#0]
000014  280d              CMP      r0,#0xd
000016  d001              BEQ      |L2.28|
000018  7828              LDRB     r0,[r5,#0]
00001a  b920              CBNZ     r0,|L2.38|
                  |L2.28|
;;;305        /* Indicate that the parsing is now complete */
;;;306        *done = 1;
00001c  2001              MOVS     r0,#1
00001e  7030              STRB     r0,[r6,#0]
;;;307        return kNoErr;
000020  2000              MOVS     r0,#0
                  |L2.34|
;;;308      }
;;;309      
;;;310      if (strncasecmp(data_p, http_content_len, sizeof(http_content_len) - 1) == 0) {
;;;311        req_p->body_nbytes =
;;;312          atol(&data_p[sizeof(http_content_len) - 1]);
;;;313        if (req_p->body_nbytes == 0) {
;;;314          httpd_d("got 0 for body length");
;;;315          return kNoErr;
;;;316        }
;;;317        req_p->remaining_bytes = req_p->body_nbytes;
;;;318      } else if (strncasecmp(data_p, http_user_agent, sizeof(http_user_agent) - 1) == 0) {
;;;319        /* chomp the : and ' ' and pass it to the internal parser */
;;;320        httpd_parse_useragent(data_p + sizeof(http_user_agent) + 1,
;;;321                              &req_p->agent);
;;;322      } else if (strncasecmp(data_p, http_content_type, sizeof(http_content_type) - 1) == 0) {
;;;323        memcpy(req_p->content_type, data_p + strlen(http_content_type),
;;;324               strlen(data_p));
;;;325      } else if (strncasecmp(data_p, "If-None-Match", sizeof("If-None-Match") - 1) == 0) {
;;;326        /*
;;;327        * We use the FTFS CRC to generate ETag. Hence, the ETag we
;;;328        * receive is not expected to be more that 32 bits in value.
;;;329        */
;;;330        const char *first_double_quote = strchr(data_p, '"');
;;;331        if (!first_double_quote) {
;;;332          httpd_d("If_None_Match has no double quote");
;;;333          return -kInProgressErr;
;;;334        }
;;;335        
;;;336        const char *etag_start = ++first_double_quote;
;;;337        req_p->etag_val = strtol(etag_start, NULL, 16);
;;;338        req_p->if_none_match = TRUE;
;;;339      } else if (strncasecmp(data_p, http_encoding, sizeof(http_encoding) - 1) == 0) {
;;;340        if (!strncasecmp(&data_p[sizeof(http_encoding) - 1],
;;;341                         HTTP_CHUNKED, sizeof(HTTP_CHUNKED) - 1))
;;;342          req_p->chunked = 1;
;;;343      }
;;;344      return kNoErr;
;;;345    }
000022  e8bd87f0          POP      {r4-r10,pc}
                  |L2.38|
000026  2210              MOVS     r2,#0x10              ;310
000028  4930              LDR      r1,|L2.236|
00002a  4628              MOV      r0,r5                 ;310
00002c  f7fffffe          BL       strncasecmp
000030  b958              CBNZ     r0,|L2.74|
000032  f1050010          ADD      r0,r5,#0x10           ;311
000036  f7fffffe          BL       atol
00003a  6560              STR      r0,[r4,#0x54]         ;311
00003c  6d60              LDR      r0,[r4,#0x54]         ;313
00003e  b908              CBNZ     r0,|L2.68|
000040  2000              MOVS     r0,#0                 ;315
000042  e7ee              B        |L2.34|
                  |L2.68|
000044  6d60              LDR      r0,[r4,#0x54]         ;317
000046  6520              STR      r0,[r4,#0x50]         ;317
000048  e04e              B        |L2.232|
                  |L2.74|
00004a  220a              MOVS     r2,#0xa               ;318
00004c  4928              LDR      r1,|L2.240|
00004e  4628              MOV      r0,r5                 ;318
000050  f7fffffe          BL       strncasecmp
000054  b930              CBNZ     r0,|L2.100|
000056  f104015d          ADD      r1,r4,#0x5d           ;320
00005a  f105000c          ADD      r0,r5,#0xc            ;320
00005e  f7fffffe          BL       httpd_parse_useragent
000062  e041              B        |L2.232|
                  |L2.100|
000064  220e              MOVS     r2,#0xe               ;322
000066  4923              LDR      r1,|L2.244|
000068  4628              MOV      r0,r5                 ;322
00006a  f7fffffe          BL       strncasecmp
00006e  b970              CBNZ     r0,|L2.142|
000070  4628              MOV      r0,r5                 ;323
000072  f7fffffe          BL       strlen
000076  4680              MOV      r8,r0                 ;323
000078  481e              LDR      r0,|L2.244|
00007a  f7fffffe          BL       strlen
00007e  1947              ADDS     r7,r0,r5              ;323
000080  4642              MOV      r2,r8                 ;323
000082  4639              MOV      r1,r7                 ;323
000084  f10400df          ADD      r0,r4,#0xdf           ;323
000088  f7fffffe          BL       __aeabi_memcpy
00008c  e02c              B        |L2.232|
                  |L2.142|
00008e  220d              MOVS     r2,#0xd               ;325
000090  a119              ADR      r1,|L2.248|
000092  4628              MOV      r0,r5                 ;325
000094  f7fffffe          BL       strncasecmp
000098  b9b0              CBNZ     r0,|L2.200|
00009a  2122              MOVS     r1,#0x22              ;330
00009c  4628              MOV      r0,r5                 ;330
00009e  f7fffffe          BL       strchr
0000a2  4607              MOV      r7,r0                 ;330
0000a4  b917              CBNZ     r7,|L2.172|
0000a6  f04f30ff          MOV      r0,#0xffffffff        ;333
0000aa  e7ba              B        |L2.34|
                  |L2.172|
0000ac  f1070801          ADD      r8,r7,#1              ;336
0000b0  4647              MOV      r7,r8                 ;336
0000b2  2210              MOVS     r2,#0x10              ;337
0000b4  2100              MOVS     r1,#0                 ;337
0000b6  4640              MOV      r0,r8                 ;337
0000b8  f7fffffe          BL       strtol
0000bc  f8c40160          STR      r0,[r4,#0x160]        ;337
0000c0  2001              MOVS     r0,#1                 ;338
0000c2  f884015f          STRB     r0,[r4,#0x15f]        ;338
0000c6  e00f              B        |L2.232|
                  |L2.200|
0000c8  2213              MOVS     r2,#0x13              ;339
0000ca  490f              LDR      r1,|L2.264|
0000cc  4628              MOV      r0,r5                 ;339
0000ce  f7fffffe          BL       strncasecmp
0000d2  b948              CBNZ     r0,|L2.232|
0000d4  2207              MOVS     r2,#7                 ;340
0000d6  a10d              ADR      r1,|L2.268|
0000d8  f1050013          ADD      r0,r5,#0x13           ;340
0000dc  f7fffffe          BL       strncasecmp
0000e0  b910              CBNZ     r0,|L2.232|
0000e2  2001              MOVS     r0,#1                 ;342
0000e4  f884005c          STRB     r0,[r4,#0x5c]         ;342
                  |L2.232|
0000e8  2000              MOVS     r0,#0                 ;344
0000ea  e79a              B        |L2.34|
;;;346    
                          ENDP

                  |L2.236|
                          DCD      http_content_len
                  |L2.240|
                          DCD      http_user_agent
                  |L2.244|
                          DCD      http_content_type
                  |L2.248|
0000f8  49662d4e          DCB      "If-None-Match",0
0000fc  6f6e652d
000100  4d617463
000104  6800    
000106  00                DCB      0
000107  00                DCB      0
                  |L2.264|
                          DCD      http_encoding
                  |L2.268|
00010c  6368756e          DCB      "chunked",0
000110  6b656400

                          AREA ||i.__httpd_parse_useragent||, CODE, READONLY, ALIGN=1

                  __httpd_parse_useragent PROC
;;;69     */
;;;70     static char *__httpd_parse_useragent(char *hdrline, char **product,
000000  b530              PUSH     {r4,r5,lr}
;;;71     				     char **version, char **comment)
;;;72     {
000002  4605              MOV      r5,r0
000004  460c              MOV      r4,r1
;;;73       char *token = hdrline;
000006  4629              MOV      r1,r5
;;;74       
;;;75       *product = 0;
000008  2000              MOVS     r0,#0
00000a  6020              STR      r0,[r4,#0]
;;;76       *version = 0;
00000c  6010              STR      r0,[r2,#0]
;;;77       *comment = 0;
00000e  6018              STR      r0,[r3,#0]
;;;78       
;;;79       /* User-Agent strings are composed of products and comments.  These are
;;;80       * space delimited.  Comments start with '(' and end with ')'.  Products
;;;81       * are either of the form "product/version" or just "product".
;;;82       */
;;;83       
;;;84       /* chomp any whitespace and find the beginning of the product */
;;;85       while (*token == ' ') {
000010  e004              B        |L3.28|
                  |L3.18|
;;;86         if (*token == 0)
000012  7808              LDRB     r0,[r1,#0]
000014  b908              CBNZ     r0,|L3.26|
;;;87           return 0;
000016  2000              MOVS     r0,#0
                  |L3.24|
;;;88         token++;
;;;89       }
;;;90       *product = token;
;;;91       
;;;92       while (1) {
;;;93         if (*token == 0) {
;;;94           /* We reached the end of the string. */
;;;95           return 0;
;;;96           
;;;97         } else if (*token == ' ') {
;;;98           /* We're done with this token.  Terminate it.  The next
;;;99           * is either an associated comment or the next token.
;;;100          */
;;;101          *token = 0;
;;;102          if (*(token + 1) != '(')
;;;103            return token + 1;
;;;104          
;;;105        } else if (*token == '/') {
;;;106          /* Found the version string. */
;;;107          *token = 0;
;;;108          *version = token + 1;
;;;109          
;;;110        } else if (*token == '(') {
;;;111          token++;
;;;112          *comment = token;
;;;113          /* comment may have embedded ' 's or '/', so find the
;;;114          * end here before continuing.
;;;115          */
;;;116          while (*token != ')') {
;;;117            if (*token == 0) {
;;;118              /* unexpected end of comment */
;;;119              return 0;
;;;120            }
;;;121            token++;
;;;122          }
;;;123          *token = 0;
;;;124          return token + 1;
;;;125          
;;;126        } else if (*token == '[') {
;;;127          /* non-standard legacy language code.  Skip it. */
;;;128          while (*token != ']') {
;;;129            if (*token == 0) {
;;;130              /* Unexpected end */
;;;131              return 0;
;;;132            }
;;;133            token++;
;;;134          }
;;;135        }
;;;136        token++;
;;;137      }
;;;138    }
000018  bd30              POP      {r4,r5,pc}
                  |L3.26|
00001a  1c49              ADDS     r1,r1,#1              ;88
                  |L3.28|
00001c  7808              LDRB     r0,[r1,#0]            ;85
00001e  2820              CMP      r0,#0x20              ;85
000020  d0f7              BEQ      |L3.18|
000022  6021              STR      r1,[r4,#0]            ;90
000024  e034              B        |L3.144|
                  |L3.38|
000026  7808              LDRB     r0,[r1,#0]            ;93
000028  b908              CBNZ     r0,|L3.46|
00002a  2000              MOVS     r0,#0                 ;95
00002c  e7f4              B        |L3.24|
                  |L3.46|
00002e  7808              LDRB     r0,[r1,#0]            ;97
000030  2820              CMP      r0,#0x20              ;97
000032  d106              BNE      |L3.66|
000034  2000              MOVS     r0,#0                 ;101
000036  7008              STRB     r0,[r1,#0]            ;101
000038  7848              LDRB     r0,[r1,#1]            ;102
00003a  2828              CMP      r0,#0x28              ;102
00003c  d027              BEQ      |L3.142|
00003e  1c48              ADDS     r0,r1,#1              ;103
000040  e7ea              B        |L3.24|
                  |L3.66|
000042  7808              LDRB     r0,[r1,#0]            ;105
000044  282f              CMP      r0,#0x2f              ;105
000046  d104              BNE      |L3.82|
000048  2000              MOVS     r0,#0                 ;107
00004a  7008              STRB     r0,[r1,#0]            ;107
00004c  1c48              ADDS     r0,r1,#1              ;108
00004e  6010              STR      r0,[r2,#0]            ;108
000050  e01d              B        |L3.142|
                  |L3.82|
000052  7808              LDRB     r0,[r1,#0]            ;110
000054  2828              CMP      r0,#0x28              ;110
000056  d10e              BNE      |L3.118|
000058  1c49              ADDS     r1,r1,#1              ;111
00005a  6019              STR      r1,[r3,#0]            ;112
00005c  e004              B        |L3.104|
                  |L3.94|
00005e  7808              LDRB     r0,[r1,#0]            ;117
000060  b908              CBNZ     r0,|L3.102|
000062  2000              MOVS     r0,#0                 ;119
000064  e7d8              B        |L3.24|
                  |L3.102|
000066  1c49              ADDS     r1,r1,#1              ;121
                  |L3.104|
000068  7808              LDRB     r0,[r1,#0]            ;116
00006a  2829              CMP      r0,#0x29              ;116
00006c  d1f7              BNE      |L3.94|
00006e  2000              MOVS     r0,#0                 ;123
000070  7008              STRB     r0,[r1,#0]            ;123
000072  1c48              ADDS     r0,r1,#1              ;124
000074  e7d0              B        |L3.24|
                  |L3.118|
000076  7808              LDRB     r0,[r1,#0]            ;126
000078  285b              CMP      r0,#0x5b              ;126
00007a  d108              BNE      |L3.142|
00007c  e004              B        |L3.136|
                  |L3.126|
00007e  7808              LDRB     r0,[r1,#0]            ;129
000080  b908              CBNZ     r0,|L3.134|
000082  2000              MOVS     r0,#0                 ;131
000084  e7c8              B        |L3.24|
                  |L3.134|
000086  1c49              ADDS     r1,r1,#1              ;133
                  |L3.136|
000088  7808              LDRB     r0,[r1,#0]            ;128
00008a  285d              CMP      r0,#0x5d              ;128
00008c  d1f7              BNE      |L3.126|
                  |L3.142|
00008e  1c49              ADDS     r1,r1,#1              ;136
                  |L3.144|
000090  e7c9              B        |L3.38|
;;;139    
                          ENDP


                          AREA ||i.char2nibble||, CODE, READONLY, ALIGN=1

                  char2nibble PROC
;;;519    * converting encoded characters to data. */
;;;520    static int char2nibble(char c)
000000  4601              MOV      r1,r0
;;;521    {
;;;522      if (c >= '0' && c <= '9')
000002  2930              CMP      r1,#0x30
000004  db04              BLT      |L4.16|
000006  2939              CMP      r1,#0x39
000008  dc02              BGT      |L4.16|
;;;523        return c - '0';
00000a  f1a10030          SUB      r0,r1,#0x30
                  |L4.14|
;;;524      else if (c >= 'A' && c <= 'F')
;;;525        return c - 'A' + 0xA;
;;;526      else if (c >= 'a' && c <= 'f')
;;;527        return c - 'a' + 0xa;
;;;528      
;;;529      return -1;
;;;530    }
00000e  4770              BX       lr
                  |L4.16|
000010  2941              CMP      r1,#0x41              ;524
000012  db04              BLT      |L4.30|
000014  2946              CMP      r1,#0x46              ;524
000016  dc02              BGT      |L4.30|
000018  f1a10037          SUB      r0,r1,#0x37           ;525
00001c  e7f7              B        |L4.14|
                  |L4.30|
00001e  2961              CMP      r1,#0x61              ;526
000020  db04              BLT      |L4.44|
000022  2966              CMP      r1,#0x66              ;526
000024  dc02              BGT      |L4.44|
000026  f1a10057          SUB      r0,r1,#0x57           ;527
00002a  e7f0              B        |L4.14|
                  |L4.44|
00002c  f04f30ff          MOV      r0,#0xffffffff        ;529
000030  e7ed              B        |L4.14|
;;;531    
                          ENDP


                          AREA ||i.httpd_get_tag_from_post_data||, CODE, READONLY, ALIGN=1

                  httpd_get_tag_from_post_data PROC
;;;663    */
;;;664    int httpd_get_tag_from_post_data(char *inbuf, const char *tag,
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;665    				 char *val, unsigned val_len)
;;;666    {
000004  4606              MOV      r6,r0
000006  460f              MOV      r7,r1
000008  4614              MOV      r4,r2
00000a  461d              MOV      r5,r3
;;;667      if (val_len <= 0)
00000c  b91d              CBNZ     r5,|L5.22|
;;;668        return -kInProgressErr;
00000e  f04f30ff          MOV      r0,#0xffffffff
                  |L5.18|
;;;669      *val = '\0';
;;;670      return __httpd_parse_all_tags(inbuf, tag, val, val_len);
;;;671    }
000012  e8bd81f0          POP      {r4-r8,pc}
                  |L5.22|
000016  2000              MOVS     r0,#0                 ;669
000018  7020              STRB     r0,[r4,#0]            ;669
00001a  462b              MOV      r3,r5                 ;670
00001c  4622              MOV      r2,r4                 ;670
00001e  4639              MOV      r1,r7                 ;670
000020  4630              MOV      r0,r6                 ;670
000022  f7fffffe          BL       __httpd_parse_all_tags
000026  e7f4              B        |L5.18|
;;;672    
                          ENDP


                          AREA ||i.httpd_get_tag_from_url||, CODE, READONLY, ALIGN=1

                  httpd_get_tag_from_url PROC
;;;674    */
;;;675    int httpd_get_tag_from_url(httpd_request_t *req_p, const char *tag,
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;676                               char *val, unsigned val_len)
;;;677    {
000004  4605              MOV      r5,r0
000006  4688              MOV      r8,r1
000008  4616              MOV      r6,r2
00000a  461f              MOV      r7,r3
;;;678      char *p;
;;;679      
;;;680      if (val_len <= 0)
00000c  b91f              CBNZ     r7,|L6.22|
;;;681        return -kInProgressErr;
00000e  f04f30ff          MOV      r0,#0xffffffff
                  |L6.18|
;;;682      
;;;683      *val = '\0';
;;;684      p = strchr(req_p->filename, '?');
;;;685      /* No tag=value pairs were present in the url */
;;;686      if (!p)
;;;687        return -kInProgressErr;
;;;688      
;;;689      return __httpd_parse_all_tags(p + 1, tag, val, val_len);
;;;690    }
000012  e8bd81f0          POP      {r4-r8,pc}
                  |L6.22|
000016  2000              MOVS     r0,#0                 ;683
000018  7030              STRB     r0,[r6,#0]            ;683
00001a  213f              MOVS     r1,#0x3f              ;684
00001c  1d28              ADDS     r0,r5,#4              ;684
00001e  f7fffffe          BL       strchr
000022  4604              MOV      r4,r0                 ;684
000024  b914              CBNZ     r4,|L6.44|
000026  f04f30ff          MOV      r0,#0xffffffff        ;687
00002a  e7f2              B        |L6.18|
                  |L6.44|
00002c  463b              MOV      r3,r7                 ;689
00002e  4632              MOV      r2,r6                 ;689
000030  4641              MOV      r1,r8                 ;689
000032  1c60              ADDS     r0,r4,#1              ;689
000034  f7fffffe          BL       __httpd_parse_all_tags
000038  e7eb              B        |L6.18|
                          ENDP


                          AREA ||i.httpd_next_token||, CODE, READONLY, ALIGN=1

                  httpd_next_token PROC
;;;395    */
;;;396    static const char *httpd_next_token(const char *data_p)
000000  e010              B        |L7.36|
                  |L7.2|
;;;397    {
;;;398      //	ASSERT(data_p != NULL);
;;;399      char c;
;;;400      
;;;401      /* skip over current token, but return if we're at the end of the
;;;402      * data */
;;;403      while (TRUE) {
;;;404        c = *data_p;
000002  7801              LDRB     r1,[r0,#0]
;;;405        if (c == '\0')
000004  b901              CBNZ     r1,|L7.8|
                  |L7.6|
;;;406          return data_p;
;;;407        if (iswhite(c))
;;;408          break;
;;;409        data_p++;
;;;410      }
;;;411      
;;;412      /* skip over white spaces after last token */
;;;413      while (TRUE) {
;;;414        c = *data_p;
;;;415        if ((c == '\0') || (!iswhite(c)))
;;;416          break;
;;;417        data_p++;
;;;418      }
;;;419      
;;;420      /* return the token */
;;;421      return (char *)data_p;
;;;422    }
000006  4770              BX       lr
                  |L7.8|
000008  290a              CMP      r1,#0xa               ;407
00000a  d005              BEQ      |L7.24|
00000c  290d              CMP      r1,#0xd               ;407
00000e  d003              BEQ      |L7.24|
000010  2920              CMP      r1,#0x20              ;407
000012  d001              BEQ      |L7.24|
000014  2909              CMP      r1,#9                 ;407
000016  d101              BNE      |L7.28|
                  |L7.24|
000018  2201              MOVS     r2,#1                 ;407
00001a  e000              B        |L7.30|
                  |L7.28|
00001c  2200              MOVS     r2,#0                 ;407
                  |L7.30|
00001e  b102              CBZ      r2,|L7.34|
000020  e001              B        |L7.38|
                  |L7.34|
000022  1c40              ADDS     r0,r0,#1              ;409
                  |L7.36|
000024  e7ed              B        |L7.2|
                  |L7.38|
000026  bf00              NOP                            ;408
000028  e00f              B        |L7.74|
                  |L7.42|
00002a  7801              LDRB     r1,[r0,#0]            ;414
00002c  b159              CBZ      r1,|L7.70|
00002e  290a              CMP      r1,#0xa               ;415
000030  d005              BEQ      |L7.62|
000032  290d              CMP      r1,#0xd               ;415
000034  d003              BEQ      |L7.62|
000036  2920              CMP      r1,#0x20              ;415
000038  d001              BEQ      |L7.62|
00003a  2909              CMP      r1,#9                 ;415
00003c  d101              BNE      |L7.66|
                  |L7.62|
00003e  2201              MOVS     r2,#1                 ;415
000040  e000              B        |L7.68|
                  |L7.66|
000042  2200              MOVS     r2,#0                 ;415
                  |L7.68|
000044  b902              CBNZ     r2,|L7.72|
                  |L7.70|
000046  e001              B        |L7.76|
                  |L7.72|
000048  1c40              ADDS     r0,r0,#1              ;417
                  |L7.74|
00004a  e7ee              B        |L7.42|
                  |L7.76|
00004c  bf00              NOP                            ;416
00004e  bf00              NOP                            ;421
000050  e7d9              B        |L7.6|
;;;423    
                          ENDP


                          AREA ||i.httpd_parse_hdr_main||, CODE, READONLY, ALIGN=2

                  httpd_parse_hdr_main PROC
;;;476    */
;;;477    int httpd_parse_hdr_main(const char *data_p, httpd_request_t * req_p)
000000  e92d43fe          PUSH     {r1-r9,lr}
;;;478    {
000004  4680              MOV      r8,r0
000006  460d              MOV      r5,r1
;;;479      const char *ptr, *next;
;;;480      int err;
;;;481    #define TOKEN_LEN 10
;;;482      char token[TOKEN_LEN];
;;;483      
;;;484      /* First token is usually GET/POST */
;;;485      err = httpd_verify_req_type(data_p, &req_p->type);
000008  4629              MOV      r1,r5
00000a  4640              MOV      r0,r8
00000c  f7fffffe          BL       httpd_verify_req_type
000010  4607              MOV      r7,r0
;;;486      if (err != kNoErr) {
000012  b12f              CBZ      r7,|L8.32|
;;;487        httpd_d("Unknown request type %s", data_p);
;;;488        httpd_purge_headers(req_p->sock);
000014  6ca8              LDR      r0,[r5,#0x48]
000016  f7fffffe          BL       httpd_purge_headers
;;;489        return err;
00001a  4638              MOV      r0,r7
                  |L8.28|
;;;490      }
;;;491      
;;;492      /* Second token: Filename */
;;;493      ptr = httpd_next_token(data_p);
;;;494      next = ptr;
;;;495      
;;;496      err = httpd_token_cpy(ptr, req_p->filename, HTTPD_MAX_URI_LENGTH);
;;;497      if (err != kNoErr) {
;;;498        httpd_set_error("Error processing token: filename. "
;;;499                        "Filename missing or too long?");
;;;500        return -WM_E_HTTPD_HDR_FNAME;
;;;501      }
;;;502      
;;;503      /* Third token: HTTP version */
;;;504      ptr = httpd_next_token(next);
;;;505      next = ptr;
;;;506      
;;;507      err = httpd_token_cpy(ptr, token, TOKEN_LEN);
;;;508      if (!strncmp(token, http_10, TOKEN_LEN)) {
;;;509        httpd_set_error("HTTP/1.0 clients are not supported");
;;;510        return -WM_E_HTTPD_NOTSUPP;
;;;511      }
;;;512      
;;;513      return kNoErr;
;;;514    }
00001c  e8bd83fe          POP      {r1-r9,pc}
                  |L8.32|
000020  4640              MOV      r0,r8                 ;493
000022  f7fffffe          BL       httpd_next_token
000026  4604              MOV      r4,r0                 ;493
000028  4626              MOV      r6,r4                 ;494
00002a  2240              MOVS     r2,#0x40              ;496
00002c  1d29              ADDS     r1,r5,#4              ;496
00002e  4620              MOV      r0,r4                 ;496
000030  f7fffffe          BL       httpd_token_cpy
000034  4607              MOV      r7,r0                 ;496
000036  b12f              CBZ      r7,|L8.68|
000038  a00f              ADR      r0,|L8.120|
00003a  f7fffffe          BL       httpd_set_error
00003e  f04f30ff          MOV      r0,#0xffffffff        ;500
000042  e7eb              B        |L8.28|
                  |L8.68|
000044  4630              MOV      r0,r6                 ;504
000046  f7fffffe          BL       httpd_next_token
00004a  4604              MOV      r4,r0                 ;504
00004c  4626              MOV      r6,r4                 ;505
00004e  220a              MOVS     r2,#0xa               ;507
000050  4669              MOV      r1,sp                 ;507
000052  4620              MOV      r0,r4                 ;507
000054  f7fffffe          BL       httpd_token_cpy
000058  4607              MOV      r7,r0                 ;507
00005a  220a              MOVS     r2,#0xa               ;508
00005c  4916              LDR      r1,|L8.184|
00005e  4668              MOV      r0,sp                 ;508
000060  f7fffffe          BL       strncmp
000064  b928              CBNZ     r0,|L8.114|
000066  a015              ADR      r0,|L8.188|
000068  f7fffffe          BL       httpd_set_error
00006c  f06f0001          MVN      r0,#1                 ;510
000070  e7d4              B        |L8.28|
                  |L8.114|
000072  2000              MOVS     r0,#0                 ;513
000074  e7d2              B        |L8.28|
;;;515    
                          ENDP

000076  0000              DCW      0x0000
                  |L8.120|
000078  4572726f          DCB      "Error processing token: filename. Filename missing or t"
00007c  72207072
000080  6f636573
000084  73696e67
000088  20746f6b
00008c  656e3a20
000090  66696c65
000094  6e616d65
000098  2e204669
00009c  6c656e61
0000a0  6d65206d
0000a4  69737369
0000a8  6e67206f
0000ac  722074  
0000af  6f6f206c          DCB      "oo long?",0
0000b3  6f6e673f
0000b7  00      
                  |L8.184|
                          DCD      http_10
                  |L8.188|
0000bc  48545450          DCB      "HTTP/1.0 clients are not supported",0
0000c0  2f312e30
0000c4  20636c69
0000c8  656e7473
0000cc  20617265
0000d0  206e6f74
0000d4  20737570
0000d8  706f7274
0000dc  656400  
0000df  00                DCB      0

                          AREA ||i.httpd_parse_hdr_tags||, CODE, READONLY, ALIGN=1

                  httpd_parse_hdr_tags PROC
;;;348    * parse the headers contained in them. */
;;;349    int httpd_parse_hdr_tags(httpd_request_t *req, int sock, char *buffer, int len)
000000  e92d43f8          PUSH     {r3-r9,lr}
;;;350    {
000004  4607              MOV      r7,r0
000006  4688              MOV      r8,r1
000008  4615              MOV      r5,r2
00000a  4699              MOV      r9,r3
;;;351      int req_line_len;
;;;352      int err;
;;;353      uint8_t done = 0;
00000c  2000              MOVS     r0,#0
00000e  9000              STR      r0,[sp,#0]
;;;354      
;;;355      while (TRUE) {
000010  e01b              B        |L9.74|
                  |L9.18|
;;;356        req_line_len = htsys_getln_soc(sock, buffer, len);
000012  464a              MOV      r2,r9
000014  4629              MOV      r1,r5
000016  4640              MOV      r0,r8
000018  f7fffffe          BL       htsys_getln_soc
00001c  4604              MOV      r4,r0
;;;357        if (req_line_len == -kInProgressErr) {
00001e  1c60              ADDS     r0,r4,#1
000020  b918              CBNZ     r0,|L9.42|
;;;358          httpd_d("Could not read line from socket");
;;;359          return -kInProgressErr;
000022  f04f30ff          MOV      r0,#0xffffffff
                  |L9.38|
;;;360        }
;;;361        
;;;362        err = __httpd_parse_hdr_tags(buffer, req_line_len, req, &done);
;;;363        if (err != kNoErr)
;;;364          return err;
;;;365        if (done == 1) {
;;;366          if (req->agent.product[0] != 0) {
;;;367            /* Populate the diagnostics statistics variable
;;;368            * with the user agent string.  Do not do
;;;369            * anything if the agent string is NULL
;;;370            * (http-client). This is required since this
;;;371            * code is used by http server as well as client
;;;372            * and we do not want the user agent diagnostics
;;;373            * variable to change during the client code
;;;374            * path
;;;375            */
;;;376            /* Note that, currently wm_hd_useragent is
;;;377            * populated only for file handling requests and
;;;378            * HTTP POST requests and not for HTTP GET. This
;;;379            * is because, in GET requests we directly purge
;;;380            * all the headers without reading them and
;;;381            * hence do not populate the useragent */
;;;382            //				memcpy(&g_wm_stats.wm_hd_useragent, &req->agent,
;;;383            //				       sizeof(g_wm_stats.wm_hd_useragent));
;;;384            //				g_wm_stats.wm_hd_time = wmtime_time_get_posix();
;;;385          }
;;;386          return kNoErr;
;;;387        }
;;;388      }
;;;389    }
000026  e8bd83f8          POP      {r3-r9,pc}
                  |L9.42|
00002a  466b              MOV      r3,sp                 ;362
00002c  463a              MOV      r2,r7                 ;362
00002e  4621              MOV      r1,r4                 ;362
000030  4628              MOV      r0,r5                 ;362
000032  f7fffffe          BL       __httpd_parse_hdr_tags
000036  4606              MOV      r6,r0                 ;362
000038  b10e              CBZ      r6,|L9.62|
00003a  4630              MOV      r0,r6                 ;364
00003c  e7f3              B        |L9.38|
                  |L9.62|
00003e  f89d0000          LDRB     r0,[sp,#0]            ;365
000042  2801              CMP      r0,#1                 ;365
000044  d101              BNE      |L9.74|
000046  2000              MOVS     r0,#0                 ;386
000048  e7ed              B        |L9.38|
                  |L9.74|
00004a  e7e2              B        |L9.18|
;;;390    
                          ENDP


                          AREA ||i.httpd_parse_msgbody||, CODE, READONLY, ALIGN=1

                  httpd_parse_msgbody PROC
;;;533    */
;;;534    static char *httpd_parse_msgbody(char *data_p, const char *tag,
000000  e92d5fff          PUSH     {r0-r12,lr}
;;;535                                     char *val, unsigned val_len, short *found)
;;;536    {
000004  4682              MOV      r10,r0
000006  4617              MOV      r7,r2
000008  469b              MOV      r11,r3
;;;537      int i, c1, c2;
;;;538      char *ptr;
;;;539      const char *tag_p;
;;;540      
;;;541      *found = 0;
00000a  2100              MOVS     r1,#0
00000c  980e              LDR      r0,[sp,#0x38]
00000e  8001              STRH     r1,[r0,#0]
;;;542      
;;;543      if (data_p == NULL || *data_p == '\0')
000010  f1ba0f00          CMP      r10,#0
000014  d002              BEQ      |L10.28|
000016  f89a0000          LDRB     r0,[r10,#0]
00001a  b918              CBNZ     r0,|L10.36|
                  |L10.28|
;;;544        return NULL;
00001c  2000              MOVS     r0,#0
                  |L10.30|
;;;545      
;;;546      ptr = data_p;
;;;547      tag_p = tag;
;;;548      while (1) {
;;;549        if (*ptr == 0) {
;;;550          httpd_d("End of string reached");
;;;551          return NULL;
;;;552        }
;;;553        if (*ptr == '=') {
;;;554          /* End of tag */
;;;555          if (*tag_p != 0)
;;;556            goto next_token;
;;;557          else
;;;558            break;
;;;559        }
;;;560        /* perform url decode */
;;;561        if (*ptr == '%') {
;;;562          ptr++;
;;;563          c1 = char2nibble(*ptr++);
;;;564          c2 = char2nibble(*ptr++);
;;;565          if (c1 == -1 || c2 == -1) {
;;;566            httpd_d("Invalid URL-encoded"
;;;567                    " string. Ignoring.");
;;;568            return NULL;
;;;569          }
;;;570          if (*tag_p != ((c1 << 4) | c2))
;;;571            goto next_token;
;;;572          tag_p++;
;;;573        } else if (*ptr == '+') {
;;;574          if (*tag_p != ' ')
;;;575            goto next_token;
;;;576          tag_p++;
;;;577          ptr++;
;;;578        } else {
;;;579          if (*tag_p != *ptr)
;;;580            goto next_token;
;;;581          ptr++;
;;;582          tag_p++;
;;;583        }
;;;584      }
;;;585      
;;;586      /* We come here only if tag was found */
;;;587      *found = 1;
;;;588      ptr = strchr(ptr, '=');	/* skip to next token */
;;;589      if (ptr == NULL) {
;;;590        httpd_d("No = after tag");
;;;591        return NULL;
;;;592      }
;;;593      ptr++;
;;;594      
;;;595      for (i = 0; i < val_len; i++) {
;;;596        if ((*ptr == '&') || (*ptr == 0)) {
;;;597          val[i] = 0;
;;;598          break;
;;;599        }
;;;600        
;;;601        /* perform url decode */
;;;602        if (*ptr == '%') {
;;;603          ptr++;
;;;604          c1 = char2nibble(*ptr++);
;;;605          c2 = char2nibble(*ptr++);
;;;606          if (c1 == -1 || c2 == -1) {
;;;607            httpd_d("Invalid URL-encoded"
;;;608                    " string. Ignoring.");
;;;609            return NULL;
;;;610          }
;;;611          val[i] = (c1 << 4) | c2;
;;;612        } else if (*ptr == '+') {
;;;613          val[i] = ' ';
;;;614          ptr++;
;;;615        } else {
;;;616          val[i] = *ptr++;
;;;617        }
;;;618      }
;;;619      
;;;620      if (i == val_len) {
;;;621        val[val_len] = 0;
;;;622        if ((*ptr != '&') && (*ptr != 0))
;;;623          httpd_d("Max val length exceeded.  "
;;;624                  "Truncating value ");
;;;625      }
;;;626      
;;;627    next_token:
;;;628      ptr = strchr(ptr, '&');	/* skip to next token */
;;;629      
;;;630      if (ptr == NULL) {
;;;631        return NULL;
;;;632      }
;;;633      
;;;634      return ptr + 1;
;;;635    }
00001e  b004              ADD      sp,sp,#0x10
000020  e8bd9ff0          POP      {r4-r12,pc}
                  |L10.36|
000024  4654              MOV      r4,r10                ;546
000026  9e01              LDR      r6,[sp,#4]            ;547
000028  e039              B        |L10.158|
                  |L10.42|
00002a  7820              LDRB     r0,[r4,#0]            ;549
00002c  b908              CBNZ     r0,|L10.50|
00002e  2000              MOVS     r0,#0                 ;551
000030  e7f5              B        |L10.30|
                  |L10.50|
000032  7820              LDRB     r0,[r4,#0]            ;553
000034  283d              CMP      r0,#0x3d              ;553
000036  d103              BNE      |L10.64|
000038  7830              LDRB     r0,[r6,#0]            ;555
00003a  b100              CBZ      r0,|L10.62|
00003c  e076              B        |L10.300|
                  |L10.62|
00003e  e02f              B        |L10.160|
                  |L10.64|
000040  7820              LDRB     r0,[r4,#0]            ;561
000042  2825              CMP      r0,#0x25              ;561
000044  d11a              BNE      |L10.124|
000046  1c64              ADDS     r4,r4,#1              ;562
000048  f8140b01          LDRB     r0,[r4],#1            ;563
00004c  f7fffffe          BL       char2nibble
000050  4681              MOV      r9,r0                 ;563
000052  f8140b01          LDRB     r0,[r4],#1            ;564
000056  f7fffffe          BL       char2nibble
00005a  4680              MOV      r8,r0                 ;564
00005c  f1090001          ADD      r0,r9,#1              ;565
000060  b110              CBZ      r0,|L10.104|
000062  f1080001          ADD      r0,r8,#1              ;565
000066  b908              CBNZ     r0,|L10.108|
                  |L10.104|
000068  2000              MOVS     r0,#0                 ;568
00006a  e7d8              B        |L10.30|
                  |L10.108|
00006c  7830              LDRB     r0,[r6,#0]            ;570
00006e  ea481109          ORR      r1,r8,r9,LSL #4       ;570
000072  4288              CMP      r0,r1                 ;570
000074  d000              BEQ      |L10.120|
000076  e059              B        |L10.300|
                  |L10.120|
000078  1c76              ADDS     r6,r6,#1              ;572
00007a  e010              B        |L10.158|
                  |L10.124|
00007c  7820              LDRB     r0,[r4,#0]            ;573
00007e  282b              CMP      r0,#0x2b              ;573
000080  d106              BNE      |L10.144|
000082  7830              LDRB     r0,[r6,#0]            ;574
000084  2820              CMP      r0,#0x20              ;574
000086  d000              BEQ      |L10.138|
000088  e050              B        |L10.300|
                  |L10.138|
00008a  1c76              ADDS     r6,r6,#1              ;576
00008c  1c64              ADDS     r4,r4,#1              ;577
00008e  e006              B        |L10.158|
                  |L10.144|
000090  7830              LDRB     r0,[r6,#0]            ;579
000092  7821              LDRB     r1,[r4,#0]            ;579
000094  4288              CMP      r0,r1                 ;579
000096  d000              BEQ      |L10.154|
000098  e048              B        |L10.300|
                  |L10.154|
00009a  1c64              ADDS     r4,r4,#1              ;581
00009c  1c76              ADDS     r6,r6,#1              ;582
                  |L10.158|
00009e  e7c4              B        |L10.42|
                  |L10.160|
0000a0  bf00              NOP                            ;558
0000a2  2101              MOVS     r1,#1                 ;587
0000a4  980e              LDR      r0,[sp,#0x38]         ;587
0000a6  8001              STRH     r1,[r0,#0]            ;587
0000a8  213d              MOVS     r1,#0x3d              ;588
0000aa  4620              MOV      r0,r4                 ;588
0000ac  f7fffffe          BL       strchr
0000b0  4604              MOV      r4,r0                 ;588
0000b2  b90c              CBNZ     r4,|L10.184|
0000b4  2000              MOVS     r0,#0                 ;591
0000b6  e7b2              B        |L10.30|
                  |L10.184|
0000b8  1c64              ADDS     r4,r4,#1              ;593
0000ba  2500              MOVS     r5,#0                 ;595
0000bc  e02c              B        |L10.280|
                  |L10.190|
0000be  7820              LDRB     r0,[r4,#0]            ;596
0000c0  2826              CMP      r0,#0x26              ;596
0000c2  d001              BEQ      |L10.200|
0000c4  7820              LDRB     r0,[r4,#0]            ;596
0000c6  b910              CBNZ     r0,|L10.206|
                  |L10.200|
0000c8  2000              MOVS     r0,#0                 ;597
0000ca  5578              STRB     r0,[r7,r5]            ;597
0000cc  e026              B        |L10.284|
                  |L10.206|
0000ce  7820              LDRB     r0,[r4,#0]            ;602
0000d0  2825              CMP      r0,#0x25              ;602
0000d2  d116              BNE      |L10.258|
0000d4  1c64              ADDS     r4,r4,#1              ;603
0000d6  f8140b01          LDRB     r0,[r4],#1            ;604
0000da  f7fffffe          BL       char2nibble
0000de  4681              MOV      r9,r0                 ;604
0000e0  f8140b01          LDRB     r0,[r4],#1            ;605
0000e4  f7fffffe          BL       char2nibble
0000e8  4680              MOV      r8,r0                 ;605
0000ea  f1090001          ADD      r0,r9,#1              ;606
0000ee  b110              CBZ      r0,|L10.246|
0000f0  f1080001          ADD      r0,r8,#1              ;606
0000f4  b908              CBNZ     r0,|L10.250|
                  |L10.246|
0000f6  2000              MOVS     r0,#0                 ;609
0000f8  e791              B        |L10.30|
                  |L10.250|
0000fa  ea481009          ORR      r0,r8,r9,LSL #4       ;611
0000fe  5578              STRB     r0,[r7,r5]            ;611
000100  e009              B        |L10.278|
                  |L10.258|
000102  7820              LDRB     r0,[r4,#0]            ;612
000104  282b              CMP      r0,#0x2b              ;612
000106  d103              BNE      |L10.272|
000108  2020              MOVS     r0,#0x20              ;613
00010a  5578              STRB     r0,[r7,r5]            ;613
00010c  1c64              ADDS     r4,r4,#1              ;614
00010e  e002              B        |L10.278|
                  |L10.272|
000110  f8140b01          LDRB     r0,[r4],#1            ;616
000114  5578              STRB     r0,[r7,r5]            ;616
                  |L10.278|
000116  1c6d              ADDS     r5,r5,#1              ;595
                  |L10.280|
000118  455d              CMP      r5,r11                ;595
00011a  d3d0              BCC      |L10.190|
                  |L10.284|
00011c  bf00              NOP                            ;598
00011e  455d              CMP      r5,r11                ;620
000120  d103              BNE      |L10.298|
000122  2000              MOVS     r0,#0                 ;621
000124  f807000b          STRB     r0,[r7,r11]           ;621
000128  bf00              NOP                            ;622
                  |L10.298|
00012a  bf00              NOP                            ;627
                  |L10.300|
00012c  2126              MOVS     r1,#0x26              ;628
00012e  4620              MOV      r0,r4                 ;628
000130  f7fffffe          BL       strchr
000134  4604              MOV      r4,r0                 ;628
000136  b90c              CBNZ     r4,|L10.316|
000138  2000              MOVS     r0,#0                 ;631
00013a  e770              B        |L10.30|
                  |L10.316|
00013c  1c60              ADDS     r0,r4,#1              ;634
00013e  e76e              B        |L10.30|
;;;636    
                          ENDP


                          AREA ||i.httpd_parse_useragent||, CODE, READONLY, ALIGN=2

                  httpd_parse_useragent PROC
;;;157    #define MOZ_COMPATIBLE "compatible;"
;;;158    void httpd_parse_useragent(char *hdrline, httpd_useragent_t * agent)
000000  b5f0              PUSH     {r4-r7,lr}
;;;159    {
000002  b087              SUB      sp,sp,#0x1c
000004  4606              MOV      r6,r0
000006  460c              MOV      r4,r1
;;;160      char *token, *product, *p, *version, *v, *comment, *dummy;
;;;161      int len;
;;;162      
;;;163      /* Inpsect the first token. */
;;;164      hdrline = __httpd_parse_useragent(hdrline, &product,
000008  ab02              ADD      r3,sp,#8
00000a  aa04              ADD      r2,sp,#0x10
00000c  a906              ADD      r1,sp,#0x18
00000e  4630              MOV      r0,r6
000010  f7fffffe          BL       __httpd_parse_useragent
000014  4606              MOV      r6,r0
;;;165                                        &version, &comment);
;;;166      if (!product)
000016  9806              LDR      r0,[sp,#0x18]
000018  b900              CBNZ     r0,|L11.28|
;;;167        goto done;
00001a  e0ca              B        |L11.434|
                  |L11.28|
;;;168      
;;;169      if (strcmp(product, "Mozilla") == 0) {
00001c  a19c              ADR      r1,|L11.656|
00001e  9806              LDR      r0,[sp,#0x18]
000020  f7fffffe          BL       strcmp
000024  2800              CMP      r0,#0
000026  d17d              BNE      |L11.292|
;;;170        if (comment && strncmp(comment, MOZ_COMPATIBLE, sizeof(MOZ_COMPATIBLE) - 1) == 0) {
000028  9802              LDR      r0,[sp,#8]
00002a  2800              CMP      r0,#0
00002c  d02d              BEQ      |L11.138|
00002e  220b              MOVS     r2,#0xb
000030  a199              ADR      r1,|L11.664|
000032  9802              LDR      r0,[sp,#8]
000034  f7fffffe          BL       strncmp
000038  bb38              CBNZ     r0,|L11.138|
;;;171          /* If this is a "mozilla compatible" browser, parse it
;;;172          * and be done. */
;;;173          token = strstr(comment, " ") + 1;
00003a  a19a              ADR      r1,|L11.676|
00003c  9802              LDR      r0,[sp,#8]
00003e  f7fffffe          BL       strstr
000042  1c47              ADDS     r7,r0,#1
;;;174          token = __httpd_parse_useragent(token, &product,
000044  ab02              ADD      r3,sp,#8
000046  aa04              ADD      r2,sp,#0x10
000048  a906              ADD      r1,sp,#0x18
00004a  4638              MOV      r0,r7
00004c  f7fffffe          BL       __httpd_parse_useragent
000050  4607              MOV      r7,r0
;;;175                                          &version, &comment);
;;;176          /* Sometimes when the product and version are found
;;;177          * within a comment, the version is separated by a space
;;;178          * from the product, not the '/'.  This appears as the
;;;179          * next product to our token parser.  If it is numeric,
;;;180          * assume it's the version.
;;;181          */
;;;182          if (product && !version && token) {
000052  9806              LDR      r0,[sp,#0x18]
000054  b198              CBZ      r0,|L11.126|
000056  9804              LDR      r0,[sp,#0x10]
000058  b988              CBNZ     r0,|L11.126|
00005a  b187              CBZ      r7,|L11.126|
;;;183            token = __httpd_parse_useragent(token, &version,
00005c  ab02              ADD      r3,sp,#8
00005e  aa01              ADD      r2,sp,#4
000060  a904              ADD      r1,sp,#0x10
000062  4638              MOV      r0,r7
000064  f7fffffe          BL       __httpd_parse_useragent
000068  4607              MOV      r7,r0
;;;184                                            &dummy,
;;;185                                            &comment);
;;;186            if (*version < '0' || *version > '9')
00006a  9804              LDR      r0,[sp,#0x10]
00006c  7800              LDRB     r0,[r0,#0]
00006e  2830              CMP      r0,#0x30
000070  db03              BLT      |L11.122|
000072  9804              LDR      r0,[sp,#0x10]
000074  7800              LDRB     r0,[r0,#0]
000076  2839              CMP      r0,#0x39
000078  dd01              BLE      |L11.126|
                  |L11.122|
;;;187              version = 0;
00007a  2000              MOVS     r0,#0
00007c  9004              STR      r0,[sp,#0x10]
                  |L11.126|
;;;188          }
;;;189          
;;;190          /* Now, some browsers report Mozilla compatible MSIE,
;;;191          * but are actually something else!  Keep parsing these
;;;192          * ones.  Otherwise, we're done.
;;;193          */
;;;194          if (strcmp(product, "MSIE") != 0)
00007e  a18a              ADR      r1,|L11.680|
000080  9806              LDR      r0,[sp,#0x18]
000082  f7fffffe          BL       strcmp
000086  b100              CBZ      r0,|L11.138|
;;;195            goto done;
000088  e093              B        |L11.434|
                  |L11.138|
;;;196        }
;;;197        
;;;198        if (!hdrline)
00008a  b906              CBNZ     r6,|L11.142|
;;;199          goto done;
00008c  e091              B        |L11.434|
                  |L11.142|
;;;200        
;;;201        /* If this is not a "mozilla compatible" browser, step through
;;;202        * the rest of the product/version (comment) tokens and try to
;;;203        * figure out what it is.
;;;204        */
;;;205        while (1) {
00008e  e070              B        |L11.370|
                  |L11.144|
;;;206          
;;;207          hdrline = __httpd_parse_useragent(hdrline, &p,
000090  ab02              ADD      r3,sp,#8
000092  aa03              ADD      r2,sp,#0xc
000094  a905              ADD      r1,sp,#0x14
000096  4630              MOV      r0,r6
000098  f7fffffe          BL       __httpd_parse_useragent
00009c  4606              MOV      r6,r0
;;;208                                            &v, &comment);
;;;209          if (!p ||
00009e  9805              LDR      r0,[sp,#0x14]
0000a0  2800              CMP      r0,#0
0000a2  d041              BEQ      |L11.296|
;;;210              strcmp(p, "Galeon") == 0 ||
0000a4  a182              ADR      r1,|L11.688|
0000a6  9805              LDR      r0,[sp,#0x14]
0000a8  f7fffffe          BL       strcmp
0000ac  2800              CMP      r0,#0
0000ae  d03b              BEQ      |L11.296|
;;;211                strcmp(p, "safari") == 0 ||
0000b0  a181              ADR      r1,|L11.696|
0000b2  9805              LDR      r0,[sp,#0x14]
0000b4  f7fffffe          BL       strcmp
0000b8  2800              CMP      r0,#0
0000ba  d035              BEQ      |L11.296|
;;;212                  strcmp(p, "Safari") == 0 ||
0000bc  a180              ADR      r1,|L11.704|
0000be  9805              LDR      r0,[sp,#0x14]
0000c0  f7fffffe          BL       strcmp
0000c4  2800              CMP      r0,#0
0000c6  d02f              BEQ      |L11.296|
;;;213                    strcmp(p, "Shiira") == 0 ||
0000c8  a17f              ADR      r1,|L11.712|
0000ca  9805              LDR      r0,[sp,#0x14]
0000cc  f7fffffe          BL       strcmp
0000d0  2800              CMP      r0,#0
0000d2  d029              BEQ      |L11.296|
;;;214                      strcmp(p, "OmniWeb") == 0 ||
0000d4  a17e              ADR      r1,|L11.720|
0000d6  9805              LDR      r0,[sp,#0x14]
0000d8  f7fffffe          BL       strcmp
0000dc  b320              CBZ      r0,|L11.296|
;;;215                        strcmp(p, "Firefox") == 0 ||
0000de  a17e              ADR      r1,|L11.728|
0000e0  9805              LDR      r0,[sp,#0x14]
0000e2  f7fffffe          BL       strcmp
0000e6  b1f8              CBZ      r0,|L11.296|
;;;216                          strcmp(p, "Camino") == 0 ||
0000e8  a17d              ADR      r1,|L11.736|
0000ea  9805              LDR      r0,[sp,#0x14]
0000ec  f7fffffe          BL       strcmp
0000f0  b1d0              CBZ      r0,|L11.296|
;;;217                            strcmp(p, "Phoenix") == 0 ||
0000f2  a17d              ADR      r1,|L11.744|
0000f4  9805              LDR      r0,[sp,#0x14]
0000f6  f7fffffe          BL       strcmp
0000fa  b1a8              CBZ      r0,|L11.296|
;;;218                              strcmp(p, "Netscape6") == 0 ||
0000fc  a17c              ADR      r1,|L11.752|
0000fe  9805              LDR      r0,[sp,#0x14]
000100  f7fffffe          BL       strcmp
000104  b180              CBZ      r0,|L11.296|
;;;219    			    strcmp(p, "Netscape") == 0 ||
000106  a17d              ADR      r1,|L11.764|
000108  9805              LDR      r0,[sp,#0x14]
00010a  f7fffffe          BL       strcmp
00010e  b158              CBZ      r0,|L11.296|
;;;220                                  strcmp(p, "NetFront") == 0 ||
000110  a17d              ADR      r1,|L11.776|
000112  9805              LDR      r0,[sp,#0x14]
000114  f7fffffe          BL       strcmp
000118  b130              CBZ      r0,|L11.296|
;;;221                                    strcmp(p, "WebTV") == 0) {
00011a  a17e              ADR      r1,|L11.788|
00011c  9805              LDR      r0,[sp,#0x14]
00011e  f7fffffe          BL       strcmp
000122  e000              B        |L11.294|
                  |L11.292|
000124  e026              B        |L11.372|
                  |L11.294|
000126  b920              CBNZ     r0,|L11.306|
                  |L11.296|
;;;222                                      product = p;
000128  9805              LDR      r0,[sp,#0x14]
00012a  9006              STR      r0,[sp,#0x18]
;;;223                                      version = v;
00012c  9803              LDR      r0,[sp,#0xc]
00012e  9004              STR      r0,[sp,#0x10]
;;;224                                      goto done;
000130  e03f              B        |L11.434|
                  |L11.306|
;;;225                                    } else if (strcmp(p, "Opera") == 0) {
000132  a17a              ADR      r1,|L11.796|
000134  9805              LDR      r0,[sp,#0x14]
000136  f7fffffe          BL       strcmp
00013a  b9c0              CBNZ     r0,|L11.366|
;;;226                                      /* Many Opera browsers say "Opera VER" instead
;;;227                                      * of Opera/VER */
;;;228                                      product = p;
00013c  9805              LDR      r0,[sp,#0x14]
00013e  9006              STR      r0,[sp,#0x18]
;;;229                                      version = v;
000140  9803              LDR      r0,[sp,#0xc]
000142  9004              STR      r0,[sp,#0x10]
;;;230                                      if (v == 0 && hdrline) {
000144  9803              LDR      r0,[sp,#0xc]
000146  b988              CBNZ     r0,|L11.364|
000148  b186              CBZ      r6,|L11.364|
;;;231                                        hdrline =
00014a  ab02              ADD      r3,sp,#8
00014c  aa01              ADD      r2,sp,#4
00014e  a904              ADD      r1,sp,#0x10
000150  4630              MOV      r0,r6
000152  f7fffffe          BL       __httpd_parse_useragent
000156  4606              MOV      r6,r0
;;;232                                          __httpd_parse_useragent(hdrline,
;;;233                                                                  &version,
;;;234                                                                  &dummy,
;;;235                                                                  &comment);
;;;236                                        if (*version < '0' || *version > '9')
000158  9804              LDR      r0,[sp,#0x10]
00015a  7800              LDRB     r0,[r0,#0]
00015c  2830              CMP      r0,#0x30
00015e  db03              BLT      |L11.360|
000160  9804              LDR      r0,[sp,#0x10]
000162  7800              LDRB     r0,[r0,#0]
000164  2839              CMP      r0,#0x39
000166  dd01              BLE      |L11.364|
                  |L11.360|
;;;237                                          version = 0;
000168  2000              MOVS     r0,#0
00016a  9004              STR      r0,[sp,#0x10]
                  |L11.364|
;;;238                                      }
;;;239                                      goto done;
00016c  e021              B        |L11.434|
                  |L11.366|
;;;240                                    }
;;;241          
;;;242          if (!hdrline)
00016e  b906              CBNZ     r6,|L11.370|
;;;243            goto done;
000170  e01f              B        |L11.434|
                  |L11.370|
000172  e78d              B        |L11.144|
                  |L11.372|
;;;244        }
;;;245      } else if ((strcmp(product, "MSIE") == 0 ||
000174  a14c              ADR      r1,|L11.680|
000176  9806              LDR      r0,[sp,#0x18]
000178  f7fffffe          BL       strcmp
00017c  b120              CBZ      r0,|L11.392|
;;;246                  strcmp(product, "Netscape")	== 0) &&
00017e  a15f              ADR      r1,|L11.764|
000180  9806              LDR      r0,[sp,#0x18]
000182  f7fffffe          BL       strcmp
000186  b998              CBNZ     r0,|L11.432|
                  |L11.392|
;;;247                 version == 0 && hdrline) {
000188  9804              LDR      r0,[sp,#0x10]
00018a  b988              CBNZ     r0,|L11.432|
00018c  b186              CBZ      r6,|L11.432|
;;;248                   /* Some MSIE and Netscape browsers report Mozilla compatbile.
;;;249                   * Others say PROD/VER.  Others say PROD VER.
;;;250                   */
;;;251                   hdrline = __httpd_parse_useragent(hdrline, &version,
00018e  ab02              ADD      r3,sp,#8
000190  aa01              ADD      r2,sp,#4
000192  a904              ADD      r1,sp,#0x10
000194  4630              MOV      r0,r6
000196  f7fffffe          BL       __httpd_parse_useragent
00019a  4606              MOV      r6,r0
;;;252                                                     &dummy, &comment);
;;;253                   if (*version < '0' || *version > '9')
00019c  9804              LDR      r0,[sp,#0x10]
00019e  7800              LDRB     r0,[r0,#0]
0001a0  2830              CMP      r0,#0x30
0001a2  db03              BLT      |L11.428|
0001a4  9804              LDR      r0,[sp,#0x10]
0001a6  7800              LDRB     r0,[r0,#0]
0001a8  2839              CMP      r0,#0x39
0001aa  dd01              BLE      |L11.432|
                  |L11.428|
;;;254                     version = 0;
0001ac  2000              MOVS     r0,#0
0001ae  9004              STR      r0,[sp,#0x10]
                  |L11.432|
;;;255                 }
;;;256      
;;;257    done:
0001b0  bf00              NOP      
                  |L11.434|
;;;258      if (product) {
0001b2  9806              LDR      r0,[sp,#0x18]
0001b4  b378              CBZ      r0,|L11.534|
;;;259        len = strlen(product);
0001b6  9806              LDR      r0,[sp,#0x18]
0001b8  f7fffffe          BL       strlen
0001bc  4605              MOV      r5,r0
;;;260        if (product[len - 1] == ';')
0001be  1e68              SUBS     r0,r5,#1
0001c0  9906              LDR      r1,[sp,#0x18]
0001c2  5c08              LDRB     r0,[r1,r0]
0001c4  283b              CMP      r0,#0x3b
0001c6  d103              BNE      |L11.464|
;;;261          product[len - 1] = 0;
0001c8  2100              MOVS     r1,#0
0001ca  1e68              SUBS     r0,r5,#1
0001cc  9a06              LDR      r2,[sp,#0x18]
0001ce  5411              STRB     r1,[r2,r0]
                  |L11.464|
;;;262        strncpy(agent->product, product, HTTPD_MAX_VAL_LENGTH);
0001d0  2240              MOVS     r2,#0x40
0001d2  4620              MOV      r0,r4
0001d4  9906              LDR      r1,[sp,#0x18]
0001d6  f7fffffe          BL       strncpy
;;;263        
;;;264        /* Sometimes if there's a comment but no version, the first
;;;265        * token in the comment is the version.
;;;266        */
;;;267        if (comment && !version && *comment >= '0' && *comment <= '9') {
0001da  9802              LDR      r0,[sp,#8]
0001dc  b308              CBZ      r0,|L11.546|
0001de  9804              LDR      r0,[sp,#0x10]
0001e0  b9f8              CBNZ     r0,|L11.546|
0001e2  9802              LDR      r0,[sp,#8]
0001e4  7800              LDRB     r0,[r0,#0]
0001e6  2830              CMP      r0,#0x30
0001e8  db1b              BLT      |L11.546|
0001ea  9802              LDR      r0,[sp,#8]
0001ec  7800              LDRB     r0,[r0,#0]
0001ee  2839              CMP      r0,#0x39
0001f0  dc17              BGT      |L11.546|
;;;268          version = comment;
0001f2  9802              LDR      r0,[sp,#8]
0001f4  9004              STR      r0,[sp,#0x10]
;;;269          while (*comment != ' ' && *comment != 0)
0001f6  e002              B        |L11.510|
                  |L11.504|
;;;270            comment++;
0001f8  9802              LDR      r0,[sp,#8]
0001fa  1c40              ADDS     r0,r0,#1
0001fc  9002              STR      r0,[sp,#8]
                  |L11.510|
0001fe  9802              LDR      r0,[sp,#8]            ;269
000200  7800              LDRB     r0,[r0,#0]            ;269
000202  2820              CMP      r0,#0x20              ;269
000204  d003              BEQ      |L11.526|
000206  9802              LDR      r0,[sp,#8]            ;269
000208  7800              LDRB     r0,[r0,#0]            ;269
00020a  2800              CMP      r0,#0                 ;269
00020c  d1f4              BNE      |L11.504|
                  |L11.526|
;;;271          *comment = 0;
00020e  2000              MOVS     r0,#0
000210  9902              LDR      r1,[sp,#8]
000212  7008              STRB     r0,[r1,#0]
000214  e005              B        |L11.546|
                  |L11.534|
000216  e7ff              B        |L11.536|
                  |L11.536|
;;;272        }
;;;273      } else
;;;274        strncpy(agent->product, "unknown", HTTPD_MAX_VAL_LENGTH);
000218  2240              MOVS     r2,#0x40
00021a  a142              ADR      r1,|L11.804|
00021c  4620              MOV      r0,r4
00021e  f7fffffe          BL       strncpy
                  |L11.546|
;;;275      
;;;276      agent->product[HTTPD_MAX_VAL_LENGTH] = 0;
000222  2000              MOVS     r0,#0
000224  f8840040          STRB     r0,[r4,#0x40]
;;;277      
;;;278      if (version) {
000228  9804              LDR      r0,[sp,#0x10]
00022a  b338              CBZ      r0,|L11.636|
;;;279        len = strlen(version);
00022c  9804              LDR      r0,[sp,#0x10]
00022e  f7fffffe          BL       strlen
000232  4605              MOV      r5,r0
;;;280        if (version[len - 1] == ';')
000234  1e68              SUBS     r0,r5,#1
000236  9904              LDR      r1,[sp,#0x10]
000238  5c08              LDRB     r0,[r1,r0]
00023a  283b              CMP      r0,#0x3b
00023c  d103              BNE      |L11.582|
;;;281          version[len - 1] = 0;
00023e  2100              MOVS     r1,#0
000240  1e68              SUBS     r0,r5,#1
000242  9a04              LDR      r2,[sp,#0x10]
000244  5411              STRB     r1,[r2,r0]
                  |L11.582|
;;;282        /* Truncate version strings with unexpected chars */
;;;283        dummy = strstr(version, ",");
000246  a139              ADR      r1,|L11.812|
000248  9804              LDR      r0,[sp,#0x10]
00024a  f7fffffe          BL       strstr
00024e  9001              STR      r0,[sp,#4]
;;;284        if (dummy)
000250  9801              LDR      r0,[sp,#4]
000252  b110              CBZ      r0,|L11.602|
;;;285          *dummy = 0;
000254  2000              MOVS     r0,#0
000256  9901              LDR      r1,[sp,#4]
000258  7008              STRB     r0,[r1,#0]
                  |L11.602|
;;;286        dummy = strstr(version, "+");
00025a  a135              ADR      r1,|L11.816|
00025c  9804              LDR      r0,[sp,#0x10]
00025e  f7fffffe          BL       strstr
000262  9001              STR      r0,[sp,#4]
;;;287        if (dummy)
000264  9801              LDR      r0,[sp,#4]
000266  b110              CBZ      r0,|L11.622|
;;;288          *dummy = 0;
000268  2000              MOVS     r0,#0
00026a  9901              LDR      r1,[sp,#4]
00026c  7008              STRB     r0,[r1,#0]
                  |L11.622|
;;;289        strncpy(agent->version, version, HTTPD_MAX_VAL_LENGTH);
00026e  2240              MOVS     r2,#0x40
000270  f1040041          ADD      r0,r4,#0x41
000274  9904              LDR      r1,[sp,#0x10]
000276  f7fffffe          BL       strncpy
00027a  e004              B        |L11.646|
                  |L11.636|
;;;290      } else
;;;291        memset(agent->version, 0, HTTPD_MAX_VAL_LENGTH + 1);
00027c  2141              MOVS     r1,#0x41
00027e  f1040041          ADD      r0,r4,#0x41
000282  f7fffffe          BL       __aeabi_memclr
                  |L11.646|
;;;292      
;;;293      agent->version[HTTPD_MAX_VAL_LENGTH] = 0;
000286  2100              MOVS     r1,#0
000288  f8841081          STRB     r1,[r4,#0x81]
;;;294    }
00028c  b007              ADD      sp,sp,#0x1c
00028e  bdf0              POP      {r4-r7,pc}
;;;295    
                          ENDP

                  |L11.656|
000290  4d6f7a69          DCB      "Mozilla",0
000294  6c6c6100
                  |L11.664|
000298  636f6d70          DCB      "compatible;",0
00029c  61746962
0002a0  6c653b00
                  |L11.676|
0002a4  2000              DCB      " ",0
0002a6  00                DCB      0
0002a7  00                DCB      0
                  |L11.680|
0002a8  4d534945          DCB      "MSIE",0
0002ac  00      
0002ad  00                DCB      0
0002ae  00                DCB      0
0002af  00                DCB      0
                  |L11.688|
0002b0  47616c65          DCB      "Galeon",0
0002b4  6f6e00  
0002b7  00                DCB      0
                  |L11.696|
0002b8  73616661          DCB      "safari",0
0002bc  726900  
0002bf  00                DCB      0
                  |L11.704|
0002c0  53616661          DCB      "Safari",0
0002c4  726900  
0002c7  00                DCB      0
                  |L11.712|
0002c8  53686969          DCB      "Shiira",0
0002cc  726100  
0002cf  00                DCB      0
                  |L11.720|
0002d0  4f6d6e69          DCB      "OmniWeb",0
0002d4  57656200
                  |L11.728|
0002d8  46697265          DCB      "Firefox",0
0002dc  666f7800
                  |L11.736|
0002e0  43616d69          DCB      "Camino",0
0002e4  6e6f00  
0002e7  00                DCB      0
                  |L11.744|
0002e8  50686f65          DCB      "Phoenix",0
0002ec  6e697800
                  |L11.752|
0002f0  4e657473          DCB      "Netscape6",0
0002f4  63617065
0002f8  3600    
0002fa  00                DCB      0
0002fb  00                DCB      0
                  |L11.764|
0002fc  4e657473          DCB      "Netscape",0
000300  63617065
000304  00      
000305  00                DCB      0
000306  00                DCB      0
000307  00                DCB      0
                  |L11.776|
000308  4e657446          DCB      "NetFront",0
00030c  726f6e74
000310  00      
000311  00                DCB      0
000312  00                DCB      0
000313  00                DCB      0
                  |L11.788|
000314  57656254          DCB      "WebTV",0
000318  5600    
00031a  00                DCB      0
00031b  00                DCB      0
                  |L11.796|
00031c  4f706572          DCB      "Opera",0
000320  6100    
000322  00                DCB      0
000323  00                DCB      0
                  |L11.804|
000324  756e6b6e          DCB      "unknown",0
000328  6f776e00
                  |L11.812|
00032c  2c00              DCB      ",",0
00032e  00                DCB      0
00032f  00                DCB      0
                  |L11.816|
000330  2b00              DCB      "+",0
000332  00                DCB      0
000333  00                DCB      0

                          AREA ||i.httpd_token_cpy||, CODE, READONLY, ALIGN=1

                  httpd_token_cpy PROC
;;;425    */
;;;426    static int httpd_token_cpy(const char *data_p, char *dest_p, int dest_len)
000000  b510              PUSH     {r4,lr}
;;;427    {
000002  4603              MOV      r3,r0
000004  460c              MOV      r4,r1
;;;428      int i = 0;
000006  2100              MOVS     r1,#0
;;;429      
;;;430      //	ASSERT(data_p != NULL);
;;;431      
;;;432      while (!iswhite(*data_p) && i < dest_len && *data_p != '\0') {
000008  e003              B        |L12.18|
                  |L12.10|
;;;433        dest_p[i] = *data_p;
00000a  7818              LDRB     r0,[r3,#0]
00000c  5460              STRB     r0,[r4,r1]
;;;434        i++;
00000e  1c49              ADDS     r1,r1,#1
;;;435        data_p++;
000010  1c5b              ADDS     r3,r3,#1
                  |L12.18|
000012  7818              LDRB     r0,[r3,#0]            ;432
000014  280a              CMP      r0,#0xa               ;432
000016  d008              BEQ      |L12.42|
000018  7818              LDRB     r0,[r3,#0]            ;432
00001a  280d              CMP      r0,#0xd               ;432
00001c  d005              BEQ      |L12.42|
00001e  7818              LDRB     r0,[r3,#0]            ;432
000020  2820              CMP      r0,#0x20              ;432
000022  d002              BEQ      |L12.42|
000024  7818              LDRB     r0,[r3,#0]            ;432
000026  2809              CMP      r0,#9                 ;432
000028  d101              BNE      |L12.46|
                  |L12.42|
00002a  2001              MOVS     r0,#1                 ;432
00002c  e000              B        |L12.48|
                  |L12.46|
00002e  2000              MOVS     r0,#0                 ;432
                  |L12.48|
000030  b920              CBNZ     r0,|L12.60|
000032  4291              CMP      r1,r2                 ;432
000034  da02              BGE      |L12.60|
000036  7818              LDRB     r0,[r3,#0]            ;432
000038  2800              CMP      r0,#0                 ;432
00003a  d1e6              BNE      |L12.10|
                  |L12.60|
;;;436      }
;;;437      
;;;438      if (!iswhite(*data_p) && i == dest_len) {
00003c  7818              LDRB     r0,[r3,#0]
00003e  280a              CMP      r0,#0xa
000040  d008              BEQ      |L12.84|
000042  7818              LDRB     r0,[r3,#0]
000044  280d              CMP      r0,#0xd
000046  d005              BEQ      |L12.84|
000048  7818              LDRB     r0,[r3,#0]
00004a  2820              CMP      r0,#0x20
00004c  d002              BEQ      |L12.84|
00004e  7818              LDRB     r0,[r3,#0]
000050  2809              CMP      r0,#9
000052  d101              BNE      |L12.88|
                  |L12.84|
000054  2001              MOVS     r0,#1
000056  e000              B        |L12.90|
                  |L12.88|
000058  2000              MOVS     r0,#0
                  |L12.90|
00005a  b920              CBNZ     r0,|L12.102|
00005c  4291              CMP      r1,r2
00005e  d102              BNE      |L12.102|
;;;439        /* Token too long to fit in dest_len */
;;;440        return -kInProgressErr;
000060  f04f30ff          MOV      r0,#0xffffffff
                  |L12.100|
;;;441      }
;;;442      
;;;443      /* Add trailing \0 */
;;;444      dest_p[i] = 0;
;;;445      return kNoErr;
;;;446      
;;;447    }
000064  bd10              POP      {r4,pc}
                  |L12.102|
000066  2000              MOVS     r0,#0                 ;444
000068  5460              STRB     r0,[r4,r1]            ;444
00006a  bf00              NOP                            ;445
00006c  e7fa              B        |L12.100|
;;;448    
                          ENDP


                          AREA ||i.httpd_verify_req_type||, CODE, READONLY, ALIGN=2

                  httpd_verify_req_type PROC
;;;451    */
;;;452    static int httpd_verify_req_type(const char *token_p, int *type)
000000  b570              PUSH     {r4-r6,lr}
;;;453    {
000002  4605              MOV      r5,r0
000004  460c              MOV      r4,r1
;;;454      //	ASSERT(token_p != NULL);
;;;455      
;;;456      if (strncmp(token_p, http_post, sizeof(http_post) - 1) == 0)
000006  2205              MOVS     r2,#5
000008  4918              LDR      r1,|L13.108|
00000a  4628              MOV      r0,r5
00000c  f7fffffe          BL       strncmp
000010  b910              CBNZ     r0,|L13.24|
;;;457        *type = HTTPD_REQ_TYPE_POST;
000012  2001              MOVS     r0,#1
000014  6020              STR      r0,[r4,#0]
000016  e027              B        |L13.104|
                  |L13.24|
;;;458      else if (strncmp(token_p, http_get, sizeof(http_get) - 1) == 0)
000018  2204              MOVS     r2,#4
00001a  4915              LDR      r1,|L13.112|
00001c  4628              MOV      r0,r5
00001e  f7fffffe          BL       strncmp
000022  b910              CBNZ     r0,|L13.42|
;;;459        *type = HTTPD_REQ_TYPE_GET;
000024  2002              MOVS     r0,#2
000026  6020              STR      r0,[r4,#0]
000028  e01e              B        |L13.104|
                  |L13.42|
;;;460      else if (strncmp(token_p, http_put, sizeof(http_put) - 1) == 0)
00002a  2204              MOVS     r2,#4
00002c  4911              LDR      r1,|L13.116|
00002e  4628              MOV      r0,r5
000030  f7fffffe          BL       strncmp
000034  b910              CBNZ     r0,|L13.60|
;;;461        *type = HTTPD_REQ_TYPE_PUT;
000036  2004              MOVS     r0,#4
000038  6020              STR      r0,[r4,#0]
00003a  e015              B        |L13.104|
                  |L13.60|
;;;462      else if (strncmp(token_p, http_delete, sizeof(http_delete) - 1) == 0)
00003c  2207              MOVS     r2,#7
00003e  490e              LDR      r1,|L13.120|
000040  4628              MOV      r0,r5
000042  f7fffffe          BL       strncmp
000046  b910              CBNZ     r0,|L13.78|
;;;463        *type = HTTPD_REQ_TYPE_DELETE;
000048  2008              MOVS     r0,#8
00004a  6020              STR      r0,[r4,#0]
00004c  e00c              B        |L13.104|
                  |L13.78|
;;;464      else if (strncmp(token_p, http_head, sizeof(http_head) - 1) == 0)
00004e  2205              MOVS     r2,#5
000050  490a              LDR      r1,|L13.124|
000052  4628              MOV      r0,r5
000054  f7fffffe          BL       strncmp
000058  b910              CBNZ     r0,|L13.96|
;;;465        *type = HTTPD_REQ_TYPE_HEAD;
00005a  2010              MOVS     r0,#0x10
00005c  6020              STR      r0,[r4,#0]
00005e  e003              B        |L13.104|
                  |L13.96|
;;;466      else {
;;;467        *type = HTTPD_REQ_TYPE_UNKNOWN;
000060  2000              MOVS     r0,#0
000062  6020              STR      r0,[r4,#0]
;;;468        return -kInProgressErr;
000064  1e40              SUBS     r0,r0,#1
                  |L13.102|
;;;469      }
;;;470      
;;;471      return kNoErr;
;;;472    }
000066  bd70              POP      {r4-r6,pc}
                  |L13.104|
000068  2000              MOVS     r0,#0                 ;471
00006a  e7fc              B        |L13.102|
;;;473    
                          ENDP

                  |L13.108|
                          DCD      http_post
                  |L13.112|
                          DCD      http_get
                  |L13.116|
                          DCD      http_put
                  |L13.120|
                          DCD      http_delete
                  |L13.124|
                          DCD      http_head

;*** Start embedded assembler ***

#line 1 "..\\..\\..\\..\\libraries\\daemons\\http_server\\http_parse.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___12_http_parse_c_88288ed0____REV16|
#line 114 "..\\..\\..\\..\\Platform\\Cortex-M4\\CMSIS\\core_cmInstr.h"
|__asm___12_http_parse_c_88288ed0____REV16| PROC
#line 115

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE
	THUMB
	EXPORT |__asm___12_http_parse_c_88288ed0____REVSH|
#line 128
|__asm___12_http_parse_c_88288ed0____REVSH| PROC
#line 129

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
