id
int64 0
14.1k
| problem_id
int64 1
1.31k
| problem_title
stringclasses 441
values | difficulty
stringclasses 3
values | c_source
stringclasses 441
values | architecture
stringclasses 4
values | optimization
stringclasses 4
values | compiler
stringclasses 8
values | assembly
stringlengths 31
174k
|
|---|---|---|---|---|---|---|---|---|
14,100
| 1,312
|
Minimum Insertion Steps to Make a String Palindrome
|
Hard
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline int min(int a, int b)
{
return a < b ? a : b;
}
int minInsertions(char * s){
int i, j, len = strlen(s);
int *dp = malloc(len * sizeof(int));
memset(dp, 0, len * sizeof(int));
for (i = len - 2; i >= 0; i--) {
int left_down = 0;
for (j = i + 1; j < len; j++) {
int down = dp[j];
if (s[i] == s[j]) {
dp[j] = left_down;
} else {
dp[j] = min(down, dp[j - 1]) + 1;
}
left_down = down;
}
}
return dp[len - 1];
}
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: ./test s\n");
exit(-1);
}
printf("%d\n", minInsertions(argv[1]));
return 0;
}
|
riscv64
|
-O0
|
RISC-V 64 gcc 15.2.0
|
min:
addi sp,sp,-32
sd ra,24(sp)
sd s0,16(sp)
addi s0,sp,32
mv a5,a0
mv a4,a1
sw a5,-20(s0)
mv a5,a4
sw a5,-24(s0)
lw a5,-20(s0)
mv a2,a5
lw a5,-24(s0)
mv a3,a5
sext.w a4,a3
sext.w a5,a2
ble a4,a5,.L2
mv a3,a2
.L2:
sext.w a5,a3
mv a0,a5
ld ra,24(sp)
ld s0,16(sp)
addi sp,sp,32
jr ra
minInsertions:
addi sp,sp,-64
sd ra,56(sp)
sd s0,48(sp)
addi s0,sp,64
sd a0,-56(s0)
ld a0,-56(s0)
call strlen
mv a5,a0
sw a5,-32(s0)
lw a5,-32(s0)
slli a5,a5,2
mv a0,a5
call malloc
mv a5,a0
sd a5,-40(s0)
lw a5,-32(s0)
slli a5,a5,2
mv a2,a5
li a1,0
ld a0,-40(s0)
call memset
lw a5,-32(s0)
addiw a5,a5,-2
sw a5,-20(s0)
j .L5
.L10:
sw zero,-28(s0)
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-24(s0)
j .L6
.L9:
lw a5,-24(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a5,0(a5)
sw a5,-44(s0)
lw a5,-20(s0)
ld a4,-56(s0)
add a5,a4,a5
lbu a3,0(a5)
lw a5,-24(s0)
ld a4,-56(s0)
add a5,a4,a5
lbu a5,0(a5)
mv a4,a3
bne a4,a5,.L7
lw a5,-24(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a4,-28(s0)
sw a4,0(a5)
j .L8
.L7:
lw a5,-24(s0)
slli a5,a5,2
addi a5,a5,-4
ld a4,-40(s0)
add a5,a4,a5
lw a4,0(a5)
lw a5,-44(s0)
mv a1,a4
mv a0,a5
call min
mv a5,a0
mv a3,a5
lw a5,-24(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
addiw a4,a3,1
sext.w a4,a4
sw a4,0(a5)
.L8:
lw a5,-44(s0)
sw a5,-28(s0)
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-24(s0)
.L6:
lw a5,-24(s0)
mv a4,a5
lw a5,-32(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L9
lw a5,-20(s0)
addiw a5,a5,-1
sw a5,-20(s0)
.L5:
lw a5,-20(s0)
sext.w a5,a5
bge a5,zero,.L10
lw a5,-32(s0)
slli a5,a5,2
addi a5,a5,-4
ld a4,-40(s0)
add a5,a4,a5
lw a5,0(a5)
mv a0,a5
ld ra,56(sp)
ld s0,48(sp)
addi sp,sp,64
jr ra
.LC0:
.string "Usage: ./test s\n"
.LC1:
.string "%d\n"
main:
addi sp,sp,-32
sd ra,24(sp)
sd s0,16(sp)
addi s0,sp,32
mv a5,a0
sd a1,-32(s0)
sw a5,-20(s0)
lw a5,-20(s0)
sext.w a4,a5
li a5,2
beq a4,a5,.L13
lui a5,%hi(stderr)
ld a5,%lo(stderr)(a5)
mv a3,a5
li a2,16
li a1,1
lui a5,%hi(.LC0)
addi a0,a5,%lo(.LC0)
call fwrite
li a0,-1
call exit
.L13:
ld a5,-32(s0)
addi a5,a5,8
ld a5,0(a5)
mv a0,a5
call minInsertions
mv a5,a0
mv a1,a5
lui a5,%hi(.LC1)
addi a0,a5,%lo(.LC1)
call printf
li a5,0
mv a0,a5
ld ra,24(sp)
ld s0,16(sp)
addi sp,sp,32
jr ra
|
14,101
| 1,312
|
Minimum Insertion Steps to Make a String Palindrome
|
Hard
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline int min(int a, int b)
{
return a < b ? a : b;
}
int minInsertions(char * s){
int i, j, len = strlen(s);
int *dp = malloc(len * sizeof(int));
memset(dp, 0, len * sizeof(int));
for (i = len - 2; i >= 0; i--) {
int left_down = 0;
for (j = i + 1; j < len; j++) {
int down = dp[j];
if (s[i] == s[j]) {
dp[j] = left_down;
} else {
dp[j] = min(down, dp[j - 1]) + 1;
}
left_down = down;
}
}
return dp[len - 1];
}
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: ./test s\n");
exit(-1);
}
printf("%d\n", minInsertions(argv[1]));
return 0;
}
|
riscv64
|
-O1
|
RISC-V 64 gcc 15.2.0
|
minInsertions:
addi sp,sp,-48
sd ra,40(sp)
sd s0,32(sp)
sd s1,24(sp)
sd s2,16(sp)
sd s3,8(sp)
sd s4,0(sp)
mv s4,a0
call strlen
mv s3,a0
sext.w s0,a0
slli s2,s0,2
mv a0,s2
call malloc
mv s1,a0
mv a2,s2
li a1,0
call memset
li a5,1
ble s0,a5,.L2
addiw t5,s3,-1
addi t4,s1,-8
add t4,t4,s2
addi a0,s4,-2
add t1,a0,s0
mv t3,t5
j .L7
.L5:
addiw a4,a4,1
.L4:
sw a4,4(a6)
addi a5,a5,4
addi a3,a3,1
beq a3,a7,.L12
.L6:
mv a6,a5
mv a4,a1
lw a1,4(a5)
lbu a2,0(a3)
beq a2,a0,.L4
lw a2,0(a5)
mv a4,a2
sext.w a2,a2
ble a2,a1,.L5
mv a4,a1
j .L5
.L12:
addiw t3,t3,-1
beq t3,zero,.L2
addi t4,t4,-4
addi t1,t1,-1
.L7:
ble s0,t3,.L3
lbu a0,0(t1)
addi a3,t1,1
addi a7,t1,2
subw a5,t5,t3
slli a5,a5,32
srli a5,a5,32
add a7,a7,a5
mv a5,t4
li a1,0
j .L6
.L3:
addiw t3,t3,-1
addi t4,t4,-4
addi t1,t1,-1
j .L7
.L2:
slli s0,s0,2
addi s0,s0,-4
add s1,s1,s0
lw a0,0(s1)
ld ra,40(sp)
ld s0,32(sp)
ld s1,24(sp)
ld s2,16(sp)
ld s3,8(sp)
ld s4,0(sp)
addi sp,sp,48
jr ra
.LC0:
.string "Usage: ./test s\n"
.LC1:
.string "%d\n"
main:
addi sp,sp,-16
sd ra,8(sp)
li a5,2
bne a0,a5,.L16
ld a0,8(a1)
call minInsertions
mv a1,a0
lui a0,%hi(.LC1)
addi a0,a0,%lo(.LC1)
call printf
li a0,0
ld ra,8(sp)
addi sp,sp,16
jr ra
.L16:
lui a5,%hi(stderr)
ld a3,%lo(stderr)(a5)
li a2,16
li a1,1
lui a0,%hi(.LC0)
addi a0,a0,%lo(.LC0)
call fwrite
li a0,-1
call exit
|
14,102
| 1,312
|
Minimum Insertion Steps to Make a String Palindrome
|
Hard
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline int min(int a, int b)
{
return a < b ? a : b;
}
int minInsertions(char * s){
int i, j, len = strlen(s);
int *dp = malloc(len * sizeof(int));
memset(dp, 0, len * sizeof(int));
for (i = len - 2; i >= 0; i--) {
int left_down = 0;
for (j = i + 1; j < len; j++) {
int down = dp[j];
if (s[i] == s[j]) {
dp[j] = left_down;
} else {
dp[j] = min(down, dp[j - 1]) + 1;
}
left_down = down;
}
}
return dp[len - 1];
}
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: ./test s\n");
exit(-1);
}
printf("%d\n", minInsertions(argv[1]));
return 0;
}
|
riscv64
|
-O2
|
RISC-V 64 gcc 15.2.0
|
minInsertions:
addi sp,sp,-48
sd ra,40(sp)
sd s0,32(sp)
sd s1,24(sp)
sd s2,16(sp)
sd s3,8(sp)
mv s3,a0
call strlen
sext.w s0,a0
slli s2,s0,2
mv s1,a0
li a1,1
mv a0,s2
call calloc
li a5,1
ble s0,a5,.L2
addiw t5,s1,-1
addi t1,s3,-2
addi t4,a0,-8
mv t3,t5
add t1,t1,s0
add t4,t4,s2
ble s0,t3,.L3
.L17:
subw a5,t5,t3
slli a5,a5,32
lbu a7,0(t1)
srli a5,a5,32
addi a6,t1,2
add a6,a6,a5
addi a3,t1,1
mv a5,t4
li a2,0
.L6:
lbu a1,0(a3)
mv a4,a2
addi a3,a3,1
lw a2,4(a5)
beq a1,a7,.L4
lw a1,0(a5)
mv a4,a1
ble a1,a2,.L5
mv a4,a2
.L5:
addiw a4,a4,1
.L4:
sw a4,4(a5)
addi a5,a5,4
bne a3,a6,.L6
addiw t3,t3,-1
beq t3,zero,.L2
.L15:
addi t4,t4,-4
addi t1,t1,-1
bgt s0,t3,.L17
.L3:
addiw t3,t3,-1
j .L15
.L2:
slli s0,s0,2
ld ra,40(sp)
add a0,a0,s0
ld s0,32(sp)
lw a0,-4(a0)
ld s1,24(sp)
ld s2,16(sp)
ld s3,8(sp)
addi sp,sp,48
jr ra
.LC0:
.string "Usage: ./test s\n"
.LC1:
.string "%d\n"
main:
addi sp,sp,-16
sd ra,8(sp)
li a5,2
bne a0,a5,.L21
ld a0,8(a1)
call minInsertions
mv a1,a0
lui a0,%hi(.LC1)
addi a0,a0,%lo(.LC1)
call printf
ld ra,8(sp)
li a0,0
addi sp,sp,16
jr ra
.L21:
lui a5,%hi(stderr)
ld a3,%lo(stderr)(a5)
lui a0,%hi(.LC0)
addi a0,a0,%lo(.LC0)
li a2,16
li a1,1
call fwrite
li a0,-1
call exit
|
14,103
| 1,312
|
Minimum Insertion Steps to Make a String Palindrome
|
Hard
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline int min(int a, int b)
{
return a < b ? a : b;
}
int minInsertions(char * s){
int i, j, len = strlen(s);
int *dp = malloc(len * sizeof(int));
memset(dp, 0, len * sizeof(int));
for (i = len - 2; i >= 0; i--) {
int left_down = 0;
for (j = i + 1; j < len; j++) {
int down = dp[j];
if (s[i] == s[j]) {
dp[j] = left_down;
} else {
dp[j] = min(down, dp[j - 1]) + 1;
}
left_down = down;
}
}
return dp[len - 1];
}
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: ./test s\n");
exit(-1);
}
printf("%d\n", minInsertions(argv[1]));
return 0;
}
|
riscv64
|
-O3
|
RISC-V 64 gcc 15.2.0
|
minInsertions:
addi sp,sp,-48
sd ra,40(sp)
sd s0,32(sp)
sd s1,24(sp)
sd s2,16(sp)
sd s3,8(sp)
mv s3,a0
call strlen
sext.w s0,a0
slli s2,s0,2
mv s1,a0
li a1,1
mv a0,s2
call calloc
li a5,1
ble s0,a5,.L2
addiw t5,s1,-1
addi t1,s3,-2
addi t4,a0,-8
mv t3,t5
add t1,t1,s0
add t4,t4,s2
ble s0,t3,.L3
.L20:
subw a6,t5,t3
slli a6,a6,32
addi a5,t1,2
srli a6,a6,32
add a6,a6,a5
lbu a7,0(t1)
addi a4,t1,1
mv a5,t4
li a1,0
j .L8
.L19:
lw a1,0(a5)
addi a4,a4,1
mv a3,a1
ble a1,a2,.L5
mv a3,a2
.L5:
addiw a3,a3,1
sw a3,4(a5)
beq a4,a6,.L6
.L17:
addi a5,a5,4
mv a1,a2
.L8:
lbu a3,0(a4)
lw a2,4(a5)
bne a3,a7,.L19
sw a1,4(a5)
addi a4,a4,1
bne a6,a4,.L17
.L6:
addiw t3,t3,-1
beq t3,zero,.L2
.L16:
addi t4,t4,-4
addi t1,t1,-1
bgt s0,t3,.L20
.L3:
addiw t3,t3,-1
j .L16
.L2:
slli s0,s0,2
ld ra,40(sp)
add a0,a0,s0
ld s0,32(sp)
lw a0,-4(a0)
ld s1,24(sp)
ld s2,16(sp)
ld s3,8(sp)
addi sp,sp,48
jr ra
.LC0:
.string "Usage: ./test s\n"
.LC1:
.string "%d\n"
main:
addi sp,sp,-16
sd ra,8(sp)
li a5,2
bne a0,a5,.L24
ld a0,8(a1)
call minInsertions
mv a1,a0
lui a0,%hi(.LC1)
addi a0,a0,%lo(.LC1)
call printf
ld ra,8(sp)
li a0,0
addi sp,sp,16
jr ra
.L24:
lui a5,%hi(stderr)
ld a3,%lo(stderr)(a5)
lui a0,%hi(.LC0)
addi a0,a0,%lo(.LC0)
li a2,16
li a1,1
call fwrite
li a0,-1
call exit
|
14,104
| 1,312
|
Minimum Insertion Steps to Make a String Palindrome
|
Hard
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline int min(int a, int b)
{
return a < b ? a : b;
}
int minInsertions(char * s){
int i, j, len = strlen(s);
int *dp = malloc(len * sizeof(int));
memset(dp, 0, len * sizeof(int));
for (i = len - 2; i >= 0; i--) {
int left_down = 0;
for (j = i + 1; j < len; j++) {
int down = dp[j];
if (s[i] == s[j]) {
dp[j] = left_down;
} else {
dp[j] = min(down, dp[j - 1]) + 1;
}
left_down = down;
}
}
return dp[len - 1];
}
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: ./test s\n");
exit(-1);
}
printf("%d\n", minInsertions(argv[1]));
return 0;
}
|
x86-64
|
-O0
|
x86-64 clang 21.1.0
|
minInsertions:
push rbp
mov rbp, rsp
sub rsp, 48
mov qword ptr [rbp - 8], rdi
mov rdi, qword ptr [rbp - 8]
call strlen@PLT
mov dword ptr [rbp - 20], eax
movsxd rdi, dword ptr [rbp - 20]
shl rdi, 2
call malloc@PLT
mov qword ptr [rbp - 32], rax
mov rdi, qword ptr [rbp - 32]
movsxd rdx, dword ptr [rbp - 20]
shl rdx, 2
xor esi, esi
call memset@PLT
mov eax, dword ptr [rbp - 20]
sub eax, 2
mov dword ptr [rbp - 12], eax
.LBB0_1:
cmp dword ptr [rbp - 12], 0
jl .LBB0_11
mov dword ptr [rbp - 36], 0
mov eax, dword ptr [rbp - 12]
add eax, 1
mov dword ptr [rbp - 16], eax
.LBB0_3:
mov eax, dword ptr [rbp - 16]
cmp eax, dword ptr [rbp - 20]
jge .LBB0_9
mov rax, qword ptr [rbp - 32]
movsxd rcx, dword ptr [rbp - 16]
mov eax, dword ptr [rax + 4*rcx]
mov dword ptr [rbp - 40], eax
mov rax, qword ptr [rbp - 8]
movsxd rcx, dword ptr [rbp - 12]
movsx eax, byte ptr [rax + rcx]
mov rcx, qword ptr [rbp - 8]
movsxd rdx, dword ptr [rbp - 16]
movsx ecx, byte ptr [rcx + rdx]
cmp eax, ecx
jne .LBB0_6
mov edx, dword ptr [rbp - 36]
mov rax, qword ptr [rbp - 32]
movsxd rcx, dword ptr [rbp - 16]
mov dword ptr [rax + 4*rcx], edx
jmp .LBB0_7
.LBB0_6:
mov edi, dword ptr [rbp - 40]
mov rax, qword ptr [rbp - 32]
mov ecx, dword ptr [rbp - 16]
sub ecx, 1
movsxd rcx, ecx
mov esi, dword ptr [rax + 4*rcx]
call min
mov edx, eax
add edx, 1
mov rax, qword ptr [rbp - 32]
movsxd rcx, dword ptr [rbp - 16]
mov dword ptr [rax + 4*rcx], edx
.LBB0_7:
mov eax, dword ptr [rbp - 40]
mov dword ptr [rbp - 36], eax
mov eax, dword ptr [rbp - 16]
add eax, 1
mov dword ptr [rbp - 16], eax
jmp .LBB0_3
.LBB0_9:
jmp .LBB0_10
.LBB0_10:
mov eax, dword ptr [rbp - 12]
add eax, -1
mov dword ptr [rbp - 12], eax
jmp .LBB0_1
.LBB0_11:
mov rax, qword ptr [rbp - 32]
mov ecx, dword ptr [rbp - 20]
sub ecx, 1
movsxd rcx, ecx
mov eax, dword ptr [rax + 4*rcx]
add rsp, 48
pop rbp
ret
min:
push rbp
mov rbp, rsp
mov dword ptr [rbp - 4], edi
mov dword ptr [rbp - 8], esi
mov eax, dword ptr [rbp - 4]
cmp eax, dword ptr [rbp - 8]
jge .LBB1_2
mov eax, dword ptr [rbp - 4]
mov dword ptr [rbp - 12], eax
jmp .LBB1_3
.LBB1_2:
mov eax, dword ptr [rbp - 8]
mov dword ptr [rbp - 12], eax
.LBB1_3:
mov eax, dword ptr [rbp - 12]
pop rbp
ret
main:
push rbp
mov rbp, rsp
sub rsp, 16
mov dword ptr [rbp - 4], 0
mov dword ptr [rbp - 8], edi
mov qword ptr [rbp - 16], rsi
cmp dword ptr [rbp - 8], 2
je .LBB2_2
mov rax, qword ptr [rip + stderr@GOTPCREL]
mov rdi, qword ptr [rax]
lea rsi, [rip + .L.str]
mov al, 0
call fprintf@PLT
mov edi, 4294967295
call exit@PLT
.LBB2_2:
mov rax, qword ptr [rbp - 16]
mov rdi, qword ptr [rax + 8]
call minInsertions
mov esi, eax
lea rdi, [rip + .L.str.1]
mov al, 0
call printf@PLT
xor eax, eax
add rsp, 16
pop rbp
ret
.L.str:
.asciz "Usage: ./test s\n"
.L.str.1:
.asciz "%d\n"
|
14,105
| 1,312
|
Minimum Insertion Steps to Make a String Palindrome
|
Hard
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline int min(int a, int b)
{
return a < b ? a : b;
}
int minInsertions(char * s){
int i, j, len = strlen(s);
int *dp = malloc(len * sizeof(int));
memset(dp, 0, len * sizeof(int));
for (i = len - 2; i >= 0; i--) {
int left_down = 0;
for (j = i + 1; j < len; j++) {
int down = dp[j];
if (s[i] == s[j]) {
dp[j] = left_down;
} else {
dp[j] = min(down, dp[j - 1]) + 1;
}
left_down = down;
}
}
return dp[len - 1];
}
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: ./test s\n");
exit(-1);
}
printf("%d\n", minInsertions(argv[1]));
return 0;
}
|
x86-64
|
-O1
|
x86-64 clang 21.1.0
|
minInsertions:
push r15
push r14
push r13
push r12
push rbx
mov rbx, rdi
call strlen@PLT
mov r14, rax
mov r13, rax
shl r13, 32
mov r12, r13
sar r12, 30
mov rdi, r12
call malloc@PLT
mov r15, rax
mov rdi, rax
xor esi, esi
mov rdx, r12
call memset@PLT
cmp r14d, 2
jl .LBB0_8
mov eax, 4294967294
add eax, r14d
lea ecx, [r14 - 1]
mov edx, r14d
and edx, 2147483647
dec rdx
jmp .LBB0_2
.LBB0_7:
dec rcx
test rax, rax
lea rax, [rax - 1]
jle .LBB0_8
.LBB0_2:
cmp rax, rdx
jge .LBB0_7
movzx esi, byte ptr [rbx + rax]
xor edi, edi
mov r11, rcx
mov r9, rax
jmp .LBB0_4
.LBB0_6:
mov dword ptr [r15 + 4*r8], r10d
lea r11, [r8 + 1]
mov r9, r8
cmp r11d, r14d
jge .LBB0_7
.LBB0_4:
mov r10d, edi
mov r8, r11
mov edi, dword ptr [r15 + 4*r11]
cmp sil, byte ptr [rbx + r11]
je .LBB0_6
mov r9d, r9d
mov r10d, dword ptr [r15 + 4*r9]
cmp edi, r10d
cmovl r10d, edi
inc r10d
jmp .LBB0_6
.LBB0_8:
movabs rax, -4294967296
add r13, rax
sar r13, 30
mov eax, dword ptr [r15 + r13]
pop rbx
pop r12
pop r13
pop r14
pop r15
ret
main:
push r15
push r14
push r13
push r12
push rbx
cmp edi, 2
jne .LBB1_10
mov rbx, qword ptr [rsi + 8]
mov rdi, rbx
call strlen@PLT
mov r14, rax
mov r13, rax
shl r13, 32
mov r12, r13
sar r12, 30
mov rdi, r12
call malloc@PLT
mov r15, rax
mov rdi, rax
xor esi, esi
mov rdx, r12
call memset@PLT
cmp r14d, 2
jl .LBB1_9
mov eax, 4294967294
add eax, r14d
lea ecx, [r14 - 1]
mov edx, r14d
and edx, 2147483647
dec rdx
jmp .LBB1_3
.LBB1_8:
dec rcx
test rax, rax
lea rax, [rax - 1]
jle .LBB1_9
.LBB1_3:
cmp rax, rdx
jge .LBB1_8
movzx esi, byte ptr [rbx + rax]
xor edi, edi
mov r11, rcx
mov r9, rax
jmp .LBB1_5
.LBB1_7:
mov dword ptr [r15 + 4*r8], r10d
lea r11, [r8 + 1]
mov r9, r8
cmp r11d, r14d
jge .LBB1_8
.LBB1_5:
mov r10d, edi
mov r8, r11
mov edi, dword ptr [r15 + 4*r11]
cmp sil, byte ptr [rbx + r11]
je .LBB1_7
mov r9d, r9d
mov r10d, dword ptr [r15 + 4*r9]
cmp edi, r10d
cmovl r10d, edi
inc r10d
jmp .LBB1_7
.LBB1_9:
movabs rax, -4294967296
add r13, rax
sar r13, 30
mov esi, dword ptr [r15 + r13]
lea rdi, [rip + .L.str.1]
xor eax, eax
call printf@PLT
xor eax, eax
pop rbx
pop r12
pop r13
pop r14
pop r15
ret
.LBB1_10:
mov rax, qword ptr [rip + stderr@GOTPCREL]
mov rcx, qword ptr [rax]
lea rdi, [rip + .L.str]
mov esi, 16
mov edx, 1
call fwrite@PLT
mov edi, -1
call exit@PLT
.L.str:
.asciz "Usage: ./test s\n"
.L.str.1:
.asciz "%d\n"
|
14,106
| 1,312
|
Minimum Insertion Steps to Make a String Palindrome
|
Hard
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline int min(int a, int b)
{
return a < b ? a : b;
}
int minInsertions(char * s){
int i, j, len = strlen(s);
int *dp = malloc(len * sizeof(int));
memset(dp, 0, len * sizeof(int));
for (i = len - 2; i >= 0; i--) {
int left_down = 0;
for (j = i + 1; j < len; j++) {
int down = dp[j];
if (s[i] == s[j]) {
dp[j] = left_down;
} else {
dp[j] = min(down, dp[j - 1]) + 1;
}
left_down = down;
}
}
return dp[len - 1];
}
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: ./test s\n");
exit(-1);
}
printf("%d\n", minInsertions(argv[1]));
return 0;
}
|
x86-64
|
-O2
|
x86-64 clang 21.1.0
|
minInsertions:
push r15
push r14
push r12
push rbx
push rax
mov rbx, rdi
call strlen@PLT
mov r14, rax
mov r15, rax
shl r15, 32
mov rsi, r15
sar rsi, 30
mov edi, 1
call calloc@PLT
cmp r14d, 2
jl .LBB0_8
mov ecx, 4294967294
add ecx, r14d
lea edx, [r14 - 1]
mov esi, r14d
and esi, 2147483647
dec rsi
jmp .LBB0_2
.LBB0_7:
dec rdx
test rcx, rcx
lea rcx, [rcx - 1]
jle .LBB0_8
.LBB0_2:
cmp rcx, rsi
jge .LBB0_7
movzx edi, byte ptr [rbx + rcx]
xor r8d, r8d
mov r12, rdx
mov r10, rcx
jmp .LBB0_4
.LBB0_6:
mov dword ptr [rax + 4*r9], r11d
lea r12, [r9 + 1]
mov r10, r9
cmp r12d, r14d
jge .LBB0_7
.LBB0_4:
mov r11d, r8d
mov r9, r12
mov r8d, dword ptr [rax + 4*r12]
cmp dil, byte ptr [rbx + r12]
je .LBB0_6
mov r10d, r10d
mov r11d, dword ptr [rax + 4*r10]
cmp r8d, r11d
cmovl r11d, r8d
inc r11d
jmp .LBB0_6
.LBB0_8:
movabs rcx, -4294967296
add r15, rcx
sar r15, 30
mov eax, dword ptr [rax + r15]
add rsp, 8
pop rbx
pop r12
pop r14
pop r15
ret
main:
push r15
push r14
push r12
push rbx
push rax
cmp edi, 2
jne .LBB1_10
mov rbx, qword ptr [rsi + 8]
mov rdi, rbx
call strlen@PLT
mov r14, rax
mov r15, rax
shl r15, 32
mov rsi, r15
sar rsi, 30
mov edi, 1
call calloc@PLT
cmp r14d, 2
jl .LBB1_9
mov ecx, 4294967294
add ecx, r14d
lea edx, [r14 - 1]
mov esi, r14d
and esi, 2147483647
dec rsi
jmp .LBB1_3
.LBB1_8:
dec rdx
test rcx, rcx
lea rcx, [rcx - 1]
jle .LBB1_9
.LBB1_3:
cmp rcx, rsi
jge .LBB1_8
movzx edi, byte ptr [rbx + rcx]
xor r8d, r8d
mov r12, rdx
mov r10, rcx
jmp .LBB1_5
.LBB1_7:
mov dword ptr [rax + 4*r9], r11d
lea r12, [r9 + 1]
mov r10, r9
cmp r12d, r14d
jge .LBB1_8
.LBB1_5:
mov r11d, r8d
mov r9, r12
mov r8d, dword ptr [rax + 4*r12]
cmp dil, byte ptr [rbx + r12]
je .LBB1_7
mov r10d, r10d
mov r11d, dword ptr [rax + 4*r10]
cmp r8d, r11d
cmovl r11d, r8d
inc r11d
jmp .LBB1_7
.LBB1_9:
movabs rcx, -4294967296
add r15, rcx
sar r15, 30
mov esi, dword ptr [rax + r15]
lea rdi, [rip + .L.str.1]
xor eax, eax
call printf@PLT
xor eax, eax
add rsp, 8
pop rbx
pop r12
pop r14
pop r15
ret
.LBB1_10:
mov rax, qword ptr [rip + stderr@GOTPCREL]
mov rcx, qword ptr [rax]
lea rdi, [rip + .L.str]
mov esi, 16
mov edx, 1
call fwrite@PLT
mov edi, -1
call exit@PLT
.L.str:
.asciz "Usage: ./test s\n"
.L.str.1:
.asciz "%d\n"
|
14,107
| 1,312
|
Minimum Insertion Steps to Make a String Palindrome
|
Hard
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline int min(int a, int b)
{
return a < b ? a : b;
}
int minInsertions(char * s){
int i, j, len = strlen(s);
int *dp = malloc(len * sizeof(int));
memset(dp, 0, len * sizeof(int));
for (i = len - 2; i >= 0; i--) {
int left_down = 0;
for (j = i + 1; j < len; j++) {
int down = dp[j];
if (s[i] == s[j]) {
dp[j] = left_down;
} else {
dp[j] = min(down, dp[j - 1]) + 1;
}
left_down = down;
}
}
return dp[len - 1];
}
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: ./test s\n");
exit(-1);
}
printf("%d\n", minInsertions(argv[1]));
return 0;
}
|
x86-64
|
-O3
|
x86-64 clang 21.1.0
|
minInsertions:
push r15
push r14
push r12
push rbx
push rax
mov rbx, rdi
call strlen@PLT
mov r14, rax
mov r15, rax
shl r15, 32
mov rsi, r15
sar rsi, 30
mov edi, 1
call calloc@PLT
cmp r14d, 2
jl .LBB0_8
mov ecx, 4294967294
add ecx, r14d
lea edx, [r14 - 1]
mov esi, r14d
and esi, 2147483647
dec rsi
jmp .LBB0_2
.LBB0_7:
dec rdx
test rcx, rcx
lea rcx, [rcx - 1]
jle .LBB0_8
.LBB0_2:
cmp rcx, rsi
jge .LBB0_7
movzx edi, byte ptr [rbx + rcx]
xor r8d, r8d
mov r12, rdx
mov r10, rcx
jmp .LBB0_4
.LBB0_6:
mov dword ptr [rax + 4*r9], r11d
lea r12, [r9 + 1]
mov r10, r9
cmp r12d, r14d
jge .LBB0_7
.LBB0_4:
mov r11d, r8d
mov r9, r12
mov r8d, dword ptr [rax + 4*r12]
cmp dil, byte ptr [rbx + r12]
je .LBB0_6
mov r10d, r10d
mov r11d, dword ptr [rax + 4*r10]
cmp r8d, r11d
cmovl r11d, r8d
inc r11d
jmp .LBB0_6
.LBB0_8:
movabs rcx, -4294967296
add r15, rcx
sar r15, 30
mov eax, dword ptr [rax + r15]
add rsp, 8
pop rbx
pop r12
pop r14
pop r15
ret
main:
push r15
push r14
push r12
push rbx
push rax
cmp edi, 2
jne .LBB1_10
mov rbx, qword ptr [rsi + 8]
mov rdi, rbx
call strlen@PLT
mov r14, rax
mov r15, rax
shl r15, 32
mov rsi, r15
sar rsi, 30
mov edi, 1
call calloc@PLT
cmp r14d, 2
jl .LBB1_9
mov ecx, 4294967294
add ecx, r14d
lea edx, [r14 - 1]
mov esi, r14d
and esi, 2147483647
dec rsi
jmp .LBB1_3
.LBB1_8:
dec rdx
test rcx, rcx
lea rcx, [rcx - 1]
jle .LBB1_9
.LBB1_3:
cmp rcx, rsi
jge .LBB1_8
movzx edi, byte ptr [rbx + rcx]
xor r8d, r8d
mov r12, rdx
mov r10, rcx
jmp .LBB1_5
.LBB1_7:
mov dword ptr [rax + 4*r9], r11d
lea r12, [r9 + 1]
mov r10, r9
cmp r12d, r14d
jge .LBB1_8
.LBB1_5:
mov r11d, r8d
mov r9, r12
mov r8d, dword ptr [rax + 4*r12]
cmp dil, byte ptr [rbx + r12]
je .LBB1_7
mov r10d, r10d
mov r11d, dword ptr [rax + 4*r10]
cmp r8d, r11d
cmovl r11d, r8d
inc r11d
jmp .LBB1_7
.LBB1_9:
movabs rcx, -4294967296
add r15, rcx
sar r15, 30
mov esi, dword ptr [rax + r15]
lea rdi, [rip + .L.str.1]
xor eax, eax
call printf@PLT
xor eax, eax
add rsp, 8
pop rbx
pop r12
pop r14
pop r15
ret
.LBB1_10:
mov rax, qword ptr [rip + stderr@GOTPCREL]
mov rcx, qword ptr [rax]
lea rdi, [rip + .L.str]
mov esi, 16
mov edx, 1
call fwrite@PLT
mov edi, -1
call exit@PLT
.L.str:
.asciz "Usage: ./test s\n"
.L.str.1:
.asciz "%d\n"
|
14,108
| 1,312
|
Minimum Insertion Steps to Make a String Palindrome
|
Hard
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline int min(int a, int b)
{
return a < b ? a : b;
}
int minInsertions(char * s){
int i, j, len = strlen(s);
int *dp = malloc(len * sizeof(int));
memset(dp, 0, len * sizeof(int));
for (i = len - 2; i >= 0; i--) {
int left_down = 0;
for (j = i + 1; j < len; j++) {
int down = dp[j];
if (s[i] == s[j]) {
dp[j] = left_down;
} else {
dp[j] = min(down, dp[j - 1]) + 1;
}
left_down = down;
}
}
return dp[len - 1];
}
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: ./test s\n");
exit(-1);
}
printf("%d\n", minInsertions(argv[1]));
return 0;
}
|
x86-64
|
-O0
|
x86-64 gcc 15.2
|
min:
push rbp
mov rbp, rsp
mov DWORD PTR [rbp-4], edi
mov DWORD PTR [rbp-8], esi
mov edx, DWORD PTR [rbp-8]
mov eax, DWORD PTR [rbp-4]
cmp edx, eax
cmovle eax, edx
pop rbp
ret
minInsertions:
push rbp
mov rbp, rsp
sub rsp, 48
mov QWORD PTR [rbp-40], rdi
mov rax, QWORD PTR [rbp-40]
mov rdi, rax
call strlen
mov DWORD PTR [rbp-16], eax
mov eax, DWORD PTR [rbp-16]
cdqe
sal rax, 2
mov rdi, rax
call malloc
mov QWORD PTR [rbp-24], rax
mov eax, DWORD PTR [rbp-16]
cdqe
lea rdx, [0+rax*4]
mov rax, QWORD PTR [rbp-24]
mov esi, 0
mov rdi, rax
call memset
mov eax, DWORD PTR [rbp-16]
sub eax, 2
mov DWORD PTR [rbp-4], eax
jmp .L4
.L9:
mov DWORD PTR [rbp-12], 0
mov eax, DWORD PTR [rbp-4]
add eax, 1
mov DWORD PTR [rbp-8], eax
jmp .L5
.L8:
mov eax, DWORD PTR [rbp-8]
cdqe
lea rdx, [0+rax*4]
mov rax, QWORD PTR [rbp-24]
add rax, rdx
mov eax, DWORD PTR [rax]
mov DWORD PTR [rbp-28], eax
mov eax, DWORD PTR [rbp-4]
movsx rdx, eax
mov rax, QWORD PTR [rbp-40]
add rax, rdx
movzx edx, BYTE PTR [rax]
mov eax, DWORD PTR [rbp-8]
movsx rcx, eax
mov rax, QWORD PTR [rbp-40]
add rax, rcx
movzx eax, BYTE PTR [rax]
cmp dl, al
jne .L6
mov eax, DWORD PTR [rbp-8]
cdqe
lea rdx, [0+rax*4]
mov rax, QWORD PTR [rbp-24]
add rdx, rax
mov eax, DWORD PTR [rbp-12]
mov DWORD PTR [rdx], eax
jmp .L7
.L6:
mov eax, DWORD PTR [rbp-8]
cdqe
sal rax, 2
lea rdx, [rax-4]
mov rax, QWORD PTR [rbp-24]
add rax, rdx
mov edx, DWORD PTR [rax]
mov eax, DWORD PTR [rbp-28]
mov esi, edx
mov edi, eax
call min
mov edx, DWORD PTR [rbp-8]
movsx rdx, edx
lea rcx, [0+rdx*4]
mov rdx, QWORD PTR [rbp-24]
add rdx, rcx
add eax, 1
mov DWORD PTR [rdx], eax
.L7:
mov eax, DWORD PTR [rbp-28]
mov DWORD PTR [rbp-12], eax
add DWORD PTR [rbp-8], 1
.L5:
mov eax, DWORD PTR [rbp-8]
cmp eax, DWORD PTR [rbp-16]
jl .L8
sub DWORD PTR [rbp-4], 1
.L4:
cmp DWORD PTR [rbp-4], 0
jns .L9
mov eax, DWORD PTR [rbp-16]
cdqe
sal rax, 2
lea rdx, [rax-4]
mov rax, QWORD PTR [rbp-24]
add rax, rdx
mov eax, DWORD PTR [rax]
leave
ret
.LC0:
.string "Usage: ./test s\n"
.LC1:
.string "%d\n"
main:
push rbp
mov rbp, rsp
sub rsp, 16
mov DWORD PTR [rbp-4], edi
mov QWORD PTR [rbp-16], rsi
cmp DWORD PTR [rbp-4], 2
je .L12
mov rax, QWORD PTR stderr[rip]
mov rcx, rax
mov edx, 16
mov esi, 1
mov edi, OFFSET FLAT:.LC0
call fwrite
mov edi, -1
call exit
.L12:
mov rax, QWORD PTR [rbp-16]
add rax, 8
mov rax, QWORD PTR [rax]
mov rdi, rax
call minInsertions
mov esi, eax
mov edi, OFFSET FLAT:.LC1
mov eax, 0
call printf
mov eax, 0
leave
ret
|
14,109
| 1,312
|
Minimum Insertion Steps to Make a String Palindrome
|
Hard
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline int min(int a, int b)
{
return a < b ? a : b;
}
int minInsertions(char * s){
int i, j, len = strlen(s);
int *dp = malloc(len * sizeof(int));
memset(dp, 0, len * sizeof(int));
for (i = len - 2; i >= 0; i--) {
int left_down = 0;
for (j = i + 1; j < len; j++) {
int down = dp[j];
if (s[i] == s[j]) {
dp[j] = left_down;
} else {
dp[j] = min(down, dp[j - 1]) + 1;
}
left_down = down;
}
}
return dp[len - 1];
}
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: ./test s\n");
exit(-1);
}
printf("%d\n", minInsertions(argv[1]));
return 0;
}
|
x86-64
|
-O1
|
x86-64 gcc 15.2
|
minInsertions:
push r15
push r14
push r13
push r12
push rbp
push rbx
sub rsp, 24
mov rbx, rdi
call strlen
mov r13, rax
mov ebp, eax
movsx r12, eax
lea r14, [0+r12*4]
mov rdi, r14
call malloc
mov r15, rax
mov QWORD PTR [rsp], rax
mov rdx, r14
mov esi, 0
mov rdi, rax
call memset
cmp r13d, 1
jle .L2
sub r13d, 1
lea r11, [r15-8+r14]
lea r10, [rbx-1+r12]
mov edi, r13d
lea r14, [r15+4]
mov r15d, 0
mov QWORD PTR [rsp+8], r12
jmp .L6
.L13:
mov eax, DWORD PTR [rdx]
cmp ecx, eax
cmovle eax, ecx
add eax, 1
.L4:
mov DWORD PTR [r8+4], eax
add rdx, 4
add rsi, 1
cmp rdx, r9
je .L12
.L5:
mov r8, rdx
mov eax, ecx
mov ecx, DWORD PTR [rdx+4]
cmp r12b, BYTE PTR [rsi]
jne .L13
jmp .L4
.L12:
sub edi, 1
je .L10
sub r11, 4
sub r10, 1
.L6:
cmp ebp, edi
jle .L3
movzx r12d, BYTE PTR [r10-1]
mov rdx, r10
sub rdx, rbx
mov eax, r13d
sub eax, edi
lea rax, [rdx-1+rax]
lea r9, [r14+rax*4]
mov rsi, r10
mov rdx, r11
mov ecx, r15d
jmp .L5
.L10:
mov r12, QWORD PTR [rsp+8]
.L2:
mov rax, QWORD PTR [rsp]
mov eax, DWORD PTR [rax-4+r12*4]
add rsp, 24
pop rbx
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
.L3:
sub edi, 1
sub r11, 4
sub r10, 1
jmp .L6
.LC0:
.string "Usage: ./test s\n"
.LC1:
.string "%d\n"
main:
sub rsp, 8
cmp edi, 2
jne .L17
mov rdi, QWORD PTR [rsi+8]
call minInsertions
mov esi, eax
mov edi, OFFSET FLAT:.LC1
mov eax, 0
call printf
mov eax, 0
add rsp, 8
ret
.L17:
mov rcx, QWORD PTR stderr[rip]
mov edx, 16
mov esi, 1
mov edi, OFFSET FLAT:.LC0
call fwrite
mov edi, -1
call exit
|
14,110
| 1,312
|
Minimum Insertion Steps to Make a String Palindrome
|
Hard
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline int min(int a, int b)
{
return a < b ? a : b;
}
int minInsertions(char * s){
int i, j, len = strlen(s);
int *dp = malloc(len * sizeof(int));
memset(dp, 0, len * sizeof(int));
for (i = len - 2; i >= 0; i--) {
int left_down = 0;
for (j = i + 1; j < len; j++) {
int down = dp[j];
if (s[i] == s[j]) {
dp[j] = left_down;
} else {
dp[j] = min(down, dp[j - 1]) + 1;
}
left_down = down;
}
}
return dp[len - 1];
}
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: ./test s\n");
exit(-1);
}
printf("%d\n", minInsertions(argv[1]));
return 0;
}
|
x86-64
|
-O2
|
x86-64 gcc 15.2
|
minInsertions:
push r15
push r14
push r13
push r12
push rbp
mov rbp, rdi
push rbx
sub rsp, 8
call strlen
mov esi, 1
movsx r12, eax
mov rbx, rax
lea rdi, [0+r12*4]
call calloc
mov r15, rax
cmp ebx, 1
jle .L2
lea r9d, [rbx-1]
lea r11, [rax-8+r12*4]
lea r10, [rbp-1+r12]
lea r14, [rax+4]
cmp ebx, r9d
jle .L3
.L16:
mov rdx, r10
lea eax, [rbx-1]
movzx r8d, BYTE PTR [r10-1]
mov rsi, r10
sub rdx, rbp
sub eax, r9d
xor ecx, ecx
lea rax, [rdx-1+rax]
mov rdx, r11
lea rdi, [r14+rax*4]
.L5:
mov eax, ecx
mov ecx, DWORD PTR [rdx+4]
cmp r8b, BYTE PTR [rsi]
je .L4
mov eax, DWORD PTR [rdx]
cmp ecx, eax
cmovle eax, ecx
add eax, 1
.L4:
mov DWORD PTR [rdx+4], eax
add rdx, 4
add rsi, 1
cmp rdx, rdi
jne .L5
sub r9d, 1
je .L2
.L14:
sub r11, 4
sub r10, 1
cmp ebx, r9d
jg .L16
.L3:
sub r9d, 1
jmp .L14
.L2:
mov eax, DWORD PTR [r15-4+r12*4]
add rsp, 8
pop rbx
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
.LC0:
.string "Usage: ./test s\n"
.LC1:
.string "%d\n"
main:
sub rsp, 8
cmp edi, 2
jne .L20
mov rdi, QWORD PTR [rsi+8]
call minInsertions
mov edi, OFFSET FLAT:.LC1
mov esi, eax
xor eax, eax
call printf
xor eax, eax
add rsp, 8
ret
.L20:
mov edi, OFFSET FLAT:.LC0
mov edx, 16
mov esi, 1
mov rcx, QWORD PTR stderr[rip]
call fwrite
mov edi, -1
call exit
|
14,111
| 1,312
|
Minimum Insertion Steps to Make a String Palindrome
|
Hard
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline int min(int a, int b)
{
return a < b ? a : b;
}
int minInsertions(char * s){
int i, j, len = strlen(s);
int *dp = malloc(len * sizeof(int));
memset(dp, 0, len * sizeof(int));
for (i = len - 2; i >= 0; i--) {
int left_down = 0;
for (j = i + 1; j < len; j++) {
int down = dp[j];
if (s[i] == s[j]) {
dp[j] = left_down;
} else {
dp[j] = min(down, dp[j - 1]) + 1;
}
left_down = down;
}
}
return dp[len - 1];
}
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: ./test s\n");
exit(-1);
}
printf("%d\n", minInsertions(argv[1]));
return 0;
}
|
x86-64
|
-O3
|
x86-64 gcc 15.2
|
minInsertions:
push r15
push r14
push r13
push r12
push rbp
mov rbp, rdi
push rbx
sub rsp, 8
call strlen
mov esi, 1
movsx r12, eax
mov rbx, rax
lea rdi, [0+r12*4]
call calloc
mov r15, rax
cmp ebx, 1
jle .L2
lea r9d, [rbx-1]
lea r11, [rax-8+r12*4]
lea r10, [rbp-1+r12]
lea r14, [rax+4]
cmp ebx, r9d
jle .L3
.L19:
mov rdx, r10
lea eax, [rbx-1]
movzx edi, BYTE PTR [r10-1]
mov rsi, r10
sub rdx, rbp
sub eax, r9d
lea rax, [rdx-1+rax]
xor edx, edx
lea r8, [r14+rax*4]
mov rax, r11
jmp .L7
.L18:
mov edx, DWORD PTR [rax]
cmp ecx, edx
cmovle edx, ecx
add rax, 4
add edx, 1
mov DWORD PTR [rax], edx
cmp r8, rax
je .L5
.L16:
add rsi, 1
mov edx, ecx
.L7:
mov ecx, DWORD PTR [rax+4]
cmp dil, BYTE PTR [rsi]
jne .L18
mov DWORD PTR [rax+4], edx
add rax, 4
cmp r8, rax
jne .L16
.L5:
sub r9d, 1
je .L2
.L15:
sub r11, 4
sub r10, 1
cmp ebx, r9d
jg .L19
.L3:
sub r9d, 1
jmp .L15
.L2:
mov eax, DWORD PTR [r15-4+r12*4]
add rsp, 8
pop rbx
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
.LC0:
.string "Usage: ./test s\n"
.LC1:
.string "%d\n"
main:
sub rsp, 8
cmp edi, 2
jne .L23
mov rdi, QWORD PTR [rsi+8]
call minInsertions
mov edi, OFFSET FLAT:.LC1
mov esi, eax
xor eax, eax
call printf
xor eax, eax
add rsp, 8
ret
.L23:
mov edi, OFFSET FLAT:.LC0
mov edx, 16
mov esi, 1
mov rcx, QWORD PTR stderr[rip]
call fwrite
mov edi, -1
call exit
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.