index int64 0 66.5k | func_name stringlengths 2 5.36k | func_dep stringlengths 16 2.19k | func stringlengths 8 55.3k | test stringlengths 0 7.07k | opt stringclasses 4
values | language stringclasses 2
values | asm stringlengths 0 45.4k | ida_asm stringlengths 0 44.7k | ida_pseudo stringlengths 0 44.3k | ghidra_asm stringlengths 0 49.1k | ghidra_pseudo stringlengths 0 64.7k |
|---|---|---|---|---|---|---|---|---|---|---|---|
7,782 | func0 | #include <stdio.h>
#include <assert.h>
typedef struct {
int a;
int b;
int c;
int d;
} Tuple;
| Tuple func0(Tuple test_tup1, Tuple test_tup2) {
Tuple res;
res.a = test_tup1.a;
res.b = test_tup1.b;
res = (Tuple){res.a, res.b, test_tup2.a, test_tup2.b};
return res;
}
| int main() {
Tuple t1 = {3, 4};
Tuple t2 = {5, 6};
Tuple result = func0(t1, t2);
assert(result.a == 3 && result.b == 4 && result.c == 5 && result.d == 6);
Tuple t3 = {1, 2};
Tuple t4 = {3, 4};
result = func0(t3, t4);
assert(result.a == 1 && result.b == 2 && result.c == 3 && result.d == 4);
Tuple t5 = {4, 5};
Tuple t6 = {6, 8};
result = func0(t5, t6);
assert(result.a == 4 && result.b == 5 && result.c == 6 && result.d == 8);
printf("All tests passed successfully.\n");
return 0;
}
| O2 | c | func0:
endbr64
mov %rdi,%rax
retq
nopl 0x0(%rax,%rax,1)
| func0:
endbr64
mov rax, rdi
retn | long long func0(long long a1)
{
return a1;
} | func0:
ENDBR64
MOV RAX,RDI
RET | int8 func0(int8 param_1)
{
return param_1;
} |
7,783 | func0 | #include <stdio.h>
#include <assert.h>
typedef struct {
int a;
int b;
int c;
int d;
} Tuple;
| Tuple func0(Tuple test_tup1, Tuple test_tup2) {
Tuple res;
res.a = test_tup1.a;
res.b = test_tup1.b;
res = (Tuple){res.a, res.b, test_tup2.a, test_tup2.b};
return res;
}
| int main() {
Tuple t1 = {3, 4};
Tuple t2 = {5, 6};
Tuple result = func0(t1, t2);
assert(result.a == 3 && result.b == 4 && result.c == 5 && result.d == 6);
Tuple t3 = {1, 2};
Tuple t4 = {3, 4};
result = func0(t3, t4);
assert(result.a == 1 && result.b == 2 && result.c == 3 && result.d == 4);
Tuple t5 = {4, 5};
Tuple t6 = {6, 8};
result = func0(t5, t6);
assert(result.a == 4 && result.b == 5 && result.c == 6 && result.d == 8);
printf("All tests passed successfully.\n");
return 0;
}
| O3 | c | func0:
endbr64
mov %rdi,%rax
retq
nopl 0x0(%rax,%rax,1)
| func0:
endbr64
mov rax, rdi
retn | long long func0(long long a1)
{
return a1;
} | func0:
ENDBR64
MOV RAX,RDI
RET | int8 func0(int8 param_1)
{
return param_1;
} |
7,784 | func0 |
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
| char* func0(char* s, int d) {
int len = strlen(s);
char* tmp = (char*)malloc(len + 1);
for (int i = 0; i < len; i++) {
tmp[i] = s[(i + d) % len];
}
tmp[len] = '\0';
return tmp;
}
| int main() {
assert(strcmp(func0("python", 2), "thonpy") == 0);
assert(strcmp(func0("bigdata", 3), "databig") == 0);
assert(strcmp(func0("hadoop", 1), "adooph") == 0);
printf("All test cases passed.\n");
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x20,%rsp
mov %rdi,-0x18(%rbp)
mov %esi,-0x1c(%rbp)
mov -0x18(%rbp),%rax
mov %rax,%rdi
callq 10a0 <strlen@plt>
mov %eax,-0xc(%rbp)
mov -0xc(%rbp),%eax
add $0x1,%eax
cltq
mov %rax,%rdi
callq 10d0 <malloc@plt>
mov %rax,-0x8(%rbp)
movl $0x0,-0x10(%rbp)
jmp 1236 <func0+0x6d>
mov -0x10(%rbp),%edx
mov -0x1c(%rbp),%eax
add %edx,%eax
cltd
idivl -0xc(%rbp)
mov %edx,%eax
movslq %eax,%rdx
mov -0x18(%rbp),%rax
add %rdx,%rax
mov -0x10(%rbp),%edx
movslq %edx,%rcx
mov -0x8(%rbp),%rdx
add %rcx,%rdx
movzbl (%rax),%eax
mov %al,(%rdx)
addl $0x1,-0x10(%rbp)
mov -0x10(%rbp),%eax
cmp -0xc(%rbp),%eax
jl 1208 <func0+0x3f>
mov -0xc(%rbp),%eax
movslq %eax,%rdx
mov -0x8(%rbp),%rax
add %rdx,%rax
movb $0x0,(%rax)
mov -0x8(%rbp),%rax
leaveq
retq
| func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 20h
mov [rbp+s], rdi
mov [rbp+var_1C], esi
mov rax, [rbp+s]
mov rdi, rax; s
call _strlen
mov [rbp+var_C], eax
mov eax, [rbp+var_C]
add eax, 1
cdqe
mov rdi, rax; size
call _malloc
mov [rbp+var_8], rax
mov [rbp+var_10], 0
jmp short loc_1236
loc_1208:
mov edx, [rbp+var_10]
mov eax, [rbp+var_1C]
add eax, edx
cdq
idiv [rbp+var_C]
mov eax, edx
movsxd rdx, eax
mov rax, [rbp+s]
add rax, rdx
mov edx, [rbp+var_10]
movsxd rcx, edx
mov rdx, [rbp+var_8]
add rdx, rcx
movzx eax, byte ptr [rax]
mov [rdx], al
add [rbp+var_10], 1
loc_1236:
mov eax, [rbp+var_10]
cmp eax, [rbp+var_C]
jl short loc_1208
mov eax, [rbp+var_C]
movsxd rdx, eax
mov rax, [rbp+var_8]
add rax, rdx
mov byte ptr [rax], 0
mov rax, [rbp+var_8]
leave
retn | _BYTE * func0(const char *a1, int a2)
{
int i; // [rsp+10h] [rbp-10h]
int v4; // [rsp+14h] [rbp-Ch]
_BYTE *v5; // [rsp+18h] [rbp-8h]
v4 = strlen(a1);
v5 = malloc(v4 + 1);
for ( i = 0; i < v4; ++i )
v5[i] = a1[(i + a2) % v4];
v5[v4] = 0;
return v5;
} | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x20
MOV qword ptr [RBP + -0x18],RDI
MOV dword ptr [RBP + -0x1c],ESI
MOV RAX,qword ptr [RBP + -0x18]
MOV RDI,RAX
CALL 0x001010a0
MOV dword ptr [RBP + -0xc],EAX
MOV EAX,dword ptr [RBP + -0xc]
ADD EAX,0x1
CDQE
MOV RDI,RAX
CALL 0x001010d0
MOV qword ptr [RBP + -0x8],RAX
MOV dword ptr [RBP + -0x10],0x0
JMP 0x00101236
LAB_00101208:
MOV EDX,dword ptr [RBP + -0x10]
MOV EAX,dword ptr [RBP + -0x1c]
ADD EAX,EDX
CDQ
IDIV dword ptr [RBP + -0xc]
MOV EAX,EDX
MOVSXD RDX,EAX
MOV RAX,qword ptr [RBP + -0x18]
ADD RAX,RDX
MOV EDX,dword ptr [RBP + -0x10]
MOVSXD RCX,EDX
MOV RDX,qword ptr [RBP + -0x8]
ADD RDX,RCX
MOVZX EAX,byte ptr [RAX]
MOV byte ptr [RDX],AL
ADD dword ptr [RBP + -0x10],0x1
LAB_00101236:
MOV EAX,dword ptr [RBP + -0x10]
CMP EAX,dword ptr [RBP + -0xc]
JL 0x00101208
MOV EAX,dword ptr [RBP + -0xc]
MOVSXD RDX,EAX
MOV RAX,qword ptr [RBP + -0x8]
ADD RAX,RDX
MOV byte ptr [RAX],0x0
MOV RAX,qword ptr [RBP + -0x8]
LEAVE
RET | void * func0(char *param_1,int param_2)
{
int iVar1;
size_t sVar2;
void *pvVar3;
int local_18;
sVar2 = strlen(param_1);
iVar1 = (int)sVar2;
pvVar3 = malloc((long)(iVar1 + 1));
for (local_18 = 0; local_18 < iVar1; local_18 = local_18 + 1) {
*(char *)((long)pvVar3 + (long)local_18) = param_1[(param_2 + local_18) % iVar1];
}
*(int *)((long)pvVar3 + (long)iVar1) = 0;
return pvVar3;
} |
7,785 | func0 |
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
| char* func0(char* s, int d) {
int len = strlen(s);
char* tmp = (char*)malloc(len + 1);
for (int i = 0; i < len; i++) {
tmp[i] = s[(i + d) % len];
}
tmp[len] = '\0';
return tmp;
}
| int main() {
assert(strcmp(func0("python", 2), "thonpy") == 0);
assert(strcmp(func0("bigdata", 3), "databig") == 0);
assert(strcmp(func0("hadoop", 1), "adooph") == 0);
printf("All test cases passed.\n");
return 0;
}
| O1 | c | func0:
endbr64
push %r13
push %r12
push %rbp
push %rbx
sub $0x8,%rsp
mov %rdi,%r12
mov %esi,%r13d
mov $0xffffffffffffffff,%rcx
mov $0x0,%eax
repnz scas %es:(%rdi),%al
not %rcx
lea -0x1(%rcx),%rbp
lea 0x1(%rbp),%edi
movslq %edi,%rdi
callq 1090 <malloc@plt>
mov %rax,%r8
test %ebp,%ebp
jle 11f0 <func0+0x67>
mov %ebp,%ebx
lea -0x1(%rbp),%eax
lea 0x1(%r8,%rax,1),%rdi
mov %r8,%rcx
mov %r13d,%esi
sub %r8d,%esi
lea (%rsi,%rcx,1),%eax
cltd
idiv %ebx
movslq %edx,%rdx
movzbl (%r12,%rdx,1),%eax
mov %al,(%rcx)
add $0x1,%rcx
cmp %rdi,%rcx
jne 11d7 <func0+0x4e>
movslq %ebp,%rbp
movb $0x0,(%r8,%rbp,1)
mov %r8,%rax
add $0x8,%rsp
pop %rbx
pop %rbp
pop %r12
pop %r13
retq
| func0:
endbr64
push r13
push r12
push rbp
push rbx
sub rsp, 8
mov rbp, rdi
mov r13d, esi
call _strlen
mov r12, rax
mov ebx, eax
lea edi, [rax+1]
movsxd rdi, edi
call _malloc
mov r8, rax
test r12d, r12d
jle short loc_1226
lea eax, [r12-1]
lea rdi, [r8+rax+1]
mov rcx, r8
mov esi, r13d
sub esi, r8d
loc_120D:
lea eax, [rsi+rcx]
cdq
idiv ebx
movsxd rdx, edx
movzx eax, byte ptr [rbp+rdx+0]
mov [rcx], al
add rcx, 1
cmp rcx, rdi
jnz short loc_120D
loc_1226:
movsxd r12, r12d
mov byte ptr [r8+r12], 0
mov rax, r8
add rsp, 8
pop rbx
pop rbp
pop r12
pop r13
retn | long long func0(long long a1, int a2)
{
int v2; // r12d
long long v3; // r8
_BYTE *v4; // rcx
v2 = strlen();
v3 = malloc(v2 + 1);
if ( v2 > 0 )
{
v4 = (_BYTE *)v3;
do
{
*v4 = *(_BYTE *)(a1 + (a2 - (int)v3 + (int)v4) % v2);
++v4;
}
while ( v4 != (_BYTE *)(v3 + (unsigned int)(v2 - 1) + 1) );
}
*(_BYTE *)(v3 + v2) = 0;
return v3;
} | func0:
ENDBR64
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x8
MOV RBP,RDI
MOV R13D,ESI
CALL 0x001010a0
MOV R12,RAX
MOV EBX,EAX
LEA EDI,[RAX + 0x1]
MOVSXD RDI,EDI
CALL 0x001010d0
MOV R8,RAX
TEST R12D,R12D
JLE 0x00101226
LEA EAX,[R12 + -0x1]
LEA RDI,[R8 + RAX*0x1 + 0x1]
MOV RCX,R8
MOV ESI,R13D
SUB ESI,R8D
LAB_0010120d:
LEA EAX,[RSI + RCX*0x1]
CDQ
IDIV EBX
MOVSXD RDX,EDX
MOVZX EAX,byte ptr [RBP + RDX*0x1]
MOV byte ptr [RCX],AL
ADD RCX,0x1
CMP RCX,RDI
JNZ 0x0010120d
LAB_00101226:
MOVSXD R12,R12D
MOV byte ptr [R8 + R12*0x1],0x0
MOV RAX,R8
ADD RSP,0x8
POP RBX
POP RBP
POP R12
POP R13
RET | char * func0(char *param_1,int param_2)
{
int iVar1;
size_t sVar2;
char *pcVar3;
char *pcVar4;
sVar2 = strlen(param_1);
iVar1 = (int)sVar2;
pcVar3 = (char *)malloc((long)(iVar1 + 1));
if (0 < iVar1) {
pcVar4 = pcVar3;
do {
*pcVar4 = param_1[((param_2 - (int)pcVar3) + (int)pcVar4) % iVar1];
pcVar4 = pcVar4 + 1;
} while (pcVar4 != pcVar3 + (ulong)(iVar1 - 1) + 1);
}
pcVar3[iVar1] = '\0';
return pcVar3;
} |
7,786 | func0 |
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
| char* func0(char* s, int d) {
int len = strlen(s);
char* tmp = (char*)malloc(len + 1);
for (int i = 0; i < len; i++) {
tmp[i] = s[(i + d) % len];
}
tmp[len] = '\0';
return tmp;
}
| int main() {
assert(strcmp(func0("python", 2), "thonpy") == 0);
assert(strcmp(func0("bigdata", 3), "databig") == 0);
assert(strcmp(func0("hadoop", 1), "adooph") == 0);
printf("All test cases passed.\n");
return 0;
}
| O2 | c | func0:
endbr64
push %r13
push %r12
mov %rdi,%r12
push %rbp
mov %esi,%ebp
push %rbx
sub $0x8,%rsp
callq 1090 <strlen@plt>
lea 0x1(%rax),%edi
mov %rax,%r13
mov %eax,%ebx
movslq %edi,%rdi
callq 10b0 <malloc@plt>
mov %rax,%r8
test %r13d,%r13d
jle 1312 <func0+0x62>
lea -0x1(%r13),%eax
mov %ebp,%esi
mov %r8,%rcx
lea 0x1(%r8,%rax,1),%rdi
sub %r8d,%esi
nopl 0x0(%rax)
lea (%rsi,%rcx,1),%eax
add $0x1,%rcx
cltd
idiv %ebx
movslq %edx,%rdx
movzbl (%r12,%rdx,1),%eax
mov %al,-0x1(%rcx)
cmp %rdi,%rcx
jne 12f8 <func0+0x48>
movslq %r13d,%r13
mov %r8,%rax
movb $0x0,(%r8,%r13,1)
add $0x8,%rsp
pop %rbx
pop %rbp
pop %r12
pop %r13
retq
nopl 0x0(%rax,%rax,1)
| func0:
endbr64
push r13
push r12
mov r12, rdi
push rbp
mov ebp, esi
push rbx
sub rsp, 8
call _strlen
lea edi, [rax+1]
mov r13, rax
mov ebx, eax
movsxd rdi, edi
call _malloc
mov r8, rax
test r13d, r13d
jle short loc_1322
lea eax, [r13-1]
mov esi, ebp
mov rcx, r8
lea rdi, [r8+rax+1]
sub esi, r8d
nop dword ptr [rax+00000000h]
loc_1308:
lea eax, [rsi+rcx]
add rcx, 1
cdq
idiv ebx
movsxd rdx, edx
movzx eax, byte ptr [r12+rdx]
mov [rcx-1], al
cmp rcx, rdi
jnz short loc_1308
loc_1322:
movsxd r13, r13d
mov rax, r8
mov byte ptr [r8+r13], 0
add rsp, 8
pop rbx
pop rbp
pop r12
pop r13
retn | long long func0(long long a1, int a2)
{
int v2; // r13d
long long v3; // r8
long long v4; // rcx
int v5; // eax
long long result; // rax
v2 = strlen();
v3 = malloc(v2 + 1);
if ( v2 > 0 )
{
v4 = v3;
do
{
v5 = a2 - v3 + v4++;
*(_BYTE *)(v4 - 1) = *(_BYTE *)(a1 + v5 % v2);
}
while ( v4 != v3 + (unsigned int)(v2 - 1) + 1 );
}
result = v3;
*(_BYTE *)(v3 + v2) = 0;
return result;
} | func0:
ENDBR64
PUSH R13
PUSH R12
MOV R12,RDI
PUSH RBP
MOV EBP,ESI
PUSH RBX
SUB RSP,0x8
CALL 0x001010a0
LEA EDI,[RAX + 0x1]
MOV R13,RAX
MOV EBX,EAX
MOVSXD RDI,EDI
CALL 0x001010d0
MOV R8,RAX
TEST R13D,R13D
JLE 0x00101322
LEA EAX,[R13 + -0x1]
MOV ESI,EBP
MOV RCX,R8
LEA RDI,[R8 + RAX*0x1 + 0x1]
SUB ESI,R8D
NOP dword ptr [RAX]
LAB_00101308:
LEA EAX,[RSI + RCX*0x1]
ADD RCX,0x1
CDQ
IDIV EBX
MOVSXD RDX,EDX
MOVZX EAX,byte ptr [R12 + RDX*0x1]
MOV byte ptr [RCX + -0x1],AL
CMP RCX,RDI
JNZ 0x00101308
LAB_00101322:
MOVSXD R13,R13D
MOV RAX,R8
MOV byte ptr [R8 + R13*0x1],0x0
ADD RSP,0x8
POP RBX
POP RBP
POP R12
POP R13
RET | char * func0(char *param_1,int param_2)
{
int iVar1;
size_t sVar2;
char *pcVar3;
char *pcVar4;
char *pcVar5;
sVar2 = strlen(param_1);
iVar1 = (int)sVar2;
pcVar3 = (char *)malloc((long)(iVar1 + 1));
if (0 < iVar1) {
pcVar4 = pcVar3;
do {
pcVar5 = pcVar4 + 1;
*pcVar4 = param_1[((param_2 - (int)pcVar3) + (int)pcVar4) % iVar1];
pcVar4 = pcVar5;
} while (pcVar5 != pcVar3 + (ulong)(iVar1 - 1) + 1);
}
pcVar3[iVar1] = '\0';
return pcVar3;
} |
7,787 | func0 |
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
| char* func0(char* s, int d) {
int len = strlen(s);
char* tmp = (char*)malloc(len + 1);
for (int i = 0; i < len; i++) {
tmp[i] = s[(i + d) % len];
}
tmp[len] = '\0';
return tmp;
}
| int main() {
assert(strcmp(func0("python", 2), "thonpy") == 0);
assert(strcmp(func0("bigdata", 3), "databig") == 0);
assert(strcmp(func0("hadoop", 1), "adooph") == 0);
printf("All test cases passed.\n");
return 0;
}
| O3 | c | func0:
endbr64
push %r13
push %r12
mov %rdi,%r12
push %rbp
mov %esi,%ebp
push %rbx
sub $0x8,%rsp
callq 1090 <strlen@plt>
lea 0x1(%rax),%edi
mov %rax,%r13
mov %eax,%ebx
movslq %edi,%rdi
callq 10b0 <malloc@plt>
mov %rax,%r8
test %r13d,%r13d
jle 1312 <func0+0x62>
lea -0x1(%r13),%eax
mov %ebp,%esi
mov %r8,%rcx
lea 0x1(%r8,%rax,1),%rdi
sub %r8d,%esi
nopl 0x0(%rax)
lea (%rsi,%rcx,1),%eax
add $0x1,%rcx
cltd
idiv %ebx
movslq %edx,%rdx
movzbl (%r12,%rdx,1),%eax
mov %al,-0x1(%rcx)
cmp %rcx,%rdi
jne 12f8 <func0+0x48>
movslq %r13d,%r13
mov %r8,%rax
movb $0x0,(%r8,%r13,1)
add $0x8,%rsp
pop %rbx
pop %rbp
pop %r12
pop %r13
retq
nopl 0x0(%rax,%rax,1)
| func0:
endbr64
push r13
push r12
mov r12, rdi
push rbp
mov ebp, esi
push rbx
sub rsp, 8
call _strlen
lea edi, [rax+1]
mov r13, rax
mov ebx, eax
movsxd rdi, edi; size
call _malloc
mov r8, rax
test r13d, r13d
jle short loc_1322
lea eax, [r13-1]
mov esi, ebp
mov rcx, r8
lea rdi, [r8+rax+1]
sub esi, r8d
nop dword ptr [rax+00000000h]
loc_1308:
lea eax, [rsi+rcx]
add rcx, 1
cdq
idiv ebx
movsxd rdx, edx
movzx eax, byte ptr [r12+rdx]
mov [rcx-1], al
cmp rcx, rdi
jnz short loc_1308
loc_1322:
movsxd r13, r13d
mov rax, r8
mov byte ptr [r8+r13], 0
add rsp, 8
pop rbx
pop rbp
pop r12
pop r13
retn | char * func0(const char *a1, int a2)
{
int v2; // r13d
char *v3; // r8
char *v4; // rcx
int v5; // eax
char *result; // rax
v2 = strlen(a1);
v3 = (char *)malloc(v2 + 1);
if ( v2 > 0 )
{
v4 = v3;
do
{
v5 = a2 - (_DWORD)v3 + (_DWORD)v4++;
*(v4 - 1) = a1[v5 % v2];
}
while ( v4 != &v3[v2 - 1 + 1] );
}
result = v3;
v3[v2] = 0;
return result;
} | func0:
ENDBR64
PUSH R13
PUSH R12
MOV R12,RDI
PUSH RBP
MOV EBP,ESI
PUSH RBX
SUB RSP,0x8
CALL 0x001010a0
LEA EDI,[RAX + 0x1]
MOV R13,RAX
MOV EBX,EAX
MOVSXD RDI,EDI
CALL 0x001010d0
MOV R8,RAX
TEST R13D,R13D
JLE 0x00101322
LEA EAX,[R13 + -0x1]
MOV ESI,EBP
MOV RCX,R8
LEA RDI,[R8 + RAX*0x1 + 0x1]
SUB ESI,R8D
NOP dword ptr [RAX]
LAB_00101308:
LEA EAX,[RSI + RCX*0x1]
ADD RCX,0x1
CDQ
IDIV EBX
MOVSXD RDX,EDX
MOVZX EAX,byte ptr [R12 + RDX*0x1]
MOV byte ptr [RCX + -0x1],AL
CMP RCX,RDI
JNZ 0x00101308
LAB_00101322:
MOVSXD R13,R13D
MOV RAX,R8
MOV byte ptr [R8 + R13*0x1],0x0
ADD RSP,0x8
POP RBX
POP RBP
POP R12
POP R13
RET | char * func0(char *param_1,int param_2)
{
int iVar1;
size_t sVar2;
char *pcVar3;
char *pcVar4;
char *pcVar5;
sVar2 = strlen(param_1);
iVar1 = (int)sVar2;
pcVar3 = (char *)malloc((long)(iVar1 + 1));
if (0 < iVar1) {
pcVar4 = pcVar3;
do {
pcVar5 = pcVar4 + 1;
*pcVar4 = param_1[((param_2 - (int)pcVar3) + (int)pcVar4) % iVar1];
pcVar4 = pcVar5;
} while (pcVar5 != pcVar3 + (ulong)(iVar1 - 1) + 1);
}
pcVar3[iVar1] = '\0';
return pcVar3;
} |
7,788 | func0 |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
| int func0(int** A, int rows) {
int* memo = (int*)malloc(rows * sizeof(int));
int n = rows - 1;
for (int i = 0; i < rows; i++) {
memo[i] = A[n][i];
}
for (int i = rows - 2; i >= 0; i--) {
for (int j = 0; j <= i; j++) {
int minValue = memo[j] < memo[j + 1] ? memo[j] : memo[j + 1];
memo[j] = A[i][j] + minValue;
}
}
int result = memo[0];
free(memo);
return result;
}
| int main() {
int a1[3][3] = {{2}, {3, 9}, {1, 6, 7}};
int a2[3][3] = {{2}, {3, 7}, {8, 5, 6}};
int a3[3][3] = {{3}, {6, 4}, {5, 2, 7}};
int* pa1[3] = {a1[0], a1[1], a1[2]};
int* pa2[3] = {a2[0], a2[1], a2[2]};
int* pa3[3] = {a3[0], a3[1], a3[2]};
assert(func0(pa1, 3) == 6);
assert(func0(pa2, 3) == 10);
assert(func0(pa3, 3) == 9);
printf("All tests passed successfully.\n");
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x30,%rsp
mov %rdi,-0x28(%rbp)
mov %esi,-0x2c(%rbp)
mov -0x2c(%rbp),%eax
cltq
shl $0x2,%rax
mov %rax,%rdi
callq 10d0 <malloc@plt>
mov %rax,-0x8(%rbp)
mov -0x2c(%rbp),%eax
sub $0x1,%eax
mov %eax,-0x14(%rbp)
movl $0x0,-0x20(%rbp)
jmp 1244 <func0+0x7b>
mov -0x14(%rbp),%eax
cltq
lea 0x0(,%rax,8),%rdx
mov -0x28(%rbp),%rax
add %rdx,%rax
mov (%rax),%rax
mov -0x20(%rbp),%edx
movslq %edx,%rdx
shl $0x2,%rdx
add %rdx,%rax
mov -0x20(%rbp),%edx
movslq %edx,%rdx
lea 0x0(,%rdx,4),%rcx
mov -0x8(%rbp),%rdx
add %rcx,%rdx
mov (%rax),%eax
mov %eax,(%rdx)
addl $0x1,-0x20(%rbp)
mov -0x20(%rbp),%eax
cmp -0x2c(%rbp),%eax
jl 1203 <func0+0x3a>
mov -0x2c(%rbp),%eax
sub $0x2,%eax
mov %eax,-0x1c(%rbp)
jmpq 12f0 <func0+0x127>
movl $0x0,-0x18(%rbp)
jmp 12e0 <func0+0x117>
mov -0x18(%rbp),%eax
cltq
add $0x1,%rax
lea 0x0(,%rax,4),%rdx
mov -0x8(%rbp),%rax
add %rdx,%rax
mov (%rax),%edx
mov -0x18(%rbp),%eax
cltq
lea 0x0(,%rax,4),%rcx
mov -0x8(%rbp),%rax
add %rcx,%rax
mov (%rax),%eax
cmp %eax,%edx
cmovle %edx,%eax
mov %eax,-0xc(%rbp)
mov -0x1c(%rbp),%eax
cltq
lea 0x0(,%rax,8),%rdx
mov -0x28(%rbp),%rax
add %rdx,%rax
mov (%rax),%rax
mov -0x18(%rbp),%edx
movslq %edx,%rdx
shl $0x2,%rdx
add %rdx,%rax
mov (%rax),%ecx
mov -0x18(%rbp),%eax
cltq
lea 0x0(,%rax,4),%rdx
mov -0x8(%rbp),%rax
add %rdx,%rax
mov -0xc(%rbp),%edx
add %ecx,%edx
mov %edx,(%rax)
addl $0x1,-0x18(%rbp)
mov -0x18(%rbp),%eax
cmp -0x1c(%rbp),%eax
jle 1263 <func0+0x9a>
subl $0x1,-0x1c(%rbp)
cmpl $0x0,-0x1c(%rbp)
jns 125a <func0+0x91>
mov -0x8(%rbp),%rax
mov (%rax),%eax
mov %eax,-0x10(%rbp)
mov -0x8(%rbp),%rax
mov %rax,%rdi
callq 1090 <free@plt>
mov -0x10(%rbp),%eax
leaveq
retq
| func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 30h
mov [rbp+var_28], rdi
mov [rbp+var_2C], esi
mov eax, [rbp+var_2C]
cdqe
shl rax, 2
mov rdi, rax; size
call _malloc
mov [rbp+ptr], rax
mov eax, [rbp+var_2C]
sub eax, 1
mov [rbp+var_14], eax
mov [rbp+var_20], 0
jmp short loc_1244
loc_1203:
mov eax, [rbp+var_14]
cdqe
lea rdx, ds:0[rax*8]
mov rax, [rbp+var_28]
add rax, rdx
mov rax, [rax]
mov edx, [rbp+var_20]
movsxd rdx, edx
shl rdx, 2
add rax, rdx
mov edx, [rbp+var_20]
movsxd rdx, edx
lea rcx, ds:0[rdx*4]
mov rdx, [rbp+ptr]
add rdx, rcx
mov eax, [rax]
mov [rdx], eax
add [rbp+var_20], 1
loc_1244:
mov eax, [rbp+var_20]
cmp eax, [rbp+var_2C]
jl short loc_1203
mov eax, [rbp+var_2C]
sub eax, 2
mov [rbp+var_1C], eax
jmp loc_12F0
loc_125A:
mov [rbp+var_18], 0
jmp short loc_12E0
loc_1263:
mov eax, [rbp+var_18]
cdqe
add rax, 1
lea rdx, ds:0[rax*4]
mov rax, [rbp+ptr]
add rax, rdx
mov edx, [rax]
mov eax, [rbp+var_18]
cdqe
lea rcx, ds:0[rax*4]
mov rax, [rbp+ptr]
add rax, rcx
mov eax, [rax]
cmp edx, eax
cmovle eax, edx
mov [rbp+var_C], eax
mov eax, [rbp+var_1C]
cdqe
lea rdx, ds:0[rax*8]
mov rax, [rbp+var_28]
add rax, rdx
mov rax, [rax]
mov edx, [rbp+var_18]
movsxd rdx, edx
shl rdx, 2
add rax, rdx
mov ecx, [rax]
mov eax, [rbp+var_18]
cdqe
lea rdx, ds:0[rax*4]
mov rax, [rbp+ptr]
add rax, rdx
mov edx, [rbp+var_C]
add edx, ecx
mov [rax], edx
add [rbp+var_18], 1
loc_12E0:
mov eax, [rbp+var_18]
cmp eax, [rbp+var_1C]
jle loc_1263
sub [rbp+var_1C], 1
loc_12F0:
cmp [rbp+var_1C], 0
jns loc_125A
mov rax, [rbp+ptr]
mov eax, [rax]
mov [rbp+var_10], eax
mov rax, [rbp+ptr]
mov rdi, rax; ptr
call _free
mov eax, [rbp+var_10]
leave
retn | long long func0(long long a1, int a2)
{
int v2; // eax
int i; // [rsp+10h] [rbp-20h]
int j; // [rsp+14h] [rbp-1Ch]
int k; // [rsp+18h] [rbp-18h]
unsigned int v7; // [rsp+20h] [rbp-10h]
unsigned int *ptr; // [rsp+28h] [rbp-8h]
ptr = (unsigned int *)malloc(4LL * a2);
for ( i = 0; i < a2; ++i )
ptr[i] = *(_DWORD *)(4LL * i + *(_QWORD *)(8LL * (a2 - 1) + a1));
for ( j = a2 - 2; j >= 0; --j )
{
for ( k = 0; k <= j; ++k )
{
v2 = ptr[k];
if ( (int)ptr[k + 1] <= v2 )
v2 = ptr[k + 1];
ptr[k] = *(_DWORD *)(4LL * k + *(_QWORD *)(8LL * j + a1)) + v2;
}
}
v7 = *ptr;
free(ptr);
return v7;
} | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x30
MOV qword ptr [RBP + -0x28],RDI
MOV dword ptr [RBP + -0x2c],ESI
MOV EAX,dword ptr [RBP + -0x2c]
CDQE
SHL RAX,0x2
MOV RDI,RAX
CALL 0x001010d0
MOV qword ptr [RBP + -0x8],RAX
MOV EAX,dword ptr [RBP + -0x2c]
SUB EAX,0x1
MOV dword ptr [RBP + -0x14],EAX
MOV dword ptr [RBP + -0x20],0x0
JMP 0x00101244
LAB_00101203:
MOV EAX,dword ptr [RBP + -0x14]
CDQE
LEA RDX,[RAX*0x8]
MOV RAX,qword ptr [RBP + -0x28]
ADD RAX,RDX
MOV RAX,qword ptr [RAX]
MOV EDX,dword ptr [RBP + -0x20]
MOVSXD RDX,EDX
SHL RDX,0x2
ADD RAX,RDX
MOV EDX,dword ptr [RBP + -0x20]
MOVSXD RDX,EDX
LEA RCX,[RDX*0x4]
MOV RDX,qword ptr [RBP + -0x8]
ADD RDX,RCX
MOV EAX,dword ptr [RAX]
MOV dword ptr [RDX],EAX
ADD dword ptr [RBP + -0x20],0x1
LAB_00101244:
MOV EAX,dword ptr [RBP + -0x20]
CMP EAX,dword ptr [RBP + -0x2c]
JL 0x00101203
MOV EAX,dword ptr [RBP + -0x2c]
SUB EAX,0x2
MOV dword ptr [RBP + -0x1c],EAX
JMP 0x001012f0
LAB_0010125a:
MOV dword ptr [RBP + -0x18],0x0
JMP 0x001012e0
LAB_00101263:
MOV EAX,dword ptr [RBP + -0x18]
CDQE
ADD RAX,0x1
LEA RDX,[RAX*0x4]
MOV RAX,qword ptr [RBP + -0x8]
ADD RAX,RDX
MOV EDX,dword ptr [RAX]
MOV EAX,dword ptr [RBP + -0x18]
CDQE
LEA RCX,[RAX*0x4]
MOV RAX,qword ptr [RBP + -0x8]
ADD RAX,RCX
MOV EAX,dword ptr [RAX]
CMP EDX,EAX
CMOVLE EAX,EDX
MOV dword ptr [RBP + -0xc],EAX
MOV EAX,dword ptr [RBP + -0x1c]
CDQE
LEA RDX,[RAX*0x8]
MOV RAX,qword ptr [RBP + -0x28]
ADD RAX,RDX
MOV RAX,qword ptr [RAX]
MOV EDX,dword ptr [RBP + -0x18]
MOVSXD RDX,EDX
SHL RDX,0x2
ADD RAX,RDX
MOV ECX,dword ptr [RAX]
MOV EAX,dword ptr [RBP + -0x18]
CDQE
LEA RDX,[RAX*0x4]
MOV RAX,qword ptr [RBP + -0x8]
ADD RAX,RDX
MOV EDX,dword ptr [RBP + -0xc]
ADD EDX,ECX
MOV dword ptr [RAX],EDX
ADD dword ptr [RBP + -0x18],0x1
LAB_001012e0:
MOV EAX,dword ptr [RBP + -0x18]
CMP EAX,dword ptr [RBP + -0x1c]
JLE 0x00101263
SUB dword ptr [RBP + -0x1c],0x1
LAB_001012f0:
CMP dword ptr [RBP + -0x1c],0x0
JNS 0x0010125a
MOV RAX,qword ptr [RBP + -0x8]
MOV EAX,dword ptr [RAX]
MOV dword ptr [RBP + -0x10],EAX
MOV RAX,qword ptr [RBP + -0x8]
MOV RDI,RAX
CALL 0x00101090
MOV EAX,dword ptr [RBP + -0x10]
LEAVE
RET | int4 func0(long param_1,int param_2)
{
int4 uVar1;
int iVar2;
int4 *__ptr;
int local_28;
int local_24;
int local_20;
__ptr = (int4 *)malloc((long)param_2 << 2);
for (local_28 = 0; local_28 < param_2; local_28 = local_28 + 1) {
__ptr[local_28] =
*(int4 *)(*(long *)(param_1 + (long)(param_2 + -1) * 8) + (long)local_28 * 4);
}
for (local_24 = param_2 + -2; -1 < local_24; local_24 = local_24 + -1) {
for (local_20 = 0; local_20 <= local_24; local_20 = local_20 + 1) {
iVar2 = __ptr[local_20];
if ((int)__ptr[(long)local_20 + 1] <= (int)__ptr[local_20]) {
iVar2 = __ptr[(long)local_20 + 1];
}
__ptr[local_20] =
iVar2 + *(int *)(*(long *)(param_1 + (long)local_24 * 8) + (long)local_20 * 4);
}
}
uVar1 = *__ptr;
free(__ptr);
return uVar1;
} |
7,789 | func0 |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
| int func0(int** A, int rows) {
int* memo = (int*)malloc(rows * sizeof(int));
int n = rows - 1;
for (int i = 0; i < rows; i++) {
memo[i] = A[n][i];
}
for (int i = rows - 2; i >= 0; i--) {
for (int j = 0; j <= i; j++) {
int minValue = memo[j] < memo[j + 1] ? memo[j] : memo[j + 1];
memo[j] = A[i][j] + minValue;
}
}
int result = memo[0];
free(memo);
return result;
}
| int main() {
int a1[3][3] = {{2}, {3, 9}, {1, 6, 7}};
int a2[3][3] = {{2}, {3, 7}, {8, 5, 6}};
int a3[3][3] = {{3}, {6, 4}, {5, 2, 7}};
int* pa1[3] = {a1[0], a1[1], a1[2]};
int* pa2[3] = {a2[0], a2[1], a2[2]};
int* pa3[3] = {a3[0], a3[1], a3[2]};
assert(func0(pa1, 3) == 6);
assert(func0(pa2, 3) == 10);
assert(func0(pa3, 3) == 9);
printf("All tests passed successfully.\n");
return 0;
}
| O1 | c | func0:
endbr64
push %rbp
push %rbx
sub $0x8,%rsp
mov %rdi,%rbx
mov %esi,%ebp
movslq %esi,%rdi
shl $0x2,%rdi
callq 10d0 <malloc@plt>
mov %rax,%rdi
test %ebp,%ebp
jle 120e <func0+0x45>
lea -0x1(%rbp),%eax
cltq
mov (%rbx,%rax,8),%rsi
lea -0x1(%rbp),%ecx
mov $0x0,%eax
mov (%rsi,%rax,4),%edx
mov %edx,(%rdi,%rax,4)
mov %rax,%rdx
add $0x1,%rax
cmp %rcx,%rdx
jne 11fc <func0+0x33>
mov %ebp,%r8d
sub $0x2,%r8d
js 125b <func0+0x92>
movslq %r8d,%r8
jmp 1254 <func0+0x8b>
mov (%rbx,%r8,8),%rsi
mov %r8d,%eax
lea 0x4(,%rax,4),%rax
mov $0x0,%edx
mov (%rdi,%rdx,1),%ecx
cmp %ecx,0x4(%rdi,%rdx,1)
cmovle 0x4(%rdi,%rdx,1),%ecx
add (%rsi,%rdx,1),%ecx
mov %ecx,(%rdi,%rdx,1)
add $0x4,%rdx
cmp %rax,%rdx
jne 1230 <func0+0x67>
sub $0x1,%r8
test %r8d,%r8d
js 125b <func0+0x92>
test %r8d,%r8d
jns 121c <func0+0x53>
jmp 124b <func0+0x82>
mov (%rdi),%ebx
callq 1090 <free@plt>
mov %ebx,%eax
add $0x8,%rsp
pop %rbx
pop %rbp
retq
| func0:
endbr64
push rbp
push rbx
sub rsp, 8
mov rbx, rdi
mov ebp, esi
movsxd rdi, esi
shl rdi, 2
call _malloc
mov rdi, rax
test ebp, ebp
jle short loc_120A
lea eax, [rbp-1]
cdqe
mov rsi, [rbx+rax*8]
mov ecx, ebp
mov eax, 0
loc_11FB:
mov edx, [rsi+rax*4]
mov [rdi+rax*4], edx
add rax, 1
cmp rax, rcx
jnz short loc_11FB
loc_120A:
sub ebp, 2
js short loc_1254
movsxd r9, ebp
jmp short loc_124D
loc_1214:
mov r8, [rbx+r9*8]
mov eax, r9d
lea rsi, ds:4[rax*4]
mov eax, 0
loc_1228:
mov edx, [rdi+rax+4]
mov ecx, [rdi+rax]
cmp edx, ecx
cmovg edx, ecx
add edx, [r8+rax]
mov [rdi+rax], edx
add rax, 4
cmp rax, rsi
jnz short loc_1228
loc_1244:
sub r9, 1
test r9d, r9d
js short loc_1254
loc_124D:
test r9d, r9d
jns short loc_1214
jmp short loc_1244
loc_1254:
mov ebx, [rdi]
call _free
mov eax, ebx
add rsp, 8
pop rbx
pop rbp
retn | long long func0(long long a1, int a2)
{
unsigned int *v4; // rdi
long long v5; // rsi
long long v6; // rax
int v7; // ebp
long long v8; // r9
long long v9; // r8
unsigned long long v10; // rax
int v11; // edx
unsigned int v12; // ebx
v4 = (unsigned int *)malloc(4LL * a2);
if ( a2 > 0 )
{
v5 = *(_QWORD *)(a1 + 8LL * (a2 - 1));
v6 = 0LL;
do
{
v4[v6] = *(_DWORD *)(v5 + 4 * v6);
++v6;
}
while ( v6 != a2 );
}
v7 = a2 - 2;
if ( v7 >= 0 )
{
v8 = v7;
do
{
v9 = *(_QWORD *)(a1 + 8 * v8);
v10 = 0LL;
do
{
v11 = v4[v10 / 4 + 1];
if ( v11 > (int)v4[v10 / 4] )
v11 = v4[v10 / 4];
v4[v10 / 4] = *(_DWORD *)(v9 + v10) + v11;
v10 += 4LL;
}
while ( v10 != 4LL * (unsigned int)v8 + 4 );
--v8;
}
while ( (int)v8 >= 0 );
}
v12 = *v4;
free();
return v12;
} | func0:
ENDBR64
PUSH RBP
PUSH RBX
SUB RSP,0x8
MOV RBX,RDI
MOV EBP,ESI
MOVSXD RDI,ESI
SHL RDI,0x2
CALL 0x001010d0
MOV RDI,RAX
TEST EBP,EBP
JLE 0x0010120a
LEA EAX,[RBP + -0x1]
CDQE
MOV RSI,qword ptr [RBX + RAX*0x8]
MOV ECX,EBP
MOV EAX,0x0
LAB_001011fb:
MOV EDX,dword ptr [RSI + RAX*0x4]
MOV dword ptr [RDI + RAX*0x4],EDX
ADD RAX,0x1
CMP RAX,RCX
JNZ 0x001011fb
LAB_0010120a:
SUB EBP,0x2
JS 0x00101254
MOVSXD R9,EBP
JMP 0x0010124d
LAB_00101214:
MOV R8,qword ptr [RBX + R9*0x8]
MOV EAX,R9D
LEA RSI,[0x4 + RAX*0x4]
MOV EAX,0x0
LAB_00101228:
MOV EDX,dword ptr [RDI + RAX*0x1 + 0x4]
MOV ECX,dword ptr [RDI + RAX*0x1]
CMP EDX,ECX
CMOVG EDX,ECX
ADD EDX,dword ptr [R8 + RAX*0x1]
MOV dword ptr [RDI + RAX*0x1],EDX
ADD RAX,0x4
CMP RAX,RSI
JNZ 0x00101228
LAB_00101244:
SUB R9,0x1
TEST R9D,R9D
JS 0x00101254
LAB_0010124d:
TEST R9D,R9D
JNS 0x00101214
JMP 0x00101244
LAB_00101254:
MOV EBX,dword ptr [RDI]
CALL 0x00101090
MOV EAX,EBX
ADD RSP,0x8
POP RBX
POP RBP
RET | int4 func0(long param_1,uint param_2)
{
int4 uVar1;
long lVar2;
int4 *__ptr;
ulong uVar3;
long lVar4;
int iVar5;
__ptr = (int4 *)malloc((long)(int)param_2 << 2);
if (0 < (int)param_2) {
lVar2 = *(long *)(param_1 + (long)(int)(param_2 - 1) * 8);
uVar3 = 0;
do {
__ptr[uVar3] = *(int4 *)(lVar2 + uVar3 * 4);
uVar3 = uVar3 + 1;
} while (uVar3 != param_2);
}
if (-1 < (int)(param_2 - 2)) {
uVar3 = (ulong)(int)(param_2 - 2);
do {
if (-1 < (int)uVar3) {
lVar2 = *(long *)(param_1 + uVar3 * 8);
lVar4 = 0;
do {
iVar5 = *(int *)((long)__ptr + lVar4 + 4);
if (*(int *)((long)__ptr + lVar4) < iVar5) {
iVar5 = *(int *)((long)__ptr + lVar4);
}
*(int *)((long)__ptr + lVar4) = iVar5 + *(int *)(lVar2 + lVar4);
lVar4 = lVar4 + 4;
} while (lVar4 != (uVar3 & 0xffffffff) * 4 + 4);
}
uVar3 = uVar3 - 1;
} while (-1 < (int)uVar3);
}
uVar1 = *__ptr;
free(__ptr);
return uVar1;
} |
7,790 | func0 |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
| int func0(int** A, int rows) {
int* memo = (int*)malloc(rows * sizeof(int));
int n = rows - 1;
for (int i = 0; i < rows; i++) {
memo[i] = A[n][i];
}
for (int i = rows - 2; i >= 0; i--) {
for (int j = 0; j <= i; j++) {
int minValue = memo[j] < memo[j + 1] ? memo[j] : memo[j + 1];
memo[j] = A[i][j] + minValue;
}
}
int result = memo[0];
free(memo);
return result;
}
| int main() {
int a1[3][3] = {{2}, {3, 9}, {1, 6, 7}};
int a2[3][3] = {{2}, {3, 7}, {8, 5, 6}};
int a3[3][3] = {{3}, {6, 4}, {5, 2, 7}};
int* pa1[3] = {a1[0], a1[1], a1[2]};
int* pa2[3] = {a2[0], a2[1], a2[2]};
int* pa3[3] = {a3[0], a3[1], a3[2]};
assert(func0(pa1, 3) == 6);
assert(func0(pa2, 3) == 10);
assert(func0(pa3, 3) == 9);
printf("All tests passed successfully.\n");
return 0;
}
| O2 | c | func0:
endbr64
push %r12
push %rbp
mov %rdi,%rbp
movslq %esi,%rdi
push %rbx
mov %rdi,%rbx
shl $0x2,%rdi
callq 10d0 <malloc@plt>
mov %rax,%rdi
test %ebx,%ebx
jle 1452 <func0+0x42>
lea -0x1(%rbx),%ecx
movslq %ecx,%rax
mov %ecx,%ecx
mov 0x0(%rbp,%rax,8),%rsi
xor %eax,%eax
mov (%rsi,%rax,4),%edx
mov %edx,(%rdi,%rax,4)
mov %rax,%rdx
add $0x1,%rax
cmp %rdx,%rcx
jne 1440 <func0+0x30>
mov %ebx,%eax
sub $0x2,%eax
js 1492 <func0+0x82>
cltq
nopl 0x0(%rax,%rax,1)
mov 0x0(%rbp,%rax,8),%rsi
xor %edx,%edx
nopw 0x0(%rax,%rax,1)
mov (%rdi,%rdx,4),%ecx
cmp %ecx,0x4(%rdi,%rdx,4)
cmovle 0x4(%rdi,%rdx,4),%ecx
add (%rsi,%rdx,4),%ecx
mov %ecx,(%rdi,%rdx,4)
add $0x1,%rdx
cmp %edx,%eax
jge 1470 <func0+0x60>
sub $0x1,%rax
test %eax,%eax
jns 1460 <func0+0x50>
mov (%rdi),%r12d
callq 1090 <free@plt>
pop %rbx
pop %rbp
mov %r12d,%eax
pop %r12
retq
nopw %cs:0x0(%rax,%rax,1)
nopl 0x0(%rax)
| func0:
endbr64
push r12
movsxd r12, esi
push rbp
mov rbp, rdi
push rbx
mov rbx, r12
shl r12, 2
mov rdi, r12
call _malloc
mov rdi, rax
test ebx, ebx
jle short loc_1449
lea eax, [rbx-1]
mov rdx, r12
cdqe
mov rsi, [rbp+rax*8+0]
call _memcpy
mov rdi, rax
loc_1449:
sub ebx, 2
js short loc_1483
movsxd rsi, ebx
nop dword ptr [rax+00000000h]
loc_1458:
mov r8, [rbp+rsi*8+0]
xor eax, eax
nop
loc_1460:
mov ecx, [rdi+rax*4]
mov edx, [rdi+rax*4+4]
cmp edx, ecx
cmovg edx, ecx
add edx, [r8+rax*4]
mov [rdi+rax*4], edx
add rax, 1
cmp eax, esi
jle short loc_1460
sub rsi, 1
test esi, esi
jns short loc_1458
loc_1483:
mov r12d, [rdi]
call _free
pop rbx
pop rbp
mov eax, r12d
pop r12
retn | long long func0(long long a1, int a2)
{
unsigned int *v3; // rdi
long long v4; // rsi
long long v5; // r8
long long v6; // rax
int v7; // edx
unsigned int v8; // r12d
v3 = (unsigned int *)malloc(4LL * a2);
if ( a2 > 0 )
v3 = (unsigned int *)memcpy(v3, *(_QWORD *)(a1 + 8LL * (a2 - 1)), 4LL * a2);
if ( a2 - 2 >= 0 )
{
v4 = a2 - 2;
do
{
v5 = *(_QWORD *)(a1 + 8 * v4);
v6 = 0LL;
do
{
v7 = v3[v6 + 1];
if ( v7 > (int)v3[v6] )
v7 = v3[v6];
v3[v6] = *(_DWORD *)(v5 + 4 * v6) + v7;
++v6;
}
while ( (int)v6 <= (int)v4 );
--v4;
}
while ( (int)v4 >= 0 );
}
v8 = *v3;
free();
return v8;
} | func0:
ENDBR64
PUSH R12
MOVSXD R12,ESI
PUSH RBP
MOV RBP,RDI
PUSH RBX
MOV RBX,R12
SHL R12,0x2
MOV RDI,R12
CALL 0x001010f0
MOV RDI,RAX
TEST EBX,EBX
JLE 0x00101449
LEA EAX,[RBX + -0x1]
MOV RDX,R12
CDQE
MOV RSI,qword ptr [RBP + RAX*0x8]
CALL 0x001010e0
MOV RDI,RAX
LAB_00101449:
SUB EBX,0x2
JS 0x00101483
MOVSXD RSI,EBX
NOP dword ptr [RAX]
LAB_00101458:
MOV R8,qword ptr [RBP + RSI*0x8]
XOR EAX,EAX
NOP
LAB_00101460:
MOV ECX,dword ptr [RDI + RAX*0x4]
MOV EDX,dword ptr [RDI + RAX*0x4 + 0x4]
CMP EDX,ECX
CMOVG EDX,ECX
ADD EDX,dword ptr [R8 + RAX*0x4]
MOV dword ptr [RDI + RAX*0x4],EDX
ADD RAX,0x1
CMP EAX,ESI
JLE 0x00101460
SUB RSI,0x1
TEST ESI,ESI
JNS 0x00101458
LAB_00101483:
MOV R12D,dword ptr [RDI]
CALL 0x001010a0
POP RBX
POP RBP
MOV EAX,R12D
POP R12
RET | int4 func0(long param_1,int param_2)
{
int4 uVar1;
long lVar2;
int4 *__dest;
long lVar3;
int iVar4;
long lVar5;
__dest = (int4 *)malloc((long)param_2 << 2);
if (0 < param_2) {
__dest = (int4 *)
memcpy(__dest,*(void **)(param_1 + (long)(param_2 + -1) * 8),(long)param_2 << 2);
}
if (-1 < param_2 + -2) {
lVar5 = (long)(param_2 + -2);
do {
lVar2 = *(long *)(param_1 + lVar5 * 8);
lVar3 = 0;
do {
iVar4 = __dest[lVar3 + 1];
if ((int)__dest[lVar3] < (int)__dest[lVar3 + 1]) {
iVar4 = __dest[lVar3];
}
__dest[lVar3] = iVar4 + *(int *)(lVar2 + lVar3 * 4);
lVar3 = lVar3 + 1;
} while ((int)lVar3 <= (int)lVar5);
lVar5 = lVar5 + -1;
} while (-1 < (int)lVar5);
}
uVar1 = *__dest;
free(__dest);
return uVar1;
} |
7,791 | func0 |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
| int func0(int** A, int rows) {
int* memo = (int*)malloc(rows * sizeof(int));
int n = rows - 1;
for (int i = 0; i < rows; i++) {
memo[i] = A[n][i];
}
for (int i = rows - 2; i >= 0; i--) {
for (int j = 0; j <= i; j++) {
int minValue = memo[j] < memo[j + 1] ? memo[j] : memo[j + 1];
memo[j] = A[i][j] + minValue;
}
}
int result = memo[0];
free(memo);
return result;
}
| int main() {
int a1[3][3] = {{2}, {3, 9}, {1, 6, 7}};
int a2[3][3] = {{2}, {3, 7}, {8, 5, 6}};
int a3[3][3] = {{3}, {6, 4}, {5, 2, 7}};
int* pa1[3] = {a1[0], a1[1], a1[2]};
int* pa2[3] = {a2[0], a2[1], a2[2]};
int* pa3[3] = {a3[0], a3[1], a3[2]};
assert(func0(pa1, 3) == 6);
assert(func0(pa2, 3) == 10);
assert(func0(pa3, 3) == 9);
printf("All tests passed successfully.\n");
return 0;
}
| O3 | c | func0:
endbr64
push %r12
push %rbp
push %rbx
mov %rdi,%rbx
movslq %esi,%rdi
mov %rdi,%rbp
shl $0x2,%rdi
callq 10f0 <malloc@plt>
mov %rax,%rdi
test %ebp,%ebp
jle 147c <func0+0x3c>
lea -0x1(%rbp),%eax
mov %eax,%edx
cltq
mov (%rbx,%rax,8),%rsi
lea 0x4(,%rdx,4),%rdx
callq 10e0 <memcpy@plt>
mov %rax,%rdi
mov %ebp,%edx
sub $0x2,%edx
js 163f <func0+0x1ff>
movslq %edx,%rdx
xor %r9d,%r9d
nopl (%rax)
test %edx,%edx
mov %r9d,%r8d
mov (%rbx,%rdx,8),%rcx
cmovns %edx,%r8d
add $0x1,%r8d
cmp $0x2,%edx
jle 1650 <func0+0x210>
mov %r8d,%esi
xor %eax,%eax
shr $0x2,%esi
shl $0x4,%rsi
nopw %cs:0x0(%rax,%rax,1)
movdqu 0x4(%rdi,%rax,1),%xmm2
movdqu (%rdi,%rax,1),%xmm0
movdqu (%rdi,%rax,1),%xmm3
movdqu (%rcx,%rax,1),%xmm4
pcmpgtd %xmm2,%xmm0
movdqa %xmm2,%xmm1
pand %xmm0,%xmm1
pandn %xmm3,%xmm0
por %xmm1,%xmm0
paddd %xmm4,%xmm0
movups %xmm0,(%rdi,%rax,1)
add $0x10,%rax
cmp %rax,%rsi
jne 14c0 <func0+0x80>
mov %r8d,%r10d
and $0xfffffffc,%r10d
and $0x3,%r8d
je 1633 <func0+0x1f3>
movslq %r10d,%r12
lea 0x1(%r10),%esi
mov %edx,%r11d
lea 0x0(,%r12,4),%rax
lea (%rdi,%rax,1),%r8
cmp %edx,%esi
jge 1658 <func0+0x218>
cmp %edx,%r10d
jg 1658 <func0+0x218>
mov 0x4(%rdi,%rax,1),%esi
cmp %esi,(%r8)
mov %esi,%ebp
cmovle (%r8),%ebp
add (%rcx,%r12,4),%ebp
mov %ebp,(%r8)
mov 0x8(%rdi,%rax,1),%r8d
lea 0x3(%r10),%ebp
cmp %r8d,%esi
cmovg %r8d,%esi
add 0x4(%rcx,%rax,1),%esi
mov %esi,0x4(%rdi,%rax,1)
lea 0x2(%r10),%esi
cmp %ebp,%edx
jle 15c5 <func0+0x185>
mov 0xc(%rdi,%rax,1),%esi
lea 0x5(%r10),%ebp
cmp %esi,%r8d
cmovg %esi,%r8d
add 0x8(%rcx,%rax,1),%r8d
mov %r8d,0x8(%rdi,%rax,1)
mov 0x10(%rdi,%rax,1),%r8d
cmp %r8d,%esi
cmovg %r8d,%esi
add 0xc(%rcx,%rax,1),%esi
mov %esi,0xc(%rdi,%rax,1)
lea 0x4(%r10),%esi
cmp %ebp,%edx
jle 15c5 <func0+0x185>
mov 0x14(%rdi,%rax,1),%esi
cmp %r8d,%esi
cmovle %esi,%r8d
add 0x10(%rcx,%rax,1),%r8d
cmp %esi,0x18(%rdi,%rax,1)
mov %r8d,0x10(%rdi,%rax,1)
cmovle 0x18(%rdi,%rax,1),%esi
add 0x14(%rcx,%rax,1),%esi
mov %esi,0x14(%rdi,%rax,1)
lea 0x6(%r10),%esi
movslq %esi,%r10
add $0x1,%r10
lea 0x0(,%r10,4),%rax
lea -0x4(%rdi,%rax,1),%rbp
mov 0x0(%rbp),%r8d
cmp %r8d,(%rdi,%r10,4)
cmovle (%rdi,%r10,4),%r8d
add -0x4(%rcx,%rax,1),%r8d
mov %r8d,0x0(%rbp)
lea 0x1(%rsi),%r8d
cmp %r11d,%r8d
jg 1633 <func0+0x1f3>
lea (%rdi,%rax,1),%rbp
mov 0x0(%rbp),%r8d
cmp %r8d,0x4(%rdi,%rax,1)
cmovle 0x4(%rdi,%rax,1),%r8d
add $0x2,%esi
add (%rcx,%r10,4),%r8d
mov %r8d,0x0(%rbp)
cmp %r11d,%esi
jg 1633 <func0+0x1f3>
lea 0x4(%rdi,%rax,1),%r8
mov (%r8),%esi
cmp %esi,0x8(%rdi,%rax,1)
cmovle 0x8(%rdi,%rax,1),%esi
add 0x4(%rcx,%rax,1),%esi
mov %esi,(%r8)
sub $0x1,%rdx
test %edx,%edx
jns 1490 <func0+0x50>
mov (%rdi),%r12d
callq 10a0 <free@plt>
pop %rbx
pop %rbp
mov %r12d,%eax
pop %r12
retq
xor %r10d,%r10d
jmpq 150b <func0+0xcb>
mov %r10d,%esi
jmpq 15c5 <func0+0x185>
| func0:
endbr64
push r14
push r13
push r12
push rbp
mov rbp, rdi
movsxd rdi, esi
push rbx
mov r12, rdi
shl rdi, 2; size
call _malloc
mov rdi, rax; dest
test r12d, r12d
jle loc_15D9
lea ebx, [r12-1]
mov edx, r12d
movsxd rax, ebx
shl rdx, 2; n
mov rsi, [rbp+rax*8+0]; src
call _memcpy
lea esi, [r12-2]
mov rdi, rax; ptr
cmp r12d, 1
jz loc_15D9
movsxd rsi, esi
nop dword ptr [rax+rax+00000000h]
loc_1490:
mov rcx, [rbp+rsi*8+0]
cmp esi, 2
jbe loc_1680
mov edx, ebx
xor eax, eax
shr edx, 2
shl rdx, 4
nop dword ptr [rax+00000000h]
loc_14B0:
movdqu xmm2, xmmword ptr [rdi+rax+4]
movdqu xmm0, xmmword ptr [rdi+rax]
movdqu xmm3, xmmword ptr [rdi+rax]
movdqu xmm4, xmmword ptr [rcx+rax]
pcmpgtd xmm0, xmm2
movdqa xmm1, xmm2
pand xmm1, xmm0
pandn xmm0, xmm3
por xmm0, xmm1
paddd xmm0, xmm4
movups xmmword ptr [rdi+rax], xmm0
add rax, 10h
cmp rdx, rax
jnz short loc_14B0
mov eax, ebx
and eax, 0FFFFFFFCh
test bl, 3
jz loc_15CA
loc_14F8:
movsxd r13, eax
lea edx, [rax+1]
mov r10d, esi
lea r8, ds:0[r13*4]
lea r11, [rdi+r8]
cmp edx, esi
jge short loc_1561
cmp eax, esi
jg short loc_1561
mov r14d, [rdi+r8+4]
mov edx, [r11]
lea r12, [rdi+r8+8]
mov r9d, [r12]
movq xmm1, qword ptr [rcx+r13*4]
cmp r14d, edx
cmovle edx, r14d
cmp r14d, r9d
cmovg r14d, r9d
movd xmm0, edx
lea edx, [rax+3]
movd xmm5, r14d
punpckldq xmm0, xmm5
paddd xmm0, xmm1
movq qword ptr [r11], xmm0
cmp esi, edx
jg loc_15F0
add eax, 2
lea edx, [rax+1]
loc_1561:
movsxd r8, edx
lea r9, ds:0[r8*4]
lea r12, [rdi+r9-4]
lea r11, [rdi+r9]
mov edx, [r11]
mov r13d, [r12]
cmp edx, r13d
cmovg edx, r13d
add edx, [rcx+r9-4]
mov [r12], edx
cmp eax, r10d
jge short loc_15CA
mov edx, [rdi+r9+4]
mov r12d, [r11]
cmp edx, r12d
cmovg edx, r12d
add eax, 2
add edx, [rcx+r8*4]
mov [r11], edx
cmp eax, r10d
jg short loc_15CA
lea rdx, [rdi+r9+4]
mov eax, [rdi+r9+8]
mov r8d, [rdx]
cmp eax, r8d
cmovg eax, r8d
add eax, [rcx+r9+4]
mov [rdx], eax
loc_15CA:
sub rsi, 1
sub ebx, 1
test esi, esi
jns loc_1490
loc_15D9:
mov ebx, [rdi]
call _free
mov eax, ebx
pop rbx
pop rbp
pop r12
pop r13
pop r14
retn
loc_15F0:
mov r13d, [rdi+r8+0Ch]
lea r11, [rdi+r8+10h]
movq xmm1, qword ptr [rcx+r8+8]
mov edx, [r11]
cmp r9d, r13d
cmovg r9d, r13d
cmp r13d, edx
cmovg r13d, edx
movd xmm0, r9d
lea r9d, [rax+5]
movd xmm6, r13d
punpckldq xmm0, xmm6
paddd xmm1, xmm0
movq qword ptr [r12], xmm1
cmp esi, r9d
jg short loc_1640
add eax, 4
lea edx, [rax+1]
jmp loc_1561
loc_1640:
mov r9d, [rdi+r8+14h]
movq xmm1, qword ptr [rcx+r8+10h]
cmp r9d, edx
cmovle edx, r9d
movd xmm0, edx
mov edx, [rdi+r8+18h]
cmp r9d, edx
cmovg r9d, edx
add eax, 6
lea edx, [rax+1]
movd xmm7, r9d
punpckldq xmm0, xmm7
paddd xmm0, xmm1
movq qword ptr [r11], xmm0
jmp loc_1561
loc_1680:
xor eax, eax
jmp loc_14F8 | long long func0(long long a1, int a2)
{
_DWORD *v4; // rdi
unsigned int v5; // ebx
_DWORD *v6; // rax
long long v7; // rsi
long long v8; // rcx
long long v9; // rax
__m128i v10; // xmm2
__m128i v11; // xmm0
signed int v12; // eax
int v13; // edx
long long v14; // r8
unsigned int *v15; // r11
signed int v16; // r14d
unsigned int v17; // edx
signed int *v18; // r12
signed int v19; // r9d
__m128i v20; // xmm1
long long v21; // r8
long long v22; // r9
int *v23; // r12
int *v24; // r11
int v25; // edx
int v26; // edx
int *v27; // rdx
int v28; // eax
unsigned int v29; // ebx
signed int v31; // r13d
signed int *v32; // r11
__m128i v33; // xmm1
signed int v34; // edx
signed int v35; // r9d
__m128i v36; // xmm1
__m128i v37; // xmm0
v4 = malloc(4LL * a2);
if ( a2 > 0 )
{
v5 = a2 - 1;
v6 = memcpy(v4, *(const void **)(a1 + 8LL * (a2 - 1)), 4LL * (unsigned int)a2);
LODWORD(v7) = a2 - 2;
v4 = v6;
if ( a2 != 1 )
{
v7 = (int)v7;
while ( 1 )
{
v8 = *(_QWORD *)(a1 + 8 * v7);
if ( (unsigned int)v7 <= 2 )
break;
v9 = 0LL;
do
{
v10 = _mm_loadu_si128((const __m128i *)&v4[v9 + 1]);
v11 = _mm_cmpgt_epi32(_mm_loadu_si128((const __m128i *)&v4[v9]), v10);
*(__m128i *)&v4[v9] = _mm_add_epi32(
_mm_or_si128(
_mm_andnot_si128(v11, _mm_loadu_si128((const __m128i *)&v4[v9])),
_mm_and_si128(v10, v11)),
_mm_loadu_si128((const __m128i *)(v8 + v9 * 4)));
v9 += 4LL;
}
while ( 4LL * (v5 >> 2) != v9 );
v12 = v5 & 0xFFFFFFFC;
if ( (v5 & 3) != 0 )
goto LABEL_8;
LABEL_25:
--v7;
--v5;
if ( (int)v7 < 0 )
goto LABEL_26;
}
v12 = 0;
LABEL_8:
v13 = v12 + 1;
v14 = v12;
v15 = &v4[v14];
if ( v12 + 1 < (int)v7 && v12 <= (int)v7 )
{
v16 = v4[v14 + 1];
v17 = *v15;
v18 = &v4[v14 + 2];
v19 = *v18;
v20 = _mm_loadl_epi64((const __m128i *)(v8 + 4LL * v12));
if ( v16 <= (int)*v15 )
v17 = v4[v14 + 1];
if ( v16 > v19 )
v16 = *v18;
*(_QWORD *)v15 = _mm_add_epi32(_mm_unpacklo_epi32(_mm_cvtsi32_si128(v17), _mm_cvtsi32_si128(v16)), v20).m128i_u64[0];
if ( (int)v7 > v12 + 3 )
{
v31 = v4[v14 + 3];
v32 = &v4[v14 + 4];
v33 = _mm_loadl_epi64((const __m128i *)(v8 + v14 * 4 + 8));
v34 = *v32;
if ( v19 > v31 )
v19 = v4[v14 + 3];
if ( v31 > v34 )
v31 = *v32;
*(_QWORD *)v18 = _mm_add_epi32(v33, _mm_unpacklo_epi32(_mm_cvtsi32_si128(v19), _mm_cvtsi32_si128(v31))).m128i_u64[0];
if ( (int)v7 > v12 + 5 )
{
v35 = v4[v14 + 5];
v36 = _mm_loadl_epi64((const __m128i *)(v8 + v14 * 4 + 16));
if ( v35 <= v34 )
v34 = v4[v14 + 5];
v37 = _mm_cvtsi32_si128(v34);
if ( v35 > v4[v14 + 6] )
v35 = v4[v14 + 6];
v12 += 6;
v13 = v12 + 1;
*(_QWORD *)v32 = _mm_add_epi32(_mm_unpacklo_epi32(v37, _mm_cvtsi32_si128(v35)), v36).m128i_u64[0];
}
else
{
v12 += 4;
v13 = v12 + 1;
}
}
else
{
v12 += 2;
v13 = v12 + 1;
}
}
v21 = v13;
v22 = v13;
v23 = &v4[v22 - 1];
v24 = &v4[v22];
v25 = v4[v22];
if ( v25 > *v23 )
v25 = *v23;
*v23 = *(_DWORD *)(v8 + v22 * 4 - 4) + v25;
if ( v12 < (int)v7 )
{
v26 = v4[v22 + 1];
if ( v26 > *v24 )
v26 = *v24;
*v24 = *(_DWORD *)(v8 + 4 * v21) + v26;
if ( v12 + 2 <= (int)v7 )
{
v27 = &v4[v22 + 1];
v28 = v4[v22 + 2];
if ( v28 > *v27 )
v28 = *v27;
*v27 = *(_DWORD *)(v8 + v22 * 4 + 4) + v28;
}
}
goto LABEL_25;
}
}
LABEL_26:
v29 = *v4;
free(v4);
return v29;
} | func0:
ENDBR64
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
MOV RBP,RDI
MOVSXD RDI,ESI
PUSH RBX
MOV R12,RDI
SHL RDI,0x2
CALL 0x001010f0
MOV RDI,RAX
TEST R12D,R12D
JLE 0x001015d9
LEA EBX,[R12 + -0x1]
MOV EDX,R12D
MOVSXD RAX,EBX
SHL RDX,0x2
MOV RSI,qword ptr [RBP + RAX*0x8]
CALL 0x001010e0
LEA ESI,[R12 + -0x2]
MOV RDI,RAX
CMP R12D,0x1
JZ 0x001015d9
MOVSXD RSI,ESI
NOP dword ptr [RAX + RAX*0x1]
LAB_00101490:
MOV RCX,qword ptr [RBP + RSI*0x8]
CMP ESI,0x2
JBE 0x00101680
MOV EDX,EBX
XOR EAX,EAX
SHR EDX,0x2
SHL RDX,0x4
NOP dword ptr [RAX]
LAB_001014b0:
MOVDQU XMM2,xmmword ptr [RDI + RAX*0x1 + 0x4]
MOVDQU XMM0,xmmword ptr [RDI + RAX*0x1]
MOVDQU XMM3,xmmword ptr [RDI + RAX*0x1]
MOVDQU XMM4,xmmword ptr [RCX + RAX*0x1]
PCMPGTD XMM0,XMM2
MOVDQA XMM1,XMM2
PAND XMM1,XMM0
PANDN XMM0,XMM3
POR XMM0,XMM1
PADDD XMM0,XMM4
MOVUPS xmmword ptr [RDI + RAX*0x1],XMM0
ADD RAX,0x10
CMP RDX,RAX
JNZ 0x001014b0
MOV EAX,EBX
AND EAX,0xfffffffc
TEST BL,0x3
JZ 0x001015ca
LAB_001014f8:
MOVSXD R13,EAX
LEA EDX,[RAX + 0x1]
MOV R10D,ESI
LEA R8,[R13*0x4]
LEA R11,[RDI + R8*0x1]
CMP EDX,ESI
JGE 0x00101561
CMP EAX,ESI
JG 0x00101561
MOV R14D,dword ptr [RDI + R8*0x1 + 0x4]
MOV EDX,dword ptr [R11]
LEA R12,[RDI + R8*0x1 + 0x8]
MOV R9D,dword ptr [R12]
MOVQ XMM1,qword ptr [RCX + R13*0x4]
CMP R14D,EDX
CMOVLE EDX,R14D
CMP R14D,R9D
CMOVG R14D,R9D
MOVD XMM0,EDX
LEA EDX,[RAX + 0x3]
MOVD XMM5,R14D
PUNPCKLDQ XMM0,XMM5
PADDD XMM0,XMM1
MOVQ qword ptr [R11],XMM0
CMP ESI,EDX
JG 0x001015f0
ADD EAX,0x2
LEA EDX,[RAX + 0x1]
LAB_00101561:
MOVSXD R8,EDX
LEA R9,[R8*0x4]
LEA R12,[RDI + R9*0x1 + -0x4]
LEA R11,[RDI + R9*0x1]
MOV EDX,dword ptr [R11]
MOV R13D,dword ptr [R12]
CMP EDX,R13D
CMOVG EDX,R13D
ADD EDX,dword ptr [RCX + R9*0x1 + -0x4]
MOV dword ptr [R12],EDX
CMP EAX,R10D
JGE 0x001015ca
MOV EDX,dword ptr [RDI + R9*0x1 + 0x4]
MOV R12D,dword ptr [R11]
CMP EDX,R12D
CMOVG EDX,R12D
ADD EAX,0x2
ADD EDX,dword ptr [RCX + R8*0x4]
MOV dword ptr [R11],EDX
CMP EAX,R10D
JG 0x001015ca
LEA RDX,[RDI + R9*0x1 + 0x4]
MOV EAX,dword ptr [RDI + R9*0x1 + 0x8]
MOV R8D,dword ptr [RDX]
CMP EAX,R8D
CMOVG EAX,R8D
ADD EAX,dword ptr [RCX + R9*0x1 + 0x4]
MOV dword ptr [RDX],EAX
LAB_001015ca:
SUB RSI,0x1
SUB EBX,0x1
TEST ESI,ESI
JNS 0x00101490
LAB_001015d9:
MOV EBX,dword ptr [RDI]
CALL 0x001010a0
MOV EAX,EBX
POP RBX
POP RBP
POP R12
POP R13
POP R14
RET
LAB_001015f0:
MOV R13D,dword ptr [RDI + R8*0x1 + 0xc]
LEA R11,[RDI + R8*0x1 + 0x10]
MOVQ XMM1,qword ptr [RCX + R8*0x1 + 0x8]
MOV EDX,dword ptr [R11]
CMP R9D,R13D
CMOVG R9D,R13D
CMP R13D,EDX
CMOVG R13D,EDX
MOVD XMM0,R9D
LEA R9D,[RAX + 0x5]
MOVD XMM6,R13D
PUNPCKLDQ XMM0,XMM6
PADDD XMM1,XMM0
MOVQ qword ptr [R12],XMM1
CMP ESI,R9D
JG 0x00101640
ADD EAX,0x4
LEA EDX,[RAX + 0x1]
JMP 0x00101561
LAB_00101640:
MOV R9D,dword ptr [RDI + R8*0x1 + 0x14]
MOVQ XMM1,qword ptr [RCX + R8*0x1 + 0x10]
CMP R9D,EDX
CMOVLE EDX,R9D
MOVD XMM0,EDX
MOV EDX,dword ptr [RDI + R8*0x1 + 0x18]
CMP R9D,EDX
CMOVG R9D,EDX
ADD EAX,0x6
LEA EDX,[RAX + 0x1]
MOVD XMM7,R9D
PUNPCKLDQ XMM0,XMM7
PADDD XMM0,XMM1
MOVQ qword ptr [R11],XMM0
JMP 0x00101561
LAB_00101680:
XOR EAX,EAX
JMP 0x001014f8 | int4 func0(long param_1,uint param_2)
{
int *piVar1;
uint *puVar2;
int *piVar3;
uint *puVar4;
int8 uVar5;
int iVar6;
int4 uVar7;
long lVar8;
uint uVar9;
uint uVar10;
uint uVar11;
uint uVar12;
uint uVar13;
uint uVar14;
int4 *__dest;
long lVar15;
int iVar16;
int iVar17;
uint uVar18;
uint uVar19;
long lVar20;
uint uVar21;
uint uVar22;
uint uVar23;
uint uVar24;
__dest = (int4 *)malloc((long)(int)param_2 << 2);
if (0 < (int)param_2) {
uVar18 = param_2 - 1;
__dest = (int4 *)
memcpy(__dest,*(void **)(param_1 + (long)(int)uVar18 * 8),(ulong)param_2 << 2);
if (param_2 != 1) {
lVar20 = (long)(int)(param_2 - 2);
do {
lVar8 = *(long *)(param_1 + lVar20 * 8);
uVar19 = (uint)lVar20;
if (uVar19 < 3) {
uVar13 = 0;
LAB_001014f8:
lVar15 = (long)(int)uVar13;
iVar16 = uVar13 + 1;
uVar14 = uVar13;
if ((iVar16 < (int)uVar19) && ((int)uVar13 <= (int)uVar19)) {
iVar16 = __dest[lVar15 + 1];
iVar17 = __dest[lVar15];
iVar6 = __dest[lVar15 + 2];
uVar5 = *(int8 *)(lVar8 + lVar15 * 4);
if (iVar16 <= iVar17) {
iVar17 = iVar16;
}
if (iVar6 < iVar16) {
iVar16 = iVar6;
}
*(ulong *)(__dest + lVar15) =
CONCAT44(iVar16 + (int)((ulong)uVar5 >> 0x20),iVar17 + (int)uVar5);
if ((int)(uVar13 + 3) < (int)uVar19) {
iVar16 = __dest[lVar15 + 3];
uVar5 = *(int8 *)(lVar8 + 8 + lVar15 * 4);
iVar17 = __dest[lVar15 + 4];
if (iVar16 < iVar6) {
iVar6 = iVar16;
}
if (iVar17 < iVar16) {
iVar16 = iVar17;
}
*(ulong *)(__dest + lVar15 + 2) =
CONCAT44((int)((ulong)uVar5 >> 0x20) + iVar16,(int)uVar5 + iVar6);
if ((int)(uVar13 + 5) < (int)uVar19) {
iVar6 = __dest[lVar15 + 5];
uVar5 = *(int8 *)(lVar8 + 0x10 + lVar15 * 4);
if (iVar6 <= iVar17) {
iVar17 = iVar6;
}
if ((int)__dest[lVar15 + 6] < iVar6) {
iVar6 = __dest[lVar15 + 6];
}
uVar14 = uVar13 + 6;
iVar16 = uVar13 + 7;
*(ulong *)(__dest + lVar15 + 4) =
CONCAT44(iVar6 + (int)((ulong)uVar5 >> 0x20),iVar17 + (int)uVar5);
}
else {
uVar14 = uVar13 + 4;
iVar16 = uVar13 + 5;
}
}
else {
uVar14 = uVar13 + 2;
iVar16 = uVar13 + 3;
}
}
lVar15 = (long)iVar16;
piVar1 = __dest + lVar15;
iVar16 = __dest[lVar15 + -1];
iVar17 = *piVar1;
if (iVar16 < *piVar1) {
iVar17 = iVar16;
}
__dest[lVar15 + -1] = iVar17 + *(int *)(lVar8 + -4 + lVar15 * 4);
if ((int)uVar14 < (int)uVar19) {
iVar16 = __dest[lVar15 + 1];
if (*piVar1 < (int)__dest[lVar15 + 1]) {
iVar16 = *piVar1;
}
*piVar1 = iVar16 + *(int *)(lVar8 + lVar15 * 4);
if ((int)(uVar14 + 2) <= (int)uVar19) {
iVar16 = __dest[lVar15 + 1];
iVar17 = __dest[lVar15 + 2];
if (iVar16 < (int)__dest[lVar15 + 2]) {
iVar17 = iVar16;
}
__dest[lVar15 + 1] = iVar17 + *(int *)(lVar8 + 4 + lVar15 * 4);
}
}
}
else {
lVar15 = 0;
do {
puVar4 = (uint *)((long)__dest + lVar15 + 4);
uVar13 = puVar4[1];
uVar14 = puVar4[2];
uVar9 = puVar4[3];
piVar1 = (int *)((long)__dest + lVar15);
puVar2 = (uint *)((long)__dest + lVar15);
uVar10 = puVar2[1];
uVar11 = puVar2[2];
uVar12 = puVar2[3];
piVar3 = (int *)(lVar8 + lVar15);
iVar16 = piVar3[1];
iVar17 = piVar3[2];
iVar6 = piVar3[3];
uVar21 = -(uint)((int)*puVar4 < *piVar1);
uVar22 = -(uint)((int)uVar13 < piVar1[1]);
uVar23 = -(uint)((int)uVar14 < piVar1[2]);
uVar24 = -(uint)((int)uVar9 < piVar1[3]);
piVar1 = (int *)((long)__dest + lVar15);
*piVar1 = (~uVar21 & *puVar2 | *puVar4 & uVar21) + *piVar3;
piVar1[1] = (~uVar22 & uVar10 | uVar13 & uVar22) + iVar16;
piVar1[2] = (~uVar23 & uVar11 | uVar14 & uVar23) + iVar17;
piVar1[3] = (~uVar24 & uVar12 | uVar9 & uVar24) + iVar6;
lVar15 = lVar15 + 0x10;
} while ((ulong)(uVar18 >> 2) << 4 != lVar15);
uVar13 = uVar18 & 0xfffffffc;
if ((uVar18 & 3) != 0) goto LAB_001014f8;
}
lVar20 = lVar20 + -1;
uVar18 = uVar18 - 1;
} while (-1 < (int)lVar20);
}
}
uVar7 = *__dest;
free(__dest);
return uVar7;
} |
Subsets and Splits
C++ Functions With Standard Library Dependencies
Identifies C++ functions that depend on standard library components, revealing patterns in how developers utilize STL libraries and potentially highlighting common coding practices or dependencies in the dataset.
C++ Standard Library Function Analysis
Filters C++ code examples that use standard library containers and types, providing useful insights into common programming patterns and data structures in the dataset.
Random Training Function Samples
Performs basic filtering and random sampling of assembly code data without revealing meaningful patterns or relationships.
Random Training Function Samples
Retrieves a random sample of 1000 records from the training dataset, providing basic data exploration but offering limited analytical value beyond seeing raw entries.