mirror of
https://github.com/szymon-jozef/ZUT-notatki.git
synced 2026-10-28 11:10:38 +01:00
hihihi
This commit is contained in:
6
uczelnia/3_semestr/rust/laby/lab1/src/gcd.rs
Normal file
6
uczelnia/3_semestr/rust/laby/lab1/src/gcd.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
pub fn gcd(mut a: usize, mut b: usize) -> usize {
|
||||
while b != 0 {
|
||||
(b, a) = (a % b, b);
|
||||
}
|
||||
a
|
||||
}
|
||||
3
uczelnia/3_semestr/rust/laby/lab1/src/gcd.s
Normal file
3
uczelnia/3_semestr/rust/laby/lab1/src/gcd.s
Normal file
@@ -0,0 +1,3 @@
|
||||
.file "gcd.6643139bf81a864-cgu.0"
|
||||
.ident "rustc version 1.98.1 (48a229cea 2026-09-01) (built from a source tarball)"
|
||||
.section ".note.GNU-stack","",@progbits
|
||||
57
uczelnia/3_semestr/rust/laby/lab1/src/gcd_bez.s
Normal file
57
uczelnia/3_semestr/rust/laby/lab1/src/gcd_bez.s
Normal file
@@ -0,0 +1,57 @@
|
||||
.file "gcd.6643139bf81a864-cgu.0"
|
||||
.section .text._RNvCsy1jhtvzCfM_3gcd3gcd,"ax",@progbits
|
||||
.globl _RNvCsy1jhtvzCfM_3gcd3gcd
|
||||
.p2align 4
|
||||
.type _RNvCsy1jhtvzCfM_3gcd3gcd,@function
|
||||
_RNvCsy1jhtvzCfM_3gcd3gcd:
|
||||
.cfi_startproc
|
||||
subq $40, %rsp
|
||||
.cfi_def_cfa_offset 48
|
||||
movq %rdi, 24(%rsp)
|
||||
movq %rsi, 32(%rsp)
|
||||
.LBB0_1:
|
||||
cmpq $0, 32(%rsp)
|
||||
jne .LBB0_3
|
||||
movq 24(%rsp), %rax
|
||||
addq $40, %rsp
|
||||
.cfi_def_cfa_offset 8
|
||||
retq
|
||||
.LBB0_3:
|
||||
.cfi_def_cfa_offset 48
|
||||
movq 24(%rsp), %rax
|
||||
movq %rax, 8(%rsp)
|
||||
movq 32(%rsp), %rax
|
||||
movq %rax, 16(%rsp)
|
||||
cmpq $0, %rax
|
||||
je .LBB0_5
|
||||
movq 16(%rsp), %rcx
|
||||
movq 8(%rsp), %rax
|
||||
xorl %edx, %edx
|
||||
divq %rcx
|
||||
movq 32(%rsp), %rax
|
||||
movq %rdx, 32(%rsp)
|
||||
movq %rax, 24(%rsp)
|
||||
jmp .LBB0_1
|
||||
.LBB0_5:
|
||||
leaq .Lanon.7fcf6383cbbc6b99e4703d6007e30d82.1(%rip), %rdi
|
||||
callq *_RNvNtNtCs6Xa2QwhY5JM_4core9panicking11panic_const23panic_const_rem_by_zero@GOTPCREL(%rip)
|
||||
.Lfunc_end0:
|
||||
.size _RNvCsy1jhtvzCfM_3gcd3gcd, .Lfunc_end0-_RNvCsy1jhtvzCfM_3gcd3gcd
|
||||
.cfi_endproc
|
||||
|
||||
.type .Lanon.7fcf6383cbbc6b99e4703d6007e30d82.0,@object
|
||||
.section .rodata.str1.1,"aMS",@progbits,1
|
||||
.Lanon.7fcf6383cbbc6b99e4703d6007e30d82.0:
|
||||
.asciz "gcd.rs"
|
||||
.size .Lanon.7fcf6383cbbc6b99e4703d6007e30d82.0, 7
|
||||
|
||||
.type .Lanon.7fcf6383cbbc6b99e4703d6007e30d82.1,@object
|
||||
.section .data.rel.ro..Lanon.7fcf6383cbbc6b99e4703d6007e30d82.1,"aw",@progbits
|
||||
.p2align 3, 0x0
|
||||
.Lanon.7fcf6383cbbc6b99e4703d6007e30d82.1:
|
||||
.quad .Lanon.7fcf6383cbbc6b99e4703d6007e30d82.0
|
||||
.asciz "\006\000\000\000\000\000\000\000\003\000\000\000\023\000\000"
|
||||
.size .Lanon.7fcf6383cbbc6b99e4703d6007e30d82.1, 24
|
||||
|
||||
.ident "rustc version 1.98.1 (48a229cea 2026-09-01) (built from a source tarball)"
|
||||
.section ".note.GNU-stack","",@progbits
|
||||
6
uczelnia/3_semestr/rust/laby/lab1/src/gcd_sub.rs
Normal file
6
uczelnia/3_semestr/rust/laby/lab1/src/gcd_sub.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
pub fn gcd_sub(mut a: usize, mut b: usize) -> usize {
|
||||
while a != b {
|
||||
if a > b { a -= b } else { b -= a }
|
||||
}
|
||||
a
|
||||
}
|
||||
83
uczelnia/3_semestr/rust/laby/lab1/src/gcd_sub.s
Normal file
83
uczelnia/3_semestr/rust/laby/lab1/src/gcd_sub.s
Normal file
@@ -0,0 +1,83 @@
|
||||
.file "gcd_sub.1e33a45d982b2d22-cgu.0"
|
||||
.section .text._RNvCs2ALji1wryY8_7gcd_sub7gcd_sub,"ax",@progbits
|
||||
.globl _RNvCs2ALji1wryY8_7gcd_sub7gcd_sub
|
||||
.p2align 4
|
||||
.type _RNvCs2ALji1wryY8_7gcd_sub7gcd_sub,@function
|
||||
_RNvCs2ALji1wryY8_7gcd_sub7gcd_sub:
|
||||
.cfi_startproc
|
||||
subq $40, %rsp
|
||||
.cfi_def_cfa_offset 48
|
||||
movq %rdi, 24(%rsp)
|
||||
movq %rsi, 32(%rsp)
|
||||
.LBB0_1:
|
||||
movq 24(%rsp), %rax
|
||||
cmpq 32(%rsp), %rax
|
||||
jne .LBB0_3
|
||||
movq 24(%rsp), %rax
|
||||
addq $40, %rsp
|
||||
.cfi_def_cfa_offset 8
|
||||
retq
|
||||
.LBB0_3:
|
||||
.cfi_def_cfa_offset 48
|
||||
movq 24(%rsp), %rax
|
||||
cmpq 32(%rsp), %rax
|
||||
ja .LBB0_5
|
||||
movq 24(%rsp), %rcx
|
||||
movq 32(%rsp), %rax
|
||||
movq %rax, %rdx
|
||||
subq %rcx, %rdx
|
||||
movq %rdx, 16(%rsp)
|
||||
cmpq %rcx, %rax
|
||||
jb .LBB0_7
|
||||
jmp .LBB0_6
|
||||
.LBB0_5:
|
||||
movq 32(%rsp), %rcx
|
||||
movq 24(%rsp), %rax
|
||||
movq %rax, %rdx
|
||||
subq %rcx, %rdx
|
||||
movq %rdx, 8(%rsp)
|
||||
cmpq %rcx, %rax
|
||||
jb .LBB0_9
|
||||
jmp .LBB0_8
|
||||
.LBB0_6:
|
||||
movq 16(%rsp), %rax
|
||||
movq %rax, 32(%rsp)
|
||||
jmp .LBB0_1
|
||||
.LBB0_7:
|
||||
leaq .Lanon.74accf476ba42064f0b195c61eb89188.1(%rip), %rdi
|
||||
callq *_RNvNtNtCs6Xa2QwhY5JM_4core9panicking11panic_const24panic_const_sub_overflow@GOTPCREL(%rip)
|
||||
.LBB0_8:
|
||||
movq 8(%rsp), %rax
|
||||
movq %rax, 24(%rsp)
|
||||
jmp .LBB0_1
|
||||
.LBB0_9:
|
||||
leaq .Lanon.74accf476ba42064f0b195c61eb89188.2(%rip), %rdi
|
||||
callq *_RNvNtNtCs6Xa2QwhY5JM_4core9panicking11panic_const24panic_const_sub_overflow@GOTPCREL(%rip)
|
||||
.Lfunc_end0:
|
||||
.size _RNvCs2ALji1wryY8_7gcd_sub7gcd_sub, .Lfunc_end0-_RNvCs2ALji1wryY8_7gcd_sub7gcd_sub
|
||||
.cfi_endproc
|
||||
|
||||
.type .Lanon.74accf476ba42064f0b195c61eb89188.0,@object
|
||||
.section .rodata.str1.1,"aMS",@progbits,1
|
||||
.Lanon.74accf476ba42064f0b195c61eb89188.0:
|
||||
.asciz "gcd_sub.rs"
|
||||
.size .Lanon.74accf476ba42064f0b195c61eb89188.0, 11
|
||||
|
||||
.type .Lanon.74accf476ba42064f0b195c61eb89188.1,@object
|
||||
.section .data.rel.ro..Lanon.74accf476ba42064f0b195c61eb89188.1,"aw",@progbits
|
||||
.p2align 3, 0x0
|
||||
.Lanon.74accf476ba42064f0b195c61eb89188.1:
|
||||
.quad .Lanon.74accf476ba42064f0b195c61eb89188.0
|
||||
.asciz "\n\000\000\000\000\000\000\000\003\000\000\000$\000\000"
|
||||
.size .Lanon.74accf476ba42064f0b195c61eb89188.1, 24
|
||||
|
||||
.type .Lanon.74accf476ba42064f0b195c61eb89188.2,@object
|
||||
.section .data.rel.ro..Lanon.74accf476ba42064f0b195c61eb89188.2,"aw",@progbits
|
||||
.p2align 3, 0x0
|
||||
.Lanon.74accf476ba42064f0b195c61eb89188.2:
|
||||
.quad .Lanon.74accf476ba42064f0b195c61eb89188.0
|
||||
.asciz "\n\000\000\000\000\000\000\000\003\000\000\000\024\000\000"
|
||||
.size .Lanon.74accf476ba42064f0b195c61eb89188.2, 24
|
||||
|
||||
.ident "rustc version 1.98.1 (48a229cea 2026-09-01) (built from a source tarball)"
|
||||
.section ".note.GNU-stack","",@progbits
|
||||
@@ -1,3 +1,6 @@
|
||||
use uuid::Uuid;
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
let id = Uuid::new_v4();
|
||||
println!("ID: {id}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user