73 lines
1.2 KiB
ArmAsm
73 lines
1.2 KiB
ArmAsm
.file "student.c"
|
|
.text
|
|
.globl new_student
|
|
.type new_student, @function
|
|
new_student:
|
|
.LFB6:
|
|
.cfi_startproc
|
|
pushq %rbp
|
|
.cfi_def_cfa_offset 16
|
|
.cfi_offset 6, -16
|
|
movq %rsp, %rbp
|
|
.cfi_def_cfa_register 6
|
|
subq $32, %rsp
|
|
movq %rdi, -24(%rbp)
|
|
movl %esi, -28(%rbp)
|
|
movl $56, %edi
|
|
call malloc
|
|
movq %rax, -8(%rbp)
|
|
cmpq $0, -8(%rbp)
|
|
jne .L2
|
|
movl $0, %eax
|
|
jmp .L3
|
|
.L2:
|
|
movq -8(%rbp), %rax
|
|
movq -24(%rbp), %rcx
|
|
movl $49, %edx
|
|
movq %rcx, %rsi
|
|
movq %rax, %rdi
|
|
call strncpy
|
|
movq -8(%rbp), %rax
|
|
movb $0, 49(%rax)
|
|
movq -8(%rbp), %rax
|
|
movl -28(%rbp), %edx
|
|
movl %edx, 52(%rax)
|
|
movq -8(%rbp), %rax
|
|
.L3:
|
|
leave
|
|
.cfi_def_cfa 7, 8
|
|
ret
|
|
.cfi_endproc
|
|
.LFE6:
|
|
.size new_student, .-new_student
|
|
.globl change_name
|
|
.type change_name, @function
|
|
change_name:
|
|
.LFB7:
|
|
.cfi_startproc
|
|
pushq %rbp
|
|
.cfi_def_cfa_offset 16
|
|
.cfi_offset 6, -16
|
|
movq %rsp, %rbp
|
|
.cfi_def_cfa_register 6
|
|
subq $16, %rsp
|
|
movq %rdi, -8(%rbp)
|
|
movq %rsi, -16(%rbp)
|
|
movq -8(%rbp), %rax
|
|
movq -16(%rbp), %rcx
|
|
movl $49, %edx
|
|
movq %rcx, %rsi
|
|
movq %rax, %rdi
|
|
call strncpy
|
|
movq -8(%rbp), %rax
|
|
movb $0, 49(%rax)
|
|
nop
|
|
leave
|
|
.cfi_def_cfa 7, 8
|
|
ret
|
|
.cfi_endproc
|
|
.LFE7:
|
|
.size change_name, .-change_name
|
|
.ident "GCC: (GNU) 15.2.1 20260123 (Red Hat 15.2.1-7)"
|
|
.section .note.GNU-stack,"",@progbits
|