Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .intel_syntax noprefix
- .section .rodata
- .align 8
- .LC2:
- .string "Incorrect input, check README.md"
- .LC3:
- .string "r"
- .LC4:
- .string "w"
- .LC5:
- .string "Incorrect file"
- .LC6:
- .string "%lf"
- .LC8:
- .string "|x| must be less than 1"
- .LC10:
- .string "Answer = %lf\n"
- .text
- .globl main
- .type main, @function
- main:
- push rbp
- mov rbp, rsp
- sub rsp, 64
- mov eax, edi # argc
- mov rbx, rsi # argv
- cmp rax, 3
- je .L6
- lea rdi, .LC2[rip] # "Incorrect input, check README.md"
- call puts@PLT
- mov eax, 0
- jmp .L13
- .L6:
- mov rax, rbx
- add rax, 8
- mov rax, QWORD PTR [rax]
- lea rsi, .LC3[rip] # "r"
- mov rdi, rax # argv[1]
- call fopen@PLT
- mov r12, rax
- mov rax, rbx
- add rax, 16
- mov rax, QWORD PTR [rax]
- lea rsi, .LC4[rip] # "w"
- mov rdi, rax # argv[2]
- call fopen@PLT
- mov r13, rax
- cmp r12, 0
- je .L8
- cmp r13, 0
- jne .L9
- .L8:
- lea rdi, .LC5[rip] # "Incorrect file\n"
- call puts@PLT
- mov eax, 0
- jmp .L13
- .L9:
- lea rdx, -48[rbp] # &x
- mov rax, r12
- lea rsi, .LC6[rip] # "%lf"
- mov rdi, rax # input
- mov eax, 0
- call __isoc99_fscanf@PLT
- lea rdx, -40[rbp] # &m
- mov rax, r12
- lea rsi, .LC6[rip] # "%lf"
- mov rdi, rax # input
- mov eax, 0
- call __isoc99_fscanf@PLT
- movsd xmm0, QWORD PTR -48[rbp]
- movsd xmm1, QWORD PTR .LC0[rip]
- comisd xmm0, xmm1
- ja .L10
- movsd xmm1, QWORD PTR -48[rbp]
- movsd xmm0, QWORD PTR .LC7[rip]
- comisd xmm0, xmm1
- jbe .L15
- .L10:
- lea rdi, .LC8[rip] # "|x| must be less than 1"
- call puts@PLT
- mov eax, 0
- jmp .L13
- .L15:
- movsd xmm0, QWORD PTR -40[rbp]
- mov rax, QWORD PTR -48[rbp]
- movsd xmm1, QWORD PTR .LC9[rip]
- movapd xmm2, xmm1 # 50
- movapd xmm1, xmm0 # m
- movq xmm0, rax # x
- call f
- movq rax, xmm0
- mov r14, rax
- mov rdx, r14
- mov rax, r13
- movq xmm0, rdx # res
- lea rsi, .LC10[rip] # "Answer = %lf\n"
- mov rdi, rax # out
- mov eax, 1
- call fprintf@PLT
- mov rax, r12
- mov rdi, rax # input
- call fclose@PLT
- mov rax, r13
- mov rdi, rax # out
- call fclose@PLT
- mov eax, 0
- .L13:
- leave
- ret
- .size main, .-main
- .section .rodata
- .align 8
- .LC0:
- .long 0
- .long 1072693248
- .align 8
- .LC7:
- .long 0
- .long -1074790400
- .align 8
- .LC9:
- .long 0
- .long 1078525952
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement