Skip to content

Instantly share code, notes, and snippets.

@PetarKirov PetarKirov/test.asm

Last active Apr 9, 2020
Embed
What would you like to do?
dlang toStaticArray LDC 1.20.0 codegen with flags: `-O`
_Dmain:
push rax
mov dword ptr [rsp + 4], 7562337
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 4
xor eax, eax
call printf@PLT
call void example.testSomeMore()@PLT
xor eax, eax
pop rcx
ret
pure nothrow @nogc @safe char[4] example.toStaticArray!(char, 3uL).toStaticArray(const(char[3])):
mov eax, edi
and eax, 16777215
ret
void example.testSomeMore():
push r14
push rbx
push rax
mov word ptr [rsp + 4], 48
lea r14, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov rdi, r14
mov esi, 2
xor eax, eax
call printf@PLT
mov word ptr [rsp + 4], 49
lea rdx, [rsp + 4]
mov rdi, r14
mov esi, 2
xor eax, eax
call printf@PLT
mov word ptr [rsp + 4], 50
lea rdx, [rsp + 4]
mov rdi, r14
mov esi, 2
xor eax, eax
call printf@PLT
mov word ptr [rsp + 4], 51
lea rdx, [rsp + 4]
mov rdi, r14
mov esi, 2
xor eax, eax
call printf@PLT
mov word ptr [rsp + 4], 52
lea rdx, [rsp + 4]
mov rdi, r14
mov esi, 2
xor eax, eax
call printf@PLT
mov word ptr [rsp + 4], 53
lea rdx, [rsp + 4]
mov rdi, r14
mov esi, 2
xor eax, eax
call printf@PLT
mov word ptr [rsp + 4], 54
lea rdx, [rsp + 4]
mov rdi, r14
mov esi, 2
xor eax, eax
call printf@PLT
mov word ptr [rsp + 4], 55
lea rdx, [rsp + 4]
mov rdi, r14
mov esi, 2
xor eax, eax
call printf@PLT
mov word ptr [rsp + 4], 56
lea rdx, [rsp + 4]
mov rdi, r14
mov esi, 2
xor eax, eax
call printf@PLT
mov word ptr [rsp + 4], 57
lea rdx, [rsp + 4]
mov rdi, r14
mov esi, 2
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12337
lea rbx, [rsp + 4]
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12593
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12849
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13105
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13361
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13617
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13873
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14129
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14385
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14641
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12338
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12594
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12850
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13106
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13362
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13618
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13874
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14130
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14386
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14642
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12339
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12595
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12851
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13107
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13363
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13619
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13875
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14131
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14387
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14643
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12340
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12596
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12852
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13108
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13364
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13620
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13876
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14132
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14388
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14644
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12341
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12597
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12853
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13109
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13365
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13621
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13877
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14133
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14389
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14645
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12342
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12598
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12854
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13110
mov rdi, r14
mov esi, 3
mov rdx, rbx
xor eax, eax
call printf@PLT
add rsp, 8
pop rbx
pop r14
ret
nothrow @nogc void example.test!("0").test():
push rax
mov word ptr [rsp + 6], 48
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 6]
mov esi, 2
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("1").test():
push rax
mov word ptr [rsp + 6], 49
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 6]
mov esi, 2
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("2").test():
push rax
mov word ptr [rsp + 6], 50
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 6]
mov esi, 2
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("3").test():
push rax
mov word ptr [rsp + 6], 51
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 6]
mov esi, 2
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("4").test():
push rax
mov word ptr [rsp + 6], 52
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 6]
mov esi, 2
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("5").test():
push rax
mov word ptr [rsp + 6], 53
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 6]
mov esi, 2
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("6").test():
push rax
mov word ptr [rsp + 6], 54
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 6]
mov esi, 2
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("7").test():
push rax
mov word ptr [rsp + 6], 55
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 6]
mov esi, 2
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("8").test():
push rax
mov word ptr [rsp + 6], 56
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 6]
mov esi, 2
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("9").test():
push rax
mov word ptr [rsp + 6], 57
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 6]
mov esi, 2
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("10").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12337
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("11").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12593
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("12").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12849
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("13").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13105
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("14").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13361
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("15").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13617
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("16").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13873
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("17").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14129
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("18").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14385
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("19").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14641
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("20").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12338
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("21").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12594
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("22").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12850
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("23").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13106
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("24").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13362
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("25").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13618
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("26").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13874
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("27").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14130
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("28").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14386
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("29").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14642
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("30").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12339
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("31").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12595
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("32").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12851
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("33").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13107
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("34").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13363
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("35").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13619
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("36").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13875
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("37").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14131
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("38").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14387
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("39").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14643
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("40").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12340
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("41").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12596
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("42").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12852
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("43").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13108
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("44").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13364
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("45").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13620
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("46").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13876
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("47").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14132
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("48").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14388
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("49").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14644
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("50").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12341
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("51").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12597
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("52").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12853
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("53").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13109
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("54").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13365
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("55").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13621
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("56").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13877
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("57").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14133
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("58").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14389
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("59").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 14645
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("60").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12342
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("61").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12598
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("62").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 12854
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
nothrow @nogc void example.test!("63").test():
push rax
mov byte ptr [rsp + 6], 0
mov word ptr [rsp + 4], 13110
lea rdi, [rip + .L.str.1]
lea rdx, [rsp + 4]
mov esi, 3
xor eax, eax
call printf@PLT
pop rax
ret
main:
mov rdx, qword ptr [rip + _Dmain@GOTPCREL]
jmp _d_run_main@PLT
pure nothrow @nogc @safe char[2] example.toStaticArray!(char, 1uL).toStaticArray(const(char[1])):
movzx eax, dil
ret
pure nothrow @nogc @safe char[3] example.toStaticArray!(char, 2uL).toStaticArray(const(char[2])):
movzx eax, di
ret
ldc.register_dso:
sub rsp, 40
mov qword ptr [rsp + 8], 1
lea rax, [rip + ldc.dso_slot]
mov qword ptr [rsp + 16], rax
lea rax, [rip + __stop___minfo]
movq xmm0, rax
lea rax, [rip + __start___minfo]
movq xmm1, rax
punpcklqdq xmm1, xmm0
movdqu xmmword ptr [rsp + 24], xmm1
lea rdi, [rsp + 8]
call _d_dso_registry@PLT
add rsp, 40
ret
.L.str.1:
.asciz "%.*s"
example.__ModuleInfo:
.long 2147483652
.long 0
.asciz "example"
ldc.dso_slot:
.quad 0
import core.stdc.stdio : printf;
void main()
{
immutable str = "ads".toStaticArray;
printf("%.*s", cast(int)str.length, str.ptr);
testSomeMore();
}
pragma (inline, false)
void testSomeMore()
{
static foreach (i; 0 .. 64)
{
test!(mixin(`"`, i, `"`))();
}
}
void test(string s)()
{
immutable str = s.toStaticArray;
printf("%.*s", cast(int)str.length, str.ptr);
}
T[N+1] toStaticArray(T, size_t N)(scope const(T)[N] literal)
if (is(T == char) || is(T == wchar) || is(T == dchar))
{
T[N+1] result = void;
result[0..N] = literal[0..N];
result[N] = 0;
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.