Advertisement
dllbridge

asm gcc opti

Nov 29th, 2020
1,467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.         .file   "cc3.c"
  3.         .intel_syntax noprefix
  4.         .globl  _x
  5.         .data
  6. _x:
  7.         .byte   45
  8.         .globl  _y
  9. _y:
  10.         .byte   50
  11.         .comm   _r_1, 2, 1
  12.         .comm   _r_2, 2, 1
  13.         .comm   _n, 4, 2
  14.         .def    ___main;        .scl    2;      .type   32;     .endef
  15.         .section .rdata,"dr"
  16. LC0:
  17.         .ascii "(x + y)/2 + (y * x)/30 = %d\12\0"
  18. LC1:
  19.         .ascii "%d\0"
  20.         .text
  21.         .globl  _main
  22.         .def    _main;  .scl    2;      .type   32;     .endef
  23. _main:
  24. LFB6:
  25.        .cfi_startproc
  26.         push    ebp
  27.        .cfi_def_cfa_offset 8
  28.        .cfi_offset 5, -8
  29.         mov     ebp, esp
  30.        .cfi_def_cfa_register 5
  31.         push    ebx
  32.         and     esp, -16
  33.         sub     esp, 16
  34.        .cfi_offset 3, -12
  35.         call    ___main
  36.  
  37.         mov   eax, 0
  38.         mov   ebx, 0
  39.         mov   al, (_x)
  40.         mov   bl, (_y)
  41.         add   ax, bx
  42.         shr   ax, 1
  43.         mov   (_r_1), ax
  44.  
  45.         mov   eax, 0
  46.         mov   ebx, 0
  47.         mov   al, [_x]
  48.         mov   bl, [_y]
  49.         mul   bx
  50.         mov   bx, 30
  51.         idiv  bx
  52.         mov   bx, (_r_1)
  53.         add   ax, bx
  54.  
  55.         mov     DWORD PTR [esp+4], eax
  56.         mov     DWORD PTR [esp], OFFSET FLAT:LC0
  57.         call    _printf
  58.         mov     DWORD PTR [esp+4], OFFSET FLAT:_n
  59.         mov     DWORD PTR [esp], OFFSET FLAT:LC1
  60.         call    _scanf
  61.         mov     ebx, DWORD PTR [ebp-4]
  62.         leave
  63.        .cfi_restore 5
  64.        .cfi_def_cfa 4, 4
  65.        .cfi_restore 3
  66.         ret
  67.        .cfi_endproc
  68. LFE6:
  69.        .def    _printf;        .scl    2;      .type   32;     .endef
  70.        .def    _scanf; .scl    2;      .type   32;     .endef
  71.                
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement