asm(" .arch armv8-a\n");
asm(" .text\n");
asm(" .section .rodata\n");
asm(" .align 3\n");
asm(" .type in6addr_any, %object\n");
asm(" .size in6addr_any, 16\n");
asm("in6addr_any:\n");
asm(" .zero 16\n");
asm(" .align 3\n");
asm(" .type in6addr_loopback, %object\n");
asm(" .size in6addr_loopback, 16\n");
asm("in6addr_loopback:\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 0\n");
asm(" .byte 1\n");
asm(" .align 3\n");
asm(".LC0:\n");
asm(" .string \"r\"\n");
asm(" .align 3\n");
asm(".LC1:\n");
asm(" .string \" Error opening file \"\n");
asm(" .align 3\n");
asm(".LC2:\n");
asm(" .string \" Error reading file \"\n");
asm(" .text\n");
asm(" .align 2\n");
asm(" .global loadFile\n");
asm(" .type loadFile, %function\n");
asm("loadFile:\n");
asm(".LFB15:\n");
asm(" .cfi_startproc\n");
asm(" stp x29, x30, [sp, -64]!\n");
asm(" .cfi_def_cfa_offset 64\n");
asm(" .cfi_offset 29, -64\n");
asm(" .cfi_offset 30, -56\n");
asm(" mov x29, sp\n");
asm(" str x0, [sp, 24]\n");
asm(" adrp x0, .LC0\n");
asm(" add x1, x0, :lo12:.LC0\n");
asm(" ldr x0, [sp, 24]\n");
asm(" bl fopen\n");
asm(" str x0, [sp, 56]\n");
asm(" ldr x0, [sp, 56]\n");
asm(" cmp x0, 0\n");
asm(" bne .L2\n");
asm(" adrp x0, .LC1\n");
asm(" add x0, x0, :lo12:.LC1\n");
asm(" bl perror\n");
asm(" mov x0, 0\n");
asm(" b .L3\n");
asm(".L2:\n");
asm(" ldr x3, [sp, 56]\n");
asm(" mov x2, 1024\n");
asm(" mov x1, 1\n");
asm(" ldr x0, [sp, 48]\n");
asm(" bl fread\n");
asm(" str x0, [sp, 40]\n");
asm(" ldr x0, [sp, 56]\n");
asm(" bl ferror\n");
asm(" cmp w0, 0\n");
asm(" beq .L4\n");
asm(" adrp x0, .LC2\n");
asm(" add x0, x0, :lo12:.LC2\n");
asm(" bl perror\n");
asm(" ldr x0, [sp, 56]\n");
asm(" bl fclose\n");
asm(" mov x0, 0\n");
asm(" b .L3\n");
asm(".L4:\n");
asm(" ldr x0, [sp, 56]\n");
asm(" bl fclose\n");
asm(" ldr x1, [sp, 48]\n");
asm(" ldr x0, [sp, 40]\n");
asm(" add x0, x1, x0\n");
asm(" strb wzr, [x0]\n");
asm(" ldr x0, [sp, 48]\n");
asm(".L3:\n");
asm(" ldp x29, x30, [sp], 64\n");
asm(" .cfi_restore 30\n");
asm(" .cfi_restore 29\n");
asm(" .cfi_def_cfa_offset 0\n");
asm(" ret\n");
asm(" .cfi_endproc\n");
asm(".LFE15:\n");
asm(" .size loadFile, .-loadFile\n");
asm(" .section .rodata\n");
asm(" .align 3\n");
asm(".LC3:\n");
asm(" .string \"HTTP / 1.1 200 OK \r\nContent - Type: text/html \r\n\r\n < !DOCTYPE html><html><body> Aktualny czas:%s </body></html>\"\n");
asm(" .text\n");
asm(" .align 2\n");
asm(" .global send_response2\n");
asm(" .type send_response2, %function\n");
asm("send_response2:\n");
asm(".LFB16:\n");
asm(" .cfi_startproc\n");
asm(" sub sp, sp, #1104\n");
asm(" .cfi_def_cfa_offset 1104\n");
asm(" stp x29, x30, [sp]\n");
asm(" .cfi_offset 29, -1104\n");
asm(" .cfi_offset 30, -1096\n");
asm(" mov x29, sp\n");
asm(" str w0, [sp, 44]\n");
asm(" str x1, [sp, 32]\n");
asm(" str x2, [sp, 24]\n");
asm(" str x3, [sp, 16]\n");
asm(" add x0, sp, 56\n");
asm(" bl time\n");
asm(" add x0, sp, 56\n");
asm(" bl localtime\n");
asm(" str x0, [sp, 1096]\n");
asm(" ldr x0, [sp, 1096]\n");
asm(" bl asctime\n");
asm(" str x0, [sp, 1088]\n");
asm(" add x0, sp, 64\n");
asm(" ldr x1, [sp, 1088]\n");
asm(" bl strcat\n");
asm(" add x3, sp, 64\n");
asm(" ldr x2, [sp, 1088]\n");
asm(" adrp x0, .LC3\n");
asm(" add x1, x0, :lo12:.LC3\n");
asm(" mov x0, x3\n");
asm(" bl sprintf\n");
asm(" add x0, sp, 64\n");
asm(" bl strlen\n");
asm(" mov x1, x0\n");
asm(" add x0, sp, 64\n");
asm(" mov w3, 0\n");
asm(" mov x2, x1\n");
asm(" mov x1, x0\n");
asm(" ldr w0, [sp, 44]\n");
asm(" bl send\n");
asm(" nop\n");
asm(" ldp x29, x30, [sp]\n");
asm(" add sp, sp, 1104\n");
asm(" .cfi_restore 29\n");
asm(" .cfi_restore 30\n");
asm(" .cfi_def_cfa_offset 0\n");
asm(" ret\n");
asm(" .cfi_endproc\n");
asm(".LFE16:\n");
asm(" .size send_response2, .-send_response2\n");
asm(" .section .rodata\n");
asm(" .align 3\n");
asm(".LC4:\n");
asm(" .string \"%s %s\"\n");
asm(" .text\n");
asm(" .align 2\n");
asm(" .global parse_request_line\n");
asm(" .type parse_request_line, %function\n");
asm("parse_request_line:\n");
asm(".LFB17:\n");
asm(" .cfi_startproc\n");
asm(" stp x29, x30, [sp, -48]!\n");
asm(" .cfi_def_cfa_offset 48\n");
asm(" .cfi_offset 29, -48\n");
asm(" .cfi_offset 30, -40\n");
asm(" mov x29, sp\n");
asm(" str x0, [sp, 40]\n");
asm(" str x1, [sp, 32]\n");
asm(" str x2, [sp, 24]\n");
asm(" ldr x3, [sp, 24]\n");
asm(" ldr x2, [sp, 32]\n");
asm(" adrp x0, .LC4\n");
asm(" add x1, x0, :lo12:.LC4\n");
asm(" ldr x0, [sp, 40]\n");
asm(" bl sscanf\n");
asm(" nop\n");
asm(" ldp x29, x30, [sp], 48\n");
asm(" .cfi_restore 30\n");
asm(" .cfi_restore 29\n");
asm(" .cfi_def_cfa_offset 0\n");
asm(" ret\n");
asm(" .cfi_endproc\n");
asm(".LFE17:\n");
asm(" .size parse_request_line, .-parse_request_line\n");
asm(" .section .rodata\n");
asm(" .align 3\n");
asm(".LC5:\n");
asm(" .string \"HTTP/1.1 %s \r\nContent - Type:%s \r\n\r\n %s\"\n");
asm(" .text\n");
asm(" .align 2\n");
asm(" .global send_response\n");
asm(" .type send_response, %function\n");
asm("send_response:\n");
asm(".LFB18:\n");
asm(" .cfi_startproc\n");
asm(" sub sp, sp, #1072\n");
asm(" .cfi_def_cfa_offset 1072\n");
asm(" stp x29, x30, [sp]\n");
asm(" .cfi_offset 29, -1072\n");
asm(" .cfi_offset 30, -1064\n");
asm(" mov x29, sp\n");
asm(" str w0, [sp, 44]\n");
asm(" str x1, [sp, 32]\n");
asm(" str x2, [sp, 24]\n");
asm(" str x3, [sp, 16]\n");
asm(" add x5, sp, 48\n");
asm(" ldr x4, [sp, 16]\n");
asm(" ldr x3, [sp, 24]\n");
asm(" ldr x2, [sp, 32]\n");
asm(" adrp x0, .LC5\n");
asm(" add x1, x0, :lo12:.LC5\n");
asm(" mov x0, x5\n");
asm(" bl sprintf\n");
asm(" add x0, sp, 48\n");
asm(" bl strlen\n");
asm(" mov x1, x0\n");
asm(" add x0, sp, 48\n");
asm(" mov w3, 0\n");
asm(" mov x2, x1\n");
asm(" mov x1, x0\n");
asm(" ldr w0, [sp, 44]\n");
asm(" bl send\n");
asm(" nop\n");
asm(" ldp x29, x30, [sp]\n");
asm(" add sp, sp, 1072\n");
asm(" .cfi_restore 29\n");
asm(" .cfi_restore 30\n");
asm(" .cfi_def_cfa_offset 0\n");
asm(" ret\n");
asm(" .cfi_endproc\n");
asm(".LFE18:\n");
asm(" .size send_response, .-send_response\n");
asm(" .section .rodata\n");
asm(" .align 3\n");
asm(".LC6:\n");
asm(" .string \"Received POST data:%s \n\"\n");
asm(" .align 3\n");
asm(".LC7:\n");
asm(" .string \"Resource created \"\n");
asm(" .align 3\n");
asm(".LC8:\n");
asm(" .string \" text/plain \"\n");
asm(" .align 3\n");
asm(".LC9:\n");
asm(" .string \"201 Created\"\n");
asm(" .text\n");
asm(" .align 2\n");
asm(" .global handle_post\n");
asm(" .type handle_post, %function\n");
asm("handle_post:\n");
asm(".LFB19:\n");
asm(" .cfi_startproc\n");
asm(" stp x29, x30, [sp, -32]!\n");
asm(" .cfi_def_cfa_offset 32\n");
asm(" .cfi_offset 29, -32\n");
asm(" .cfi_offset 30, -24\n");
asm(" mov x29, sp\n");
asm(" str w0, [sp, 28]\n");
asm(" str x1, [sp, 16]\n");
asm(" ldr x1, [sp, 16]\n");
asm(" adrp x0, .LC6\n");
asm(" add x0, x0, :lo12:.LC6\n");
asm(" bl printf\n");
asm(" adrp x0, .LC7\n");
asm(" add x3, x0, :lo12:.LC7\n");
asm(" adrp x0, .LC8\n");
asm(" add x2, x0, :lo12:.LC8\n");
asm(" adrp x0, .LC9\n");
asm(" add x1, x0, :lo12:.LC9\n");
asm(" ldr w0, [sp, 28]\n");
asm(" bl send_response\n");
asm(" nop\n");
asm(" ldp x29, x30, [sp], 32\n");
asm(" .cfi_restore 30\n");
asm(" .cfi_restore 29\n");
asm(" .cfi_def_cfa_offset 0\n");
asm(" ret\n");
asm(" .cfi_endproc\n");
asm(".LFE19:\n");
asm(" .size handle_post, .-handle_post\n");
asm(" .section .rodata\n");
asm(" .align 3\n");
asm(".LC10:\n");
asm(" .string \"Received PUT data:%s \n \"\n");
asm(" .align 3\n");
asm(".LC11:\n");
asm(" .string \"Resource updated \"\n");
asm(" .align 3\n");
asm(".LC12:\n");
asm(" .string \"200 OK\"\n");
asm(" .text\n");
asm(" .align 2\n");
asm(" .global handle_put\n");
asm(" .type handle_put, %function\n");
asm("handle_put:\n");
asm(".LFB20:\n");
asm(" .cfi_startproc\n");
asm(" stp x29, x30, [sp, -32]!\n");
asm(" .cfi_def_cfa_offset 32\n");
asm(" .cfi_offset 29, -32\n");
asm(" .cfi_offset 30, -24\n");
asm(" mov x29, sp\n");
asm(" str w0, [sp, 28]\n");
asm(" str x1, [sp, 16]\n");
asm(" ldr x1, [sp, 16]\n");
asm(" adrp x0, .LC10\n");
asm(" add x0, x0, :lo12:.LC10\n");
asm(" bl printf\n");
asm(" adrp x0, .LC11\n");
asm(" add x3, x0, :lo12:.LC11\n");
asm(" adrp x0, .LC8\n");
asm(" add x2, x0, :lo12:.LC8\n");
asm(" adrp x0, .LC12\n");
asm(" add x1, x0, :lo12:.LC12\n");
asm(" ldr w0, [sp, 28]\n");
asm(" bl send_response\n");
asm(" nop\n");
asm(" ldp x29, x30, [sp], 32\n");
asm(" .cfi_restore 30\n");
asm(" .cfi_restore 29\n");
asm(" .cfi_def_cfa_offset 0\n");
asm(" ret\n");
asm(" .cfi_endproc\n");
asm(".LFE20:\n");
asm(" .size handle_put, .-handle_put\n");
asm(" .section .rodata\n");
asm(" .align 3\n");
asm(".LC13:\n");
asm(" .string \" socket failed \"\n");
asm(" .align 3\n");
asm(".LC14:\n");
asm(" .string \"Socket created successfully \"\n");
asm(" .align 3\n");
asm(".LC15:\n");
asm(" .string \" bind failed \"\n");
asm(" .align 3\n");
asm(".LC16:\n");
asm(" .string \" Binding successful \"\n");
asm(" .align 3\n");
asm(".LC17:\n");
asm(" .string \"listen \"\n");
asm(" .align 3\n");
asm(".LC18:\n");
asm(" .string \" Listening...\"\n");
asm(" .align 3\n");
asm(".LC19:\n");
asm(" .string \"accept\"\n");
asm(" .align 3\n");
asm(".LC20:\n");
asm(" .string \" recv \"\n");
asm(" .align 3\n");
asm(".LC21:\n");
asm(" .string \"GET\"\n");
asm(" .align 3\n");
asm(".LC22:\n");
asm(" .string \"/\"\n");
asm(" .align 3\n");
asm(".LC23:\n");
asm(" .string \"< !DOCTYPE html >< html >< body > Hello from my server !< /body >< /html > \"\n");
asm(" .align 3\n");
asm(".LC24:\n");
asm(" .string \"text/html\"\n");
asm(" .align 3\n");
asm(".LC25:\n");
asm(" .string \"/coments\"\n");
asm(" .align 3\n");
asm(".LC26:\n");
asm(" .string \"in_out.html\"\n");
asm(" .align 3\n");
asm(".LC27:\n");
asm(" .string \"Error loading file \"\n");
asm(" .align 3\n");
asm(".LC28:\n");
asm(" .string \"500 Internal Server Error \"\n");
asm(" .align 3\n");
asm(".LC29:\n");
asm(" .string \" Page not found \"\n");
asm(" .align 3\n");
asm(".LC30:\n");
asm(" .string \" 404 Not Found \"\n");
asm(" .align 3\n");
asm(".LC31:\n");
asm(" .string \"POST\"\n");
asm(" .align 3\n");
asm(".LC32:\n");
asm(" .string \"PUT\"\n");
asm(" .align 3\n");
asm(".LC33:\n");
asm(" .string \"Method not implemented \"\n");
asm(" .align 3\n");
asm(".LC34:\n");
asm(" .string \" 501 Not Implemented \"\n");
asm(" .text\n");
asm(" .align 2\n");
asm(" .global main\n");
asm(" .type main, %function\n");
asm("main:\n");
asm(".LFB21:\n");
asm(" .cfi_startproc\n");
asm(" sub sp, sp, #2160\n");
asm(" .cfi_def_cfa_offset 2160\n");
asm(" stp x29, x30, [sp]\n");
asm(" .cfi_offset 29, -2160\n");
asm(" .cfi_offset 30, -2152\n");
asm(" mov x29, sp\n");
asm(" str w0, [sp, 28]\n");
asm(" str x1, [sp, 16]\n");
asm(" str wzr, [sp, 2156]\n");
asm(" str wzr, [sp, 2152]\n");
asm(" mov w0, 16\n");
asm(" str w0, [sp, 2108]\n");
asm(" mov w2, 0\n");
asm(" mov w1, 1\n");
asm(" mov w0, 2\n");
asm(" bl socket\n");
asm(" str w0, [sp, 2156]\n");
asm(" ldr w0, [sp, 2156]\n");
asm(" cmp w0, 0\n");
asm(" bge .L11\n");
asm(" adrp x0, .LC13\n");
asm(" add x0, x0, :lo12:.LC13\n");
asm(" bl perror\n");
asm(" mov w0, 1\n");
asm(" bl exit\n");
asm(".L11:\n");
asm(" adrp x0, .LC14\n");
asm(" add x0, x0, :lo12:.LC14\n");
asm(" bl puts\n");
asm(" mov w0, 2\n");
asm(" strh w0, [sp, 2128]\n");
asm(" str wzr, [sp, 2132]\n");
asm(" mov w0, -20476\n");
asm(" strh w0, [sp, 2130]\n");
asm(" add x0, sp, 2128\n");
asm(" mov w2, 16\n");
asm(" mov x1, x0\n");
asm(" ldr w0, [sp, 2156]\n");
asm(" bl bind\n");
asm(" cmp w0, 0\n");
asm(" bge .L12\n");
asm(" adrp x0, .LC15\n");
asm(" add x0, x0, :lo12:.LC15\n");
asm(" bl perror\n");
asm(" mov w0, 1\n");
asm(" bl exit\n");
asm(".L12:\n");
asm(" adrp x0, .LC16\n");
asm(" add x0, x0, :lo12:.LC16\n");
asm(" bl puts\n");
asm(" mov w1, 10\n");
asm(" ldr w0, [sp, 2156]\n");
asm(" bl listen\n");
asm(" cmp w0, 0\n");
asm(" bge .L13\n");
asm(" adrp x0, .LC17\n");
asm(" add x0, x0, :lo12:.LC17\n");
asm(" bl perror\n");
asm(" mov w0, 1\n");
asm(" bl exit\n");
asm(".L13:\n");
asm(" adrp x0, .LC18\n");
asm(" add x0, x0, :lo12:.LC18\n");
asm(" bl puts\n");
asm(".L25:\n");
asm(" add x1, sp, 2108\n");
asm(" add x0, sp, 2112\n");
asm(" mov x2, x1\n");
asm(" mov x1, x0\n");
asm(" ldr w0, [sp, 2156]\n");
asm(" bl accept\n");
asm(" str w0, [sp, 2152]\n");
asm(" ldr w0, [sp, 2152]\n");
asm(" cmp w0, 0\n");
asm(" bge .L14\n");
asm(" adrp x0, .LC19\n");
asm(" add x0, x0, :lo12:.LC19\n");
asm(" bl perror\n");
asm(" b .L24\n");
asm(".L14:\n");
asm(" add x0, sp, 1080\n");
asm(" mov w3, 0\n");
asm(" mov x2, 1024\n");
asm(" mov x1, x0\n");
asm(" ldr w0, [sp, 2152]\n");
asm(" bl recv\n");
asm(" cmp x0, 0\n");
asm(" bge .L16\n");
asm(" adrp x0, .LC20\n");
asm(" add x0, x0, :lo12:.LC20\n");
asm(" bl perror\n");
asm(" ldr w0, [sp, 2152]\n");
asm(" bl close\n");
asm(" b .L24\n");
asm(".L16:\n");
asm(" add x2, sp, 32\n");
asm(" add x1, sp, 1056\n");
asm(" add x0, sp, 1080\n");
asm(" bl parse_request_line\n");
asm(" add x2, sp, 1056\n");
asm(" adrp x0, .LC21\n");
asm(" add x1, x0, :lo12:.LC21\n");
asm(" mov x0, x2\n");
asm(" bl strcmp\n");
asm(" cmp w0, 0\n");
asm(" bne .L17\n");
asm(" add x2, sp, 32\n");
asm(" adrp x0, .LC22\n");
asm(" add x1, x0, :lo12:.LC22\n");
asm(" mov x0, x2\n");
asm(" bl strcmp\n");
asm(" cmp w0, 0\n");
asm(" bne .L18\n");
asm(" adrp x0, .LC23\n");
asm(" add x3, x0, :lo12:.LC23\n");
asm(" adrp x0, .LC24\n");
asm(" add x2, x0, :lo12:.LC24\n");
asm(" adrp x0, .LC12\n");
asm(" add x1, x0, :lo12:.LC12\n");
asm(" ldr w0, [sp, 2152]\n");
asm(" bl send_response2\n");
asm(" b .L19\n");
asm(".L18:\n");
asm(" add x2, sp, 32\n");
asm(" adrp x0, .LC25\n");
asm(" add x1, x0, :lo12:.LC25\n");
asm(" mov x0, x2\n");
asm(" bl strcmp\n");
asm(" cmp w0, 0\n");
asm(" bne .L20\n");
asm(" adrp x0, .LC26\n");
asm(" add x0, x0, :lo12:.LC26\n");
asm(" bl loadFile\n");
asm(" str x0, [sp, 2144]\n");
asm(" ldr x0, [sp, 2144]\n");
asm(" cmp x0, 0\n");
asm(" beq .L21\n");
asm(" ldr x3, [sp, 2144]\n");
asm(" adrp x0, .LC24\n");
asm(" add x2, x0, :lo12:.LC24\n");
asm(" adrp x0, .LC12\n");
asm(" add x1, x0, :lo12:.LC12\n");
asm(" ldr w0, [sp, 2152]\n");
asm(" bl send_response\n");
asm(" b .L19\n");
asm(".L21:\n");
asm(" adrp x0, .LC27\n");
asm(" add x3, x0, :lo12:.LC27\n");
asm(" adrp x0, .LC8\n");
asm(" add x2, x0, :lo12:.LC8\n");
asm(" adrp x0, .LC28\n");
asm(" add x1, x0, :lo12:.LC28\n");
asm(" ldr w0, [sp, 2152]\n");
asm(" bl send_response\n");
asm(" b .L19\n");
asm(".L20:\n");
asm(" adrp x0, .LC29\n");
asm(" add x3, x0, :lo12:.LC29\n");
asm(" adrp x0, .LC8\n");
asm(" add x2, x0, :lo12:.LC8\n");
asm(" adrp x0, .LC30\n");
asm(" add x1, x0, :lo12:.LC30\n");
asm(" ldr w0, [sp, 2152]\n");
asm(" bl send_response\n");
asm(" b .L19\n");
asm(".L17:\n");
asm(" add x2, sp, 1056\n");
asm(" adrp x0, .LC31\n");
asm(" add x1, x0, :lo12:.LC31\n");
asm(" mov x0, x2\n");
asm(" bl strcmp\n");
asm(" cmp w0, 0\n");
asm(" bne .L22\n");
asm(" add x0, sp, 1080\n");
asm(" mov x1, x0\n");
asm(" ldr w0, [sp, 2152]\n");
asm(" bl handle_post\n");
asm(" b .L19\n");
asm(".L22:\n");
asm(" add x2, sp, 1056\n");
asm(" adrp x0, .LC32\n");
asm(" add x1, x0, :lo12:.LC32\n");
asm(" mov x0, x2\n");
asm(" bl strcmp\n");
asm(" cmp w0, 0\n");
asm(" bne .L23\n");
asm(" add x0, sp, 1080\n");
asm(" mov x1, x0\n");
asm(" ldr w0, [sp, 2152]\n");
asm(" bl handle_put\n");
asm(" b .L19\n");
asm(".L23:\n");
asm(" adrp x0, .LC33\n");
asm(" add x3, x0, :lo12:.LC33\n");
asm(" adrp x0, .LC8\n");
asm(" add x2, x0, :lo12:.LC8\n");
asm(" adrp x0, .LC34\n");
asm(" add x1, x0, :lo12:.LC34\n");
asm(" ldr w0, [sp, 2152]\n");
asm(" bl send_response\n");
asm(".L19:\n");
asm(" ldr w0, [sp, 2152]\n");
asm(" bl close\n");
asm(".L24:\n");
asm(" b .L25\n");
asm(" .cfi_endproc\n");
asm(".LFE21:\n");
asm(" .size main, .-main\n");
asm("\n");
VPN termux about China.net
Tuesday, 13 August 2024
Server CC try this
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment