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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6,082 | func0 | #include <assert.h>
| int func0(int n) {
int i = 1;
int sum = 0;
while (n / i > 0) {
sum = sum + n / i;
i = i * 2;
}
return sum;
}
| int main() {
assert(func0(4) == 7);
assert(func0(2) == 3);
assert(func0(5) == 8);
return 0;
}
| O2 | c | func0:
endbr64
test %edi,%edi
jle 1170 <func0+0x30>
mov %edi,%eax
xor %r8d,%r8d
mov $0x1,%ecx
nopw 0x0(%rax,%rax,1)
add %eax,%r8d
mov %edi,%eax
add %ecx,%ecx
cltd
idiv %ecx
test %eax,%eax
jne 1158 <func0+0x18>
mov %r8d,%eax
retq
nopw 0x0(%rax,%rax,1)
xor %r8d,%r8d
mov %r8d,%ea... | func0:
endbr64
test edi, edi
jle short loc_1170
mov eax, edi
xor r8d, r8d
mov ecx, 1
nop word ptr [rax+rax+00h]
loc_1158:
add r8d, eax
mov eax, edi
add ecx, ecx
cdq
idiv ecx
test eax, eax
jnz short loc_1158
mov eax, r8d
retn
loc_1170:
xor r8d, r8d
mov eax, r8d
re... | long long func0(int a1)
{
int v1; // eax
unsigned int v2; // r8d
int v3; // ecx
if ( a1 <= 0 )
return 0LL;
v1 = a1;
v2 = 0;
v3 = 1;
do
{
v2 += v1;
v3 *= 2;
v1 = a1 / v3;
}
while ( a1 / v3 );
return v2;
} | func0:
ENDBR64
TEST EDI,EDI
JLE 0x00101170
MOV EAX,EDI
XOR R8D,R8D
MOV ECX,0x1
NOP word ptr [RAX + RAX*0x1]
LAB_00101158:
ADD R8D,EAX
MOV EAX,EDI
ADD ECX,ECX
CDQ
IDIV ECX
TEST EAX,EAX
JNZ 0x00101158
MOV EAX,R8D
RET
LAB_00101170:
XOR R8D,R8D
MOV EAX,R8D
RET | int1 [16] func0(int param_1,int8 param_2,ulong param_3)
{
int1 auVar1 [16];
int iVar2;
int iVar3;
uint uVar4;
int1 auVar5 [16];
if (0 < param_1) {
uVar4 = 0;
iVar3 = 1;
iVar2 = param_1;
do {
uVar4 = uVar4 + iVar2;
iVar3 = iVar3 * 2;
iVar2 = param_1 / iVar3;
auVar... |
6,083 | func0 | #include <assert.h>
| int func0(int n) {
int i = 1;
int sum = 0;
while (n / i > 0) {
sum = sum + n / i;
i = i * 2;
}
return sum;
}
| int main() {
assert(func0(4) == 7);
assert(func0(2) == 3);
assert(func0(5) == 8);
return 0;
}
| O3 | c | func0:
endbr64
test %edi,%edi
jle 1170 <func0+0x30>
mov %edi,%eax
xor %r8d,%r8d
mov $0x1,%ecx
nopw 0x0(%rax,%rax,1)
add %eax,%r8d
mov %edi,%eax
add %ecx,%ecx
cltd
idiv %ecx
test %eax,%eax
jne 1158 <func0+0x18>
mov %r8d,%eax
retq
nopw 0x0(%rax,%rax,1)
xor %r8d,%r8d
mov %r8d,%ea... | func0:
endbr64
test edi, edi
jle short loc_1170
mov eax, edi
xor esi, esi
mov ecx, 1
nop dword ptr [rax+00000000h]
loc_1158:
add esi, eax
mov eax, edi
add ecx, ecx
cdq
idiv ecx
test eax, eax
jg short loc_1158
mov eax, esi
retn
loc_1170:
xor esi, esi
mov eax, esi... | long long func0(int a1)
{
int v1; // eax
unsigned int v2; // esi
int v3; // ecx
if ( a1 <= 0 )
return 0LL;
v1 = a1;
v2 = 0;
v3 = 1;
do
{
v2 += v1;
v3 *= 2;
v1 = a1 / v3;
}
while ( a1 / v3 > 0 );
return v2;
} | func0:
ENDBR64
TEST EDI,EDI
JLE 0x00101170
MOV EAX,EDI
XOR ESI,ESI
MOV ECX,0x1
NOP dword ptr [RAX]
LAB_00101158:
ADD ESI,EAX
MOV EAX,EDI
ADD ECX,ECX
CDQ
IDIV ECX
TEST EAX,EAX
JG 0x00101158
MOV EAX,ESI
RET
LAB_00101170:
XOR ESI,ESI
MOV EAX,ESI
RET | int [16] func0(int param_1,int8 param_2,ulong param_3)
{
int auVar1 [16];
int iVar2;
int iVar3;
uint uVar4;
int auVar5 [16];
if (0 < param_1) {
uVar4 = 0;
iVar3 = 1;
iVar2 = param_1;
do {
uVar4 = uVar4 + iVar2;
iVar3 = iVar3 * 2;
iVar2 = param_1 / iVar3;
auVar5._... |
6,084 | func0 | #include <stdio.h>
#include <assert.h>
| int func0(int arr[], int n) {
int longest_increasing_subsequence[n];
for (int i = 0; i < n; i++) {
longest_increasing_subsequence[i] = 1;
}
for (int i = 1; i < n; i++) {
for (int j = 0; j < i; j++) {
if (arr[i] > arr[j] && longest_increasing_subsequence[i] < longest_... | int main() {
int arr1[] = {10, 22, 9, 33, 21, 50, 41, 60};
int n1 = sizeof(arr1)/sizeof(arr1[0]);
assert(func0(arr1, n1) == 5);
int arr2[] = {3, 10, 2, 1, 20};
int n2 = sizeof(arr2)/sizeof(arr2[0]);
assert(func0(arr2, n2) == 3);
int arr3[] = {50, 3, 10, 7, 40, 80};
int n3 = s... | O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
push %rbx
sub $0x48,%rsp
mov %rdi,-0x48(%rbp)
mov %esi,-0x4c(%rbp)
mov %fs:0x28,%rax
mov %rax,-0x18(%rbp)
xor %eax,%eax
mov %rsp,%rax
mov %rax,%rsi
mov -0x4c(%rbp),%eax
movslq %eax,%rdx
sub $0x1,%rdx
mov %rdx,-0x28(%rbp)
movslq %eax,%rdx
mov... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 40h
mov [rbp+var_38], rdi
mov [rbp+var_3C], esi
mov rax, fs:28h
mov [rbp+var_8], rax
xor eax, eax
mov rax, rsp
mov rsi, rax
mov eax, [rbp+var_3C]
movsxd rdx, eax
sub rdx, 1
mov [rbp+var_18], rdx
cdqe
lea rdx, ds:0[rax*... | long long func0(long long a1, int a2)
{
unsigned long long v2; // rax
void *v3; // rsp
_BYTE v5[4]; // [rsp+8h] [rbp-40h] BYREF
int v6; // [rsp+Ch] [rbp-3Ch]
long long v7; // [rsp+10h] [rbp-38h]
int i; // [rsp+1Ch] [rbp-2Ch]
int j; // [rsp+20h] [rbp-28h]
int k; // [rsp+24h] [rbp-24h]
unsigned int v11... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x40
MOV qword ptr [RBP + -0x38],RDI
MOV dword ptr [RBP + -0x3c],ESI
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RBP + -0x8],RAX
XOR EAX,EAX
MOV RAX,RSP
MOV RSI,RAX
MOV EAX,dword ptr [RBP + -0x3c]
MOVSXD RDX,EAX
SUB RDX,0x1
MOV qword ptr [RBP + -0x18],RDX
CDQE
LEA RDX,[RAX*0x4... | int func0(long param_1,int param_2)
{
long lVar1;
ulong uVar2;
int *puVar3;
long in_FS_OFFSET;
int auStack_48 [4];
int local_44;
long local_40;
int local_34;
int local_30;
int local_2c;
int local_28;
int local_24;
long local_20;
int *local_18;
long local_10;
local_40 = param_1;
loc... |
6,085 | func0 | #include <stdio.h>
#include <assert.h>
| int func0(int arr[], int n) {
int longest_increasing_subsequence[n];
for (int i = 0; i < n; i++) {
longest_increasing_subsequence[i] = 1;
}
for (int i = 1; i < n; i++) {
for (int j = 0; j < i; j++) {
if (arr[i] > arr[j] && longest_increasing_subsequence[i] < longest_... | int main() {
int arr1[] = {10, 22, 9, 33, 21, 50, 41, 60};
int n1 = sizeof(arr1)/sizeof(arr1[0]);
assert(func0(arr1, n1) == 5);
int arr2[] = {3, 10, 2, 1, 20};
int n2 = sizeof(arr2)/sizeof(arr2[0]);
assert(func0(arr2, n2) == 3);
int arr3[] = {50, 3, 10, 7, 40, 80};
int n3 = s... | O1 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x10,%rsp
mov %fs:0x28,%rax
mov %rax,-0x8(%rbp)
xor %eax,%eax
movslq %esi,%rax
lea 0xf(,%rax,4),%rax
mov %rax,%rdx
and $0xfffffffffffffff0,%rdx
and $0xfffffffffffff000,%rax
mov %rsp,%rcx
sub %rax,%rcx
mov %rcx,%rax
cmp %rax,%rsp
je ... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 10h
mov r9d, esi
mov rax, fs:28h
mov [rbp+var_8], rax
xor eax, eax
movsxd rax, esi
lea rax, ds:0Fh[rax*4]
mov rcx, rax
and rcx, 0FFFFFFFFFFFFFFF0h
and rax, 0FFFFFFFFFFFFF000h
mov rdx, rsp
sub rdx, rax
loc_11C5:
cmp rsp... | long long func0(long long a1, int a2)
{
signed long long v2; // rax
void *v3; // rsp
_DWORD *v4; // rax
long long i; // rdx
long long v6; // rax
int v7; // ecx
int v8; // r8d
unsigned int v9; // edx
long long v10; // rax
_DWORD v13[2]; // [rsp+8h] [rbp-10h] BYREF
unsigned long long v14; // [rsp+1... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x10
MOV R9D,ESI
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RBP + -0x8],RAX
XOR EAX,EAX
MOVSXD RAX,ESI
LEA RAX,[0xf + RAX*0x4]
MOV RCX,RAX
AND RCX,-0x10
AND RAX,-0x1000
MOV RDX,RSP
SUB RDX,RAX
LAB_001011c5:
CMP RSP,RDX
JZ 0x001011dc
SUB RSP,0x1000
OR qword ptr [RSP + 0xff8],0... | int func0(long param_1,uint param_2)
{
long lVar1;
int4 *puVar2;
ulong uVar3;
long lVar4;
int iVar5;
ulong uVar6;
int1 *puVar7;
long in_FS_OFFSET;
int1 auStack_18 [8];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
uVar6 = (long)(int)param_2 * 4 + 0xf;
for (puVar7 = auStack_18; ... |
6,086 | func0 | #include <stdio.h>
#include <assert.h>
| int func0(int arr[], int n) {
int longest_increasing_subsequence[n];
for (int i = 0; i < n; i++) {
longest_increasing_subsequence[i] = 1;
}
for (int i = 1; i < n; i++) {
for (int j = 0; j < i; j++) {
if (arr[i] > arr[j] && longest_increasing_subsequence[i] < longest_... | int main() {
int arr1[] = {10, 22, 9, 33, 21, 50, 41, 60};
int n1 = sizeof(arr1)/sizeof(arr1[0]);
assert(func0(arr1, n1) == 5);
int arr2[] = {3, 10, 2, 1, 20};
int n2 = sizeof(arr2)/sizeof(arr2[0]);
assert(func0(arr2, n2) == 3);
int arr3[] = {50, 3, 10, 7, 40, 80};
int n3 = s... | O2 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x10,%rsp
mov %fs:0x28,%rax
mov %rax,-0x8(%rbp)
xor %eax,%eax
movslq %esi,%rax
mov %rsp,%rcx
lea 0xf(,%rax,4),%rax
mov %rax,%rdx
and $0xfffffffffffff000,%rax
sub %rax,%rcx
and $0xfffffffffffffff0,%rdx
mov %rcx,%rax
cmp %rax,%rsp
je ... | func0:
endbr64
push rbp
movsxd r10, esi
mov r9, r10
mov rbp, rsp
sub rsp, 10h
mov rax, fs:28h
mov [rbp+var_8], rax
xor eax, eax
lea rax, ds:0Fh[r10*4]
mov rcx, rsp
mov rdx, rax
and rax, 0FFFFFFFFFFFFF000h
sub rcx, rax
and rdx, 0FFFFFFFFFFFFFFF0h
cmp rsp, rcx
jz ... | long long func0(long long a1, int a2)
{
long long v2; // rdx
_DWORD *v3; // rcx
__int16 v4; // dx
signed long long v5; // rdx
void *v6; // rsp
_DWORD *v7; // rax
long long i; // rdx
int v9; // r8d
long long v10; // rax
int v11; // ecx
long long v12; // rax
unsigned int v13; // r8d
_DWORD v16[... | func0:
ENDBR64
PUSH RBP
MOVSXD R10,ESI
MOV R9,R10
MOV RBP,RSP
SUB RSP,0x10
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RBP + -0x8],RAX
XOR EAX,EAX
LEA RAX,[0xf + R10*0x4]
MOV RCX,RSP
MOV RDX,RAX
AND RAX,-0x1000
SUB RCX,RAX
AND RDX,-0x10
CMP RSP,RCX
JZ 0x00101356
LAB_00101341:
SUB RSP,0x1000
OR qword ptr [RSP + 0xff8],0x... | int func0(long param_1,uint param_2)
{
long lVar1;
int1 *puVar2;
int4 *puVar3;
long lVar4;
ulong uVar5;
long lVar6;
int1 *puVar7;
int iVar9;
long in_FS_OFFSET;
int1 auStack_18 [8];
long local_10;
int1 *puVar8;
puVar7 = auStack_18;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
uVar5 = (lon... |
6,087 | func0 | #include <stdio.h>
#include <assert.h>
| int func0(int arr[], int n) {
int longest_increasing_subsequence[n];
for (int i = 0; i < n; i++) {
longest_increasing_subsequence[i] = 1;
}
for (int i = 1; i < n; i++) {
for (int j = 0; j < i; j++) {
if (arr[i] > arr[j] && longest_increasing_subsequence[i] < longest_... | int main() {
int arr1[] = {10, 22, 9, 33, 21, 50, 41, 60};
int n1 = sizeof(arr1)/sizeof(arr1[0]);
assert(func0(arr1, n1) == 5);
int arr2[] = {3, 10, 2, 1, 20};
int n2 = sizeof(arr2)/sizeof(arr2[0]);
assert(func0(arr2, n2) == 3);
int arr3[] = {50, 3, 10, 7, 40, 80};
int n3 = s... | O3 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x10,%rsp
mov %fs:0x28,%rax
mov %rax,-0x8(%rbp)
xor %eax,%eax
movslq %esi,%rax
mov %rsp,%rcx
lea 0xf(,%rax,4),%rax
mov %rax,%rdx
and $0xfffffffffffff000,%rax
sub %rax,%rcx
and $0xfffffffffffffff0,%rdx
mov %rcx,%rax
cmp %rax,%rsp
je ... | func0:
endbr64
push rbp
mov r9d, esi
mov rbp, rsp
push r12
push rbx
sub rsp, 10h
mov rax, fs:28h
mov [rbp+var_18], rax
xor eax, eax
movsxd rax, esi
mov rcx, rsp
lea rax, ds:0Fh[rax*4]
mov rdx, rax
and rax, 0FFFFFFFFFFFFF000h
sub rcx, rax
and rdx, 0FFFFFFFFFFFFFF... | long long func0(long long a1, int a2)
{
long long v2; // rdx
__m128i *v3; // rcx
__int16 v4; // dx
signed long long v5; // rdx
void *v6; // rsp
int *v7; // r11
__m128i si128; // xmm0
__m128i *v9; // rax
long long v10; // rdx
__m128i *v11; // rcx
int v12; // eax
__m128i *v13; // rdx
long long ... | func0:
ENDBR64
PUSH RBP
MOV R9D,ESI
MOV RBP,RSP
PUSH R12
PUSH RBX
SUB RSP,0x10
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RBP + -0x18],RAX
XOR EAX,EAX
MOVSXD RAX,ESI
MOV RCX,RSP
LEA RAX,[0xf + RAX*0x4]
MOV RDX,RAX
AND RAX,-0x1000
SUB RCX,RAX
AND RDX,-0x10
CMP RSP,RCX
JZ 0x00101319
LAB_00101304:
SUB RSP,0x1000
OR qword ... | /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
uint func0(long param_1,uint param_2)
{
int iVar1;
long lVar2;
uint *puVar3;
uint *puVar4;
uint *puVar5;
int *puVar6;
int8 uVar7;
int8 uVar8;
long lVar9;
uint uVar10;
int8 *puVar11;
long lVar12;
uint *puVar1... |
6,088 | func0 |
#include <assert.h>
| int func0(int n) {
int j = 0;
int sm = 0;
for (int i = 1; i <= n; i++) {
j = (2 * i - 1);
sm += (j * j * j * j * j);
}
return sm;
}
| int main() {
assert(func0(1) == 1);
assert(func0(2) == 244);
assert(func0(3) == 3369);
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
mov %edi,-0x14(%rbp)
movl $0x0,-0x4(%rbp)
movl $0x0,-0xc(%rbp)
movl $0x1,-0x8(%rbp)
jmp 118f <func0+0x46>
mov -0x8(%rbp),%eax
add %eax,%eax
sub $0x1,%eax
mov %eax,-0x4(%rbp)
mov -0x4(%rbp),%eax
imul %eax,%eax
imul -0x4(%rbp),%eax
imul -0x4(%rb... | func0:
endbr64
push rbp
mov rbp, rsp
mov [rbp+var_14], edi
mov [rbp+var_4], 0
mov [rbp+var_C], 0
mov [rbp+var_8], 1
jmp short loc_118F
loc_116B:
mov eax, [rbp+var_8]
add eax, eax
sub eax, 1
mov [rbp+var_4], eax
mov eax, [rbp+var_4]
imul eax, eax
imul eax, [rbp+var_4]... | long long func0(int a1)
{
unsigned int v2; // [rsp+8h] [rbp-Ch]
int i; // [rsp+Ch] [rbp-8h]
v2 = 0;
for ( i = 1; i <= a1; ++i )
v2 += (2 * i - 1) * (2 * i - 1) * (2 * i - 1) * (2 * i - 1) * (2 * i - 1);
return v2;
} | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
MOV dword ptr [RBP + -0x14],EDI
MOV dword ptr [RBP + -0x4],0x0
MOV dword ptr [RBP + -0xc],0x0
MOV dword ptr [RBP + -0x8],0x1
JMP 0x0010118f
LAB_0010116b:
MOV EAX,dword ptr [RBP + -0x8]
ADD EAX,EAX
SUB EAX,0x1
MOV dword ptr [RBP + -0x4],EAX
MOV EAX,dword ptr [RBP + -0x4]
IMUL EAX,EAX
... | int func0(int param_1)
{
int iVar1;
int4 local_14;
int4 local_10;
local_14 = 0;
for (local_10 = 1; local_10 <= param_1; local_10 = local_10 + 1) {
iVar1 = local_10 * 2 + -1;
local_14 = local_14 + iVar1 * iVar1 * iVar1 * iVar1 * iVar1;
}
return local_14;
} |
6,089 | func0 |
#include <assert.h>
| int func0(int n) {
int j = 0;
int sm = 0;
for (int i = 1; i <= n; i++) {
j = (2 * i - 1);
sm += (j * j * j * j * j);
}
return sm;
}
| int main() {
assert(func0(1) == 1);
assert(func0(2) == 244);
assert(func0(3) == 3369);
return 0;
}
| O1 | c | func0:
endbr64
test %edi,%edi
jle 1176 <func0+0x2d>
lea 0x1(%rdi,%rdi,1),%esi
mov $0x1,%edx
mov $0x0,%ecx
mov %edx,%eax
imul %edx,%eax
imul %eax,%eax
imul %edx,%eax
add %eax,%ecx
add $0x2,%edx
cmp %esi,%edx
jne 115f <func0+0x16>
mov %ecx,%eax
retq
mov $0x0,%ecx
jmp 1173 <func... | func0:
endbr64
test edi, edi
jle short loc_1176
lea esi, [rdi+rdi+1]
mov edx, 1
mov ecx, 0
loc_115F:
mov eax, edx
imul eax, edx
imul eax, eax
imul eax, edx
add ecx, eax
add edx, 2
cmp edx, esi
jnz short loc_115F
loc_1173:
mov eax, ecx
retn
loc_1176:
mov ecx, 0
jmp... | long long func0(int a1)
{
int v1; // edx
unsigned int v2; // ecx
if ( a1 <= 0 )
{
return 0;
}
else
{
v1 = 1;
v2 = 0;
do
{
v2 += v1 * v1 * v1 * v1 * v1;
v1 += 2;
}
while ( v1 != 2 * a1 + 1 );
}
return v2;
} | func0:
ENDBR64
TEST EDI,EDI
JLE 0x00101176
LEA ESI,[RDI + RDI*0x1 + 0x1]
MOV EDX,0x1
MOV ECX,0x0
LAB_0010115f:
MOV EAX,EDX
IMUL EAX,EDX
IMUL EAX,EAX
IMUL EAX,EDX
ADD ECX,EAX
ADD EDX,0x2
CMP EDX,ESI
JNZ 0x0010115f
LAB_00101173:
MOV EAX,ECX
RET
LAB_00101176:
MOV ECX,0x0
JMP 0x00101173 | int func0(int param_1)
{
int iVar1;
int iVar2;
if (param_1 < 1) {
iVar1 = 0;
}
else {
iVar2 = 1;
iVar1 = 0;
do {
iVar1 = iVar1 + iVar2 * iVar2 * iVar2 * iVar2 * iVar2;
iVar2 = iVar2 + 2;
} while (iVar2 != param_1 * 2 + 1);
}
return iVar1;
} |
6,090 | func0 |
#include <assert.h>
| int func0(int n) {
int j = 0;
int sm = 0;
for (int i = 1; i <= n; i++) {
j = (2 * i - 1);
sm += (j * j * j * j * j);
}
return sm;
}
| int main() {
assert(func0(1) == 1);
assert(func0(2) == 244);
assert(func0(3) == 3369);
return 0;
}
| O2 | c | func0:
endbr64
test %edi,%edi
jle 1178 <func0+0x38>
lea 0x1(%rdi,%rdi,1),%ecx
mov $0x1,%edx
xor %r8d,%r8d
nopl 0x0(%rax)
mov %edx,%eax
imul %edx,%eax
imul %eax,%eax
imul %edx,%eax
add $0x2,%edx
add %eax,%r8d
cmp %edx,%ecx
jne 1158 <func0+0x18>
mov %r8d,%eax
retq
nopl 0x0(%rax)
... | func0:
endbr64
test edi, edi
jle short loc_1228
lea ecx, [rdi+rdi+1]
mov edx, 1
xor r8d, r8d
nop dword ptr [rax+00h]
loc_1208:
mov eax, edx
imul eax, edx
imul eax, eax
imul eax, edx
add edx, 2
add r8d, eax
cmp ecx, edx
jnz short loc_1208
mov eax, r8d
retn
loc_1228... | long long func0(int a1)
{
int v1; // edx
unsigned int v2; // r8d
int v3; // eax
if ( a1 <= 0 )
return 0LL;
v1 = 1;
v2 = 0;
do
{
v3 = v1 * v1 * v1 * v1 * v1;
v1 += 2;
v2 += v3;
}
while ( 2 * a1 + 1 != v1 );
return v2;
} | func0:
ENDBR64
TEST EDI,EDI
JLE 0x00101228
LEA ECX,[RDI + RDI*0x1 + 0x1]
MOV EDX,0x1
XOR R8D,R8D
NOP dword ptr [RAX]
LAB_00101208:
MOV EAX,EDX
IMUL EAX,EDX
IMUL EAX,EAX
IMUL EAX,EDX
ADD EDX,0x2
ADD R8D,EAX
CMP ECX,EDX
JNZ 0x00101208
MOV EAX,R8D
RET
LAB_00101228:
XOR R8D,R8D
MOV EAX,R8D
RET | int func0(int param_1)
{
int iVar1;
int iVar2;
int iVar3;
if (0 < param_1) {
iVar2 = 1;
iVar3 = 0;
do {
iVar1 = iVar2 * iVar2 * iVar2 * iVar2 * iVar2;
iVar2 = iVar2 + 2;
iVar3 = iVar3 + iVar1;
} while (param_1 * 2 + 1 != iVar2);
return iVar3;
}
return 0;
} |
6,091 | func0 |
#include <assert.h>
| int func0(int n) {
int j = 0;
int sm = 0;
for (int i = 1; i <= n; i++) {
j = (2 * i - 1);
sm += (j * j * j * j * j);
}
return sm;
}
| int main() {
assert(func0(1) == 1);
assert(func0(2) == 244);
assert(func0(3) == 3369);
return 0;
}
| O3 | c | func0:
endbr64
test %edi,%edi
jle 1178 <func0+0x38>
lea 0x1(%rdi,%rdi,1),%ecx
mov $0x1,%edx
xor %r8d,%r8d
nopl 0x0(%rax)
mov %edx,%eax
imul %edx,%eax
imul %eax,%eax
imul %edx,%eax
add $0x2,%edx
add %eax,%r8d
cmp %edx,%ecx
jne 1158 <func0+0x18>
mov %r8d,%eax
retq
nopl 0x0(%rax)
... | func0:
endbr64
test edi, edi
jle short loc_1170
lea esi, [rdi+rdi+1]
mov edx, 1
xor ecx, ecx
nop dword ptr [rax+rax+00h]
loc_1158:
mov eax, edx
imul eax, edx
imul eax, eax
imul eax, edx
add edx, 2
add ecx, eax
cmp esi, edx
jnz short loc_1158
mov eax, ecx
retn
loc_... | long long func0(int a1)
{
int v1; // edx
unsigned int v2; // ecx
int v3; // eax
if ( a1 <= 0 )
return 0LL;
v1 = 1;
v2 = 0;
do
{
v3 = v1 * v1 * v1 * v1 * v1;
v1 += 2;
v2 += v3;
}
while ( 2 * a1 + 1 != v1 );
return v2;
} | func0:
ENDBR64
TEST EDI,EDI
JLE 0x00101170
LEA ESI,[RDI + RDI*0x1 + 0x1]
MOV EDX,0x1
XOR ECX,ECX
NOP dword ptr [RAX + RAX*0x1]
LAB_00101158:
MOV EAX,EDX
IMUL EAX,EDX
IMUL EAX,EAX
IMUL EAX,EDX
ADD EDX,0x2
ADD ECX,EAX
CMP ESI,EDX
JNZ 0x00101158
MOV EAX,ECX
RET
LAB_00101170:
XOR ECX,ECX
MOV EAX,ECX
RET | int func0(int param_1)
{
int iVar1;
int iVar2;
int iVar3;
if (0 < param_1) {
iVar3 = 1;
iVar2 = 0;
do {
iVar1 = iVar3 * iVar3 * iVar3 * iVar3 * iVar3;
iVar3 = iVar3 + 2;
iVar2 = iVar2 + iVar1;
} while (param_1 * 2 + 1 != iVar3);
return iVar2;
}
return 0;
} |
6,092 | func0 |
#include <assert.h>
| int func0(int arr[], int low, int high) {
if (high < low)
return arr[0];
if (high == low)
return arr[low];
int mid = low + (high - low) / 2;
if (mid < high && arr[mid + 1] < arr[mid])
return arr[mid];
if (mid > low && arr[mid] < arr[mid - 1])
return arr[mid -... | int main() {
int arr1[] = {2, 3, 5, 6, 9};
int arr2[] = {3, 4, 5, 2, 1};
int arr3[] = {1, 2, 3};
assert(func0(arr1, 0, 4) == 9);
assert(func0(arr2, 0, 4) == 5);
assert(func0(arr3, 0, 2) == 3);
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x20,%rsp
mov %rdi,-0x18(%rbp)
mov %esi,-0x1c(%rbp)
mov %edx,-0x20(%rbp)
mov -0x20(%rbp),%eax
cmp -0x1c(%rbp),%eax
jge 1192 <func0+0x29>
mov -0x18(%rbp),%rax
mov (%rax),%eax
jmpq 12d5 <func0+0x16c>
mov -0x20(%rbp),%eax
cmp -0x1c(%rbp),%... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 20h
mov [rbp+var_18], rdi
mov [rbp+var_1C], esi
mov [rbp+var_20], edx
mov eax, [rbp+var_20]
cmp eax, [rbp+var_1C]
jge short loc_1192
mov rax, [rbp+var_18]
mov eax, [rax]
jmp locret_12D5
loc_1192:
mov eax, [rbp+var_20]
cmp ... | long long func0(unsigned int *a1, signed int a2, signed int a3)
{
int v4; // [rsp+1Ch] [rbp-4h]
if ( a3 < a2 )
return *a1;
if ( a3 == a2 )
return a1[a2];
v4 = (a3 - a2) / 2 + a2;
if ( v4 < a3 && (int)a1[v4 + 1] < (int)a1[v4] )
return a1[v4];
if ( v4 > a2 && (int)a1[v4] < (int)a1[v4 - 1] )
... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x20
MOV qword ptr [RBP + -0x18],RDI
MOV dword ptr [RBP + -0x1c],ESI
MOV dword ptr [RBP + -0x20],EDX
MOV EAX,dword ptr [RBP + -0x20]
CMP EAX,dword ptr [RBP + -0x1c]
JGE 0x00101192
MOV RAX,qword ptr [RBP + -0x18]
MOV EAX,dword ptr [RAX]
JMP 0x001012d5
LAB_00101192:
MOV EAX,dwo... | ulong func0(uint *param_1,int param_2,int param_3)
{
int iVar1;
ulong uVar2;
if (param_3 < param_2) {
uVar2 = (ulong)*param_1;
}
else if (param_3 == param_2) {
uVar2 = (ulong)param_1[param_2];
}
else {
iVar1 = param_2 + (param_3 - param_2) / 2;
if ((iVar1 < param_3) && ((int)param_1[(l... |
6,093 | func0 |
#include <assert.h>
| int func0(int arr[], int low, int high) {
if (high < low)
return arr[0];
if (high == low)
return arr[low];
int mid = low + (high - low) / 2;
if (mid < high && arr[mid + 1] < arr[mid])
return arr[mid];
if (mid > low && arr[mid] < arr[mid - 1])
return arr[mid -... | int main() {
int arr1[] = {2, 3, 5, 6, 9};
int arr2[] = {3, 4, 5, 2, 1};
int arr3[] = {1, 2, 3};
assert(func0(arr1, 0, 4) == 9);
assert(func0(arr2, 0, 4) == 5);
assert(func0(arr3, 0, 2) == 3);
return 0;
}
| O1 | c | func0:
endbr64
cmp %esi,%edx
jl 11cb <func0+0x62>
je 11ce <func0+0x65>
mov %edx,%eax
sub %esi,%eax
mov %eax,%ecx
shr $0x1f,%ecx
add %eax,%ecx
sar %ecx
add %esi,%ecx
cmp %ecx,%edx
jle 1198 <func0+0x2f>
movslq %ecx,%r8
add $0x1,%r8
mov -0x4(%rdi,%r8,4),%eax
cmp %eax,(%rdi,%r... | func0:
endbr64
cmp edx, esi
jl short loc_11CD
mov ecx, edx
jz short loc_11D0
mov eax, edx
sub eax, esi
mov edx, eax
shr edx, 1Fh
add edx, eax
sar edx, 1
add edx, esi
cmp ecx, edx
jle short loc_119A
movsxd r8, edx
add r8, 1
mov eax, [rdi+r8*4-4]
cmp [rdi... | long long func0(unsigned int *a1, long long a2, int a3)
{
int v4; // edx
long long v5; // r8
long long result; // rax
if ( a3 < (int)a2 )
return *a1;
if ( a3 == (_DWORD)a2 )
return a1[(int)a2];
v4 = a2 + (a3 - (int)a2) / 2;
if ( a3 <= v4 || (v5 = v4 + 1LL, result = a1[v5 - 1], (int)a1[v5] >= (in... | func0:
ENDBR64
CMP EDX,ESI
JL 0x001011cd
MOV ECX,EDX
JZ 0x001011d0
MOV EAX,EDX
SUB EAX,ESI
MOV EDX,EAX
SHR EDX,0x1f
ADD EDX,EAX
SAR EDX,0x1
ADD EDX,ESI
CMP ECX,EDX
JLE 0x0010119a
MOVSXD R8,EDX
ADD R8,0x1
MOV EAX,dword ptr [RDI + R8*0x4 + -0x4]
CMP dword ptr [RDI + R8*0x4],EAX
JL 0x001011e3
LAB_0010119a:
CMP ESI,EDX
JGE... | ulong func0(uint *param_1,int8 param_2,int param_3)
{
uint uVar1;
ulong uVar2;
int iVar3;
int iVar4;
iVar4 = (int)param_2;
if (param_3 < iVar4) {
return (ulong)*param_1;
}
if (param_3 != iVar4) {
iVar3 = (param_3 - iVar4) / 2 + iVar4;
if (((param_3 <= iVar3) || (uVar1 = param_1[iVar3], (... |
6,094 | func0 |
#include <assert.h>
| int func0(int arr[], int low, int high) {
if (high < low)
return arr[0];
if (high == low)
return arr[low];
int mid = low + (high - low) / 2;
if (mid < high && arr[mid + 1] < arr[mid])
return arr[mid];
if (mid > low && arr[mid] < arr[mid - 1])
return arr[mid -... | int main() {
int arr1[] = {2, 3, 5, 6, 9};
int arr2[] = {3, 4, 5, 2, 1};
int arr3[] = {1, 2, 3};
assert(func0(arr1, 0, 4) == 9);
assert(func0(arr2, 0, 4) == 5);
assert(func0(arr3, 0, 2) == 3);
return 0;
}
| O2 | c | func0:
endbr64
cmp %edx,%esi
jg 12f2 <func0+0x52>
nopl 0x0(%rax,%rax,1)
je 1308 <func0+0x68>
mov %edx,%eax
sub %esi,%eax
sar %eax
add %esi,%eax
movslq %eax,%rcx
mov (%rdi,%rcx,4),%r8d
lea 0x0(,%rcx,4),%r9
cmp %edx,%eax
jge 12d4 <func0+0x34>
cmp %r8d,0x4(%rdi,%r9,1)
jl 12f5 <f... | func0:
endbr64
mov rcx, rdi
cmp esi, edx
jg short loc_12F2
nop dword ptr [rax+rax+00h]
loc_12B0:
jz short loc_1308
mov eax, edx
sub eax, esi
sar eax, 1
add eax, esi
movsxd rdi, eax
mov r8d, [rcx+rdi*4]
lea r9, ds:0[rdi*4]
cmp eax, edx
jge short loc_12D4
cmp [rc... | long long func0(unsigned int *a1, int a2, int a3)
{
bool v4; // zf
int v5; // eax
signed int v6; // r8d
long long v7; // r9
unsigned int v8; // edi
v4 = a2 == a3;
if ( a2 > a3 )
{
return *a1;
}
else
{
while ( 1 )
{
if ( v4 )
return a1[a2];
v5 = a2 + ((a3 - a2) >> ... | func0:
ENDBR64
MOV RCX,RDI
CMP ESI,EDX
JG 0x001012f2
NOP dword ptr [RAX + RAX*0x1]
LAB_001012b0:
JZ 0x00101308
MOV EAX,EDX
SUB EAX,ESI
SAR EAX,0x1
ADD EAX,ESI
MOVSXD RDI,EAX
MOV R8D,dword ptr [RCX + RDI*0x4]
LEA R9,[RDI*0x4]
CMP EAX,EDX
JGE 0x001012d4
CMP dword ptr [RCX + R9*0x1 + 0x4],R8D
JL 0x001012f5
LAB_001012d4:
C... | int func0(int *param_1,int param_2,int param_3)
{
int iVar1;
int iVar2;
bool bVar3;
bVar3 = param_2 == param_3;
if (param_2 <= param_3) {
do {
if (bVar3) {
return param_1[param_2];
}
iVar2 = (param_3 - param_2 >> 1) + param_2;
iVar1 = param_1[iVar2];
if ((iVar2 < ... |
6,095 | func0 |
#include <assert.h>
| int func0(int arr[], int low, int high) {
if (high < low)
return arr[0];
if (high == low)
return arr[low];
int mid = low + (high - low) / 2;
if (mid < high && arr[mid + 1] < arr[mid])
return arr[mid];
if (mid > low && arr[mid] < arr[mid - 1])
return arr[mid -... | int main() {
int arr1[] = {2, 3, 5, 6, 9};
int arr2[] = {3, 4, 5, 2, 1};
int arr3[] = {1, 2, 3};
assert(func0(arr1, 0, 4) == 9);
assert(func0(arr2, 0, 4) == 5);
assert(func0(arr3, 0, 2) == 3);
return 0;
}
| O3 | c | func0:
endbr64
cmp %edx,%esi
jg 12e2 <func0+0x52>
nopl 0x0(%rax,%rax,1)
je 12f8 <func0+0x68>
mov %edx,%eax
sub %esi,%eax
sar %eax
add %esi,%eax
movslq %eax,%rcx
mov (%rdi,%rcx,4),%r8d
lea 0x0(,%rcx,4),%r9
cmp %edx,%eax
jge 12c4 <func0+0x34>
cmp %r8d,0x4(%rdi,%r9,1)
jl 12e5 <f... | func0:
endbr64
mov rcx, rdi
cmp esi, edx
jg short loc_12D0
nop dword ptr [rax+rax+00h]
loc_1290:
jz short loc_12F0
mov eax, edx
sub eax, esi
sar eax, 1
add eax, esi
movsxd rdi, eax
lea r8, ds:0[rdi*4]
mov edi, [rcx+rdi*4]
cmp eax, edx
jge short loc_12B3
cmp [rc... | long long func0(unsigned int *a1, int a2, int a3)
{
bool i; // zf
int v5; // eax
long long v6; // r8
signed int v7; // edi
unsigned int v9; // r8d
for ( i = a2 == a3; a3 >= a2; i = a3 == a2 )
{
if ( i )
return a1[a2];
v5 = a2 + ((a3 - a2) >> 1);
v6 = v5;
v7 = a1[v6];
if ( v5 < ... | func0:
ENDBR64
MOV RCX,RDI
CMP ESI,EDX
JG 0x001012d0
NOP dword ptr [RAX + RAX*0x1]
LAB_00101290:
JZ 0x001012f0
MOV EAX,EDX
SUB EAX,ESI
SAR EAX,0x1
ADD EAX,ESI
MOVSXD RDI,EAX
LEA R8,[RDI*0x4]
MOV EDI,dword ptr [RCX + RDI*0x4]
CMP EAX,EDX
JGE 0x001012b3
CMP dword ptr [RCX + R8*0x1 + 0x4],EDI
JL 0x001012d2
LAB_001012b3:
C... | int func0(int *param_1,int param_2,int param_3)
{
int iVar1;
int iVar2;
bool bVar3;
bVar3 = param_2 == param_3;
if (param_2 <= param_3) {
do {
if (bVar3) {
return param_1[param_2];
}
iVar2 = (param_3 - param_2 >> 1) + param_2;
iVar1 = param_1[iVar2];
if ((iVar2 < ... |
6,096 | func0 |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
| int* func0(int** list1, int rows, int n) {
int* result = malloc(rows * sizeof(int));
for(int i = 0; i < rows; i++) {
result[i] = list1[i][n];
}
return result;
}
| int main() {
// First test case
int row1_1[] = {1, 2, 3};
int row1_2[] = {2, 4, 5};
int row1_3[] = {1, 1, 1};
int* list1[] = {row1_1, row1_2, row1_3};
int expected1[] = {1, 2, 1};
int* result1 = func0(list1, 3, 0);
for(int i = 0; i < 3; i++) {
assert(result1[i] == expect... | O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x20,%rsp
mov %rdi,-0x18(%rbp)
mov %esi,-0x1c(%rbp)
mov %edx,-0x20(%rbp)
mov -0x1c(%rbp),%eax
cltq
shl $0x2,%rax
mov %rax,%rdi
callq 10b0 <malloc@plt>
mov %rax,-0x8(%rbp)
movl $0x0,-0xc(%rbp)
jmp 121e <func0+0x75>
mov -0xc(%rbp),%eax
cltq... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 20h
mov [rbp+var_18], rdi
mov [rbp+var_1C], esi
mov [rbp+var_20], edx
mov eax, [rbp+var_1C]
cdqe
shl rax, 2
mov rdi, rax; size
call _malloc
mov [rbp+var_8], rax
mov [rbp+var_C], 0
jmp short loc_121E
loc_11DD:
mov eax, [r... | _DWORD * func0(long long a1, int a2, int a3)
{
int i; // [rsp+14h] [rbp-Ch]
_DWORD *v6; // [rsp+18h] [rbp-8h]
v6 = malloc(4LL * a2);
for ( i = 0; i < a2; ++i )
v6[i] = *(_DWORD *)(4LL * a3 + *(_QWORD *)(8LL * i + a1));
return v6;
} | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x20
MOV qword ptr [RBP + -0x18],RDI
MOV dword ptr [RBP + -0x1c],ESI
MOV dword ptr [RBP + -0x20],EDX
MOV EAX,dword ptr [RBP + -0x1c]
CDQE
SHL RAX,0x2
MOV RDI,RAX
CALL 0x001010b0
MOV qword ptr [RBP + -0x8],RAX
MOV dword ptr [RBP + -0xc],0x0
JMP 0x0010121e
LAB_001011dd:
MOV EAX... | void * func0(long param_1,int param_2,int param_3)
{
void *pvVar1;
int4 local_14;
pvVar1 = malloc((long)param_2 << 2);
for (local_14 = 0; local_14 < param_2; local_14 = local_14 + 1) {
*(int4 *)((long)pvVar1 + (long)local_14 * 4) =
*(int4 *)(*(long *)(param_1 + (long)local_14 * 8) + (long)param... |
6,097 | func0 |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
| int* func0(int** list1, int rows, int n) {
int* result = malloc(rows * sizeof(int));
for(int i = 0; i < rows; i++) {
result[i] = list1[i][n];
}
return result;
}
| int main() {
// First test case
int row1_1[] = {1, 2, 3};
int row1_2[] = {2, 4, 5};
int row1_3[] = {1, 1, 1};
int* list1[] = {row1_1, row1_2, row1_3};
int expected1[] = {1, 2, 1};
int* result1 = func0(list1, 3, 0);
for(int i = 0; i < 3; i++) {
assert(result1[i] == expect... | O1 | c | func0:
endbr64
push %r12
push %rbp
push %rbx
mov %rdi,%rbx
mov %esi,%r12d
mov %edx,%ebp
movslq %esi,%rdi
shl $0x2,%rdi
callq 10b0 <malloc@plt>
test %r12d,%r12d
jle 11f1 <func0+0x48>
movslq %ebp,%rsi
shl $0x2,%rsi
lea -0x1(%r12),%edi
mov $0x0,%edx
mov (%rbx,%rdx,8),%rcx
mov (%rcx,%... | func0:
endbr64
push r12
push rbp
push rbx
mov rbp, rdi
mov ebx, esi
mov r12d, edx
movsxd rdi, esi
shl rdi, 2
call _malloc
test ebx, ebx
jle short loc_11EB
movsxd rdi, r12d
shl rdi, 2
mov esi, ebx
mov edx, 0
loc_11D7:
mov rcx, [rbp+rdx*8+0]
mov ecx, [rcx+rdi]
mov ... | long long func0(long long a1, int a2, int a3)
{
long long result; // rax
long long i; // rdx
result = malloc(4LL * a2);
if ( a2 > 0 )
{
for ( i = 0LL; i != a2; ++i )
*(_DWORD *)(result + 4 * i) = *(_DWORD *)(*(_QWORD *)(a1 + 8 * i) + 4LL * a3);
}
return result;
} | func0:
ENDBR64
PUSH R12
PUSH RBP
PUSH RBX
MOV RBP,RDI
MOV EBX,ESI
MOV R12D,EDX
MOVSXD RDI,ESI
SHL RDI,0x2
CALL 0x001010b0
TEST EBX,EBX
JLE 0x001011eb
MOVSXD RDI,R12D
SHL RDI,0x2
MOV ESI,EBX
MOV EDX,0x0
LAB_001011d7:
MOV RCX,qword ptr [RBP + RDX*0x8]
MOV ECX,dword ptr [RCX + RDI*0x1]
MOV dword ptr [RAX + RDX*0x4],ECX
AD... | void func0(long param_1,uint param_2,int param_3)
{
void *pvVar1;
ulong uVar2;
pvVar1 = malloc((long)(int)param_2 << 2);
if (0 < (int)param_2) {
uVar2 = 0;
do {
*(int4 *)((long)pvVar1 + uVar2 * 4) =
*(int4 *)(*(long *)(param_1 + uVar2 * 8) + (long)param_3 * 4);
uVar2 = uVar2 +... |
6,098 | func0 |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
| int* func0(int** list1, int rows, int n) {
int* result = malloc(rows * sizeof(int));
for(int i = 0; i < rows; i++) {
result[i] = list1[i][n];
}
return result;
}
| int main() {
// First test case
int row1_1[] = {1, 2, 3};
int row1_2[] = {2, 4, 5};
int row1_3[] = {1, 1, 1};
int* list1[] = {row1_1, row1_2, row1_3};
int expected1[] = {1, 2, 1};
int* result1 = func0(list1, 3, 0);
for(int i = 0; i < 3; i++) {
assert(result1[i] == expect... | O2 | c | func0:
endbr64
push %r12
push %rbp
mov %rdi,%rbp
movslq %esi,%rdi
push %rbx
mov %rdi,%r12
shl $0x2,%rdi
mov %edx,%ebx
callq 10b0 <malloc@plt>
test %r12d,%r12d
jle 1517 <func0+0x47>
movslq %ebx,%rdi
lea -0x1(%r12),%esi
xor %edx,%edx
shl $0x2,%rdi
mov 0x0(%rbp,%rdx,8),%rcx
mov (%rcx... | func0:
endbr64
push r13
push r12
movsxd r12, esi
push rbp
mov rbp, rdi
lea rdi, ds:0[r12*4]
push rbx
mov ebx, edx
sub rsp, 8
call _malloc
test r12d, r12d
jle short loc_151C
movsxd rsi, ebx
xor edx, edx
shl rsi, 2
nop dword ptr [rax+00000000h]
loc_1508:
mov rcx, [r... | long long func0(long long a1, int a2, int a3)
{
long long result; // rax
long long i; // rdx
result = malloc(4LL * a2);
if ( a2 > 0 )
{
for ( i = 0LL; i != a2; ++i )
*(_DWORD *)(result + 4 * i) = *(_DWORD *)(*(_QWORD *)(a1 + 8 * i) + 4LL * a3);
}
return result;
} | func0:
ENDBR64
PUSH R13
PUSH R12
MOVSXD R12,ESI
PUSH RBP
MOV RBP,RDI
LEA RDI,[R12*0x4]
PUSH RBX
MOV EBX,EDX
SUB RSP,0x8
CALL 0x001010b0
TEST R12D,R12D
JLE 0x0010151c
MOVSXD RSI,EBX
XOR EDX,EDX
SHL RSI,0x2
NOP dword ptr [RAX]
LAB_00101508:
MOV RCX,qword ptr [RBP + RDX*0x8]
MOV ECX,dword ptr [RCX + RSI*0x1]
MOV dword ptr... | void func0(long param_1,int param_2,int param_3)
{
void *pvVar1;
long lVar2;
pvVar1 = malloc((long)param_2 * 4);
if (0 < param_2) {
lVar2 = 0;
do {
*(int4 *)((long)pvVar1 + lVar2 * 4) =
*(int4 *)(*(long *)(param_1 + lVar2 * 8) + (long)param_3 * 4);
lVar2 = lVar2 + 1;
} whi... |
6,099 | func0 |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
| int* func0(int** list1, int rows, int n) {
int* result = malloc(rows * sizeof(int));
for(int i = 0; i < rows; i++) {
result[i] = list1[i][n];
}
return result;
}
| int main() {
// First test case
int row1_1[] = {1, 2, 3};
int row1_2[] = {2, 4, 5};
int row1_3[] = {1, 1, 1};
int* list1[] = {row1_1, row1_2, row1_3};
int expected1[] = {1, 2, 1};
int* result1 = func0(list1, 3, 0);
for(int i = 0; i < 3; i++) {
assert(result1[i] == expect... | O3 | c | func0:
endbr64
push %r12
push %rbp
mov %rdi,%rbp
movslq %esi,%rdi
push %rbx
mov %rdi,%r12
shl $0x2,%rdi
mov %edx,%ebx
callq 10b0 <malloc@plt>
test %r12d,%r12d
jle 1537 <func0+0x47>
movslq %ebx,%rdi
lea -0x1(%r12),%esi
xor %edx,%edx
shl $0x2,%rdi
mov 0x0(%rbp,%rdx,8),%rcx
mov (%rcx... | func0:
endbr64
push r13
push r12
movsxd r12, esi
push rbp
mov rbp, rdi
lea rdi, ds:0[r12*4]; size
push rbx
mov ebx, edx
sub rsp, 8
call _malloc
test r12d, r12d
jle short loc_155C
movsxd rsi, ebx
xor edx, edx
shl rsi, 2
nop dword ptr [rax+00000000h]
loc_1548:
mov r... | _DWORD * func0(long long a1, int a2, int a3)
{
_DWORD *result; // rax
long long i; // rdx
result = malloc(4LL * a2);
if ( a2 > 0 )
{
for ( i = 0LL; i != a2; ++i )
result[i] = *(_DWORD *)(*(_QWORD *)(a1 + 8 * i) + 4LL * a3);
}
return result;
} | func0:
ENDBR64
PUSH R13
PUSH R12
MOVSXD R12,ESI
PUSH RBP
MOV RBP,RDI
LEA RDI,[R12*0x4]
PUSH RBX
MOV EBX,EDX
SUB RSP,0x8
CALL 0x001010b0
TEST R12D,R12D
JLE 0x0010155c
MOVSXD RSI,EBX
XOR EDX,EDX
SHL RSI,0x2
NOP dword ptr [RAX]
LAB_00101548:
MOV RCX,qword ptr [RBP + RDX*0x8]
MOV ECX,dword ptr [RCX + RSI*0x1]
MOV dword ptr... | void func0(long param_1,int param_2,int param_3)
{
void *pvVar1;
long lVar2;
pvVar1 = malloc((long)param_2 * 4);
if (0 < param_2) {
lVar2 = 0;
do {
*(int4 *)((long)pvVar1 + lVar2 * 4) =
*(int4 *)(*(long *)(param_1 + lVar2 * 8) + (long)param_3 * 4);
lVar2 = lVar2 + 1;
} whi... |
6,100 | func0 | #include <assert.h>
#include <stdio.h>
| char* func0(int seq_nums[], int n) {
int diff[n-1];
for (int x = 1; x < n; x++) {
diff[x-1] = seq_nums[x] - seq_nums[x-1];
}
for (int i = 1; i < n-1; i++) {
if (diff[i] != diff[0]) {
return "Non Linear Sequence";
}
}
return "Linear Sequence";
}
| int main() {
int arr1[] = {0, 2, 4, 6, 8, 10};
int arr2[] = {1, 2, 3};
int arr3[] = {1, 5, 2};
assert(func0(arr1, 6) == "Linear Sequence");
assert(func0(arr2, 3) == "Linear Sequence");
assert(func0(arr3, 3) == "Non Linear Sequence");
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
push %rbx
sub $0x38,%rsp
mov %rdi,-0x38(%rbp)
mov %esi,-0x3c(%rbp)
mov %fs:0x28,%rax
mov %rax,-0x18(%rbp)
xor %eax,%eax
mov %rsp,%rax
mov %rax,%rdi
mov -0x3c(%rbp),%eax
sub $0x1,%eax
movslq %eax,%rdx
sub $0x1,%rdx
mov %rdx,-0x28(%rbp)
mov... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 30h
mov [rbp+var_28], rdi
mov [rbp+var_2C], esi
mov rax, fs:28h
mov [rbp+var_8], rax
xor eax, eax
mov rax, rsp
mov rdi, rax
mov eax, [rbp+var_2C]
sub eax, 1
movsxd rdx, eax
sub rdx, 1
mov [rbp+var_18], rdx
cdqe
lea ... | const char * func0(long long a1, int a2)
{
unsigned long long v2; // rax
void *v3; // rsp
_BYTE v5[4]; // [rsp+8h] [rbp-30h] BYREF
int v6; // [rsp+Ch] [rbp-2Ch]
long long v7; // [rsp+10h] [rbp-28h]
int i; // [rsp+18h] [rbp-20h]
int j; // [rsp+1Ch] [rbp-1Ch]
long long v10; // [rsp+20h] [rbp-18h]
_DWORD... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x30
MOV qword ptr [RBP + -0x28],RDI
MOV dword ptr [RBP + -0x2c],ESI
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RBP + -0x8],RAX
XOR EAX,EAX
MOV RAX,RSP
MOV RDI,RAX
MOV EAX,dword ptr [RBP + -0x2c]
SUB EAX,0x1
MOVSXD RDX,EAX
SUB RDX,0x1
MOV qword ptr [RBP + -0x18],RDX
CDQE
LEA ... | char * func0(long param_1,int param_2)
{
long lVar1;
ulong uVar2;
char *pcVar3;
int *puVar4;
long in_FS_OFFSET;
int auStack_38 [4];
int local_34;
long local_30;
int local_28;
int local_24;
long local_20;
int *local_18;
long local_10;
local_30 = param_1;
local_34 = param_2;
local_10 =... |
6,101 | func0 | #include <assert.h>
#include <stdio.h>
| char* func0(int seq_nums[], int n) {
int diff[n-1];
for (int x = 1; x < n; x++) {
diff[x-1] = seq_nums[x] - seq_nums[x-1];
}
for (int i = 1; i < n-1; i++) {
if (diff[i] != diff[0]) {
return "Non Linear Sequence";
}
}
return "Linear Sequence";
}
| int main() {
int arr1[] = {0, 2, 4, 6, 8, 10};
int arr2[] = {1, 2, 3};
int arr3[] = {1, 5, 2};
assert(func0(arr1, 6) == "Linear Sequence");
assert(func0(arr2, 3) == "Linear Sequence");
assert(func0(arr3, 3) == "Non Linear Sequence");
return 0;
}
| O1 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x10,%rsp
mov %fs:0x28,%rax
mov %rax,-0x8(%rbp)
xor %eax,%eax
lea -0x1(%rsi),%r10d
movslq %r10d,%rax
lea 0xf(,%rax,4),%rax
mov %rax,%rdx
and $0xfffffffffffffff0,%rdx
and $0xfffffffffffff000,%rax
mov %rsp,%rcx
sub %rax,%rcx
mov %rcx,%ra... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 10h
mov rcx, rdi
mov r8d, esi
mov rax, fs:28h
mov [rbp+var_8], rax
xor eax, eax
lea r9d, [rsi-1]
movsxd rax, r9d
lea rax, ds:0Fh[rax*4]
mov rsi, rax
and rsi, 0FFFFFFFFFFFFFFF0h
and rax, 0FFFFFFFFFFFFF000h
mov rdx, rsp
... | const char * func0(long long a1, int a2)
{
int v3; // r9d
__int16 v4; // si
signed long long v5; // rax
void *v6; // rsp
long long v7; // rax
const char *result; // rax
int *v9; // rax
long long v10; // [rsp+0h] [rbp-18h]
int v11; // [rsp+8h] [rbp-10h] BYREF
int v12; // [rsp+Ch] [rbp-Ch] BYREF
uns... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x10
MOV RCX,RDI
MOV R8D,ESI
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RBP + -0x8],RAX
XOR EAX,EAX
LEA R9D,[RSI + -0x1]
MOVSXD RAX,R9D
LEA RAX,[0xf + RAX*0x4]
MOV RSI,RAX
AND RSI,-0x10
AND RAX,-0x1000
MOV RDX,RSP
SUB RDX,RAX
LAB_001011ac:
CMP RSP,RDX
JZ 0x001011c3
SUB RSP,0x... | char * func0(long param_1,int param_2)
{
long lVar1;
ulong uVar2;
char *pcVar3;
int *piVar4;
int1 *puVar5;
long in_FS_OFFSET;
int1 auStack_18 [8];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
uVar2 = (long)(param_2 + -1) * 4 + 0xf;
for (puVar5 = auStack_18; puVar5 != auStack_18 + ... |
6,102 | func0 | #include <assert.h>
#include <stdio.h>
| char* func0(int seq_nums[], int n) {
int diff[n-1];
for (int x = 1; x < n; x++) {
diff[x-1] = seq_nums[x] - seq_nums[x-1];
}
for (int i = 1; i < n-1; i++) {
if (diff[i] != diff[0]) {
return "Non Linear Sequence";
}
}
return "Linear Sequence";
}
| int main() {
int arr1[] = {0, 2, 4, 6, 8, 10};
int arr2[] = {1, 2, 3};
int arr3[] = {1, 5, 2};
assert(func0(arr1, 6) == "Linear Sequence");
assert(func0(arr2, 3) == "Linear Sequence");
assert(func0(arr3, 3) == "Non Linear Sequence");
return 0;
}
| O2 | c | func0:
endbr64
push %rbp
lea -0x1(%rsi),%r9d
mov %rsp,%rbp
sub $0x10,%rsp
mov %fs:0x28,%rax
mov %rax,-0x8(%rbp)
xor %eax,%eax
movslq %r9d,%rax
mov %rsp,%rcx
lea 0xf(,%rax,4),%rax
mov %rax,%rdx
and $0xfffffffffffff000,%rax
sub %rax,%rcx
and $0xfffffffffffffff0,%rdx
mov %rcx,%rax
... | func0:
endbr64
push rbp
lea r9d, [rsi-1]
mov r8d, esi
mov rcx, rdi
mov rbp, rsp
sub rsp, 10h
mov rax, fs:28h
mov [rbp+var_8], rax
xor eax, eax
movsxd rax, r9d
mov rsi, rsp
lea rax, ds:0Fh[rax*4]
mov rdx, rax
and rax, 0FFFFFFFFFFFFF000h
sub rsi, rax
and rdx, 0F... | const char * func0(long long a1, int a2)
{
int v2; // r9d
long long v4; // rdx
int *v5; // rsi
__int16 v6; // dx
signed long long v7; // rdx
void *v8; // rsp
long long v9; // rax
const char *result; // rax
_BYTE *v11; // rax
long long v12; // [rsp+0h] [rbp-1018h]
int v13; // [rsp+8h] [rbp-1010h] B... | func0:
ENDBR64
PUSH RBP
LEA R9D,[RSI + -0x1]
MOV R8D,ESI
MOV RCX,RDI
MOV RBP,RSP
SUB RSP,0x10
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RBP + -0x8],RAX
XOR EAX,EAX
MOVSXD RAX,R9D
MOV RSI,RSP
LEA RAX,[0xf + RAX*0x4]
MOV RDX,RAX
AND RAX,-0x1000
SUB RSI,RAX
AND RDX,-0x10
CMP RSP,RSI
JZ 0x0010130d
LAB_001012f8:
SUB RSP,0x... | char * func0(long param_1,int param_2)
{
long lVar1;
int1 *puVar2;
ulong uVar3;
char *pcVar4;
int *piVar5;
int1 *puVar6;
uint uVar8;
long in_FS_OFFSET;
int1 auStack_18 [8];
long local_10;
int1 *puVar7;
uVar8 = param_2 - 1;
puVar6 = auStack_18;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
... |
6,103 | func0 | #include <assert.h>
#include <stdio.h>
| char* func0(int seq_nums[], int n) {
int diff[n-1];
for (int x = 1; x < n; x++) {
diff[x-1] = seq_nums[x] - seq_nums[x-1];
}
for (int i = 1; i < n-1; i++) {
if (diff[i] != diff[0]) {
return "Non Linear Sequence";
}
}
return "Linear Sequence";
}
| int main() {
int arr1[] = {0, 2, 4, 6, 8, 10};
int arr2[] = {1, 2, 3};
int arr3[] = {1, 5, 2};
assert(func0(arr1, 6) == "Linear Sequence");
assert(func0(arr2, 3) == "Linear Sequence");
assert(func0(arr3, 3) == "Non Linear Sequence");
return 0;
}
| O3 | c | func0:
endbr64
push %rbp
lea -0x1(%rsi),%r8d
mov %rsp,%rbp
push %r14
push %rbx
sub $0x10,%rsp
mov %fs:0x28,%rax
mov %rax,-0x18(%rbp)
xor %eax,%eax
movslq %r8d,%rax
mov %rsp,%rbx
lea 0xf(,%rax,4),%rax
mov %rax,%rdx
and $0xfffffffffffff000,%rax
sub %rax,%rbx
and $0xffffffffffffff... | func0:
endbr64
push rbp
lea r9d, [rsi-1]
mov r8d, esi
mov rdx, rdi
mov rbp, rsp
sub rsp, 10h
mov rax, fs:28h
mov [rbp+var_8], rax
xor eax, eax
movsxd rax, r9d
mov rsi, rsp
lea rax, ds:0Fh[rax*4]
mov rcx, rax
and rax, 0FFFFFFFFFFFFF000h
sub rsi, rax
and rcx, 0F... | const char * func0(long long a1, int a2)
{
int v2; // r9d
long long v5; // rcx
int *v6; // rsi
__int16 v7; // cx
signed long long v8; // rcx
void *v9; // rsp
long long v10; // rax
unsigned int v11; // edi
signed int v12; // eax
int v13; // ecx
_BYTE *v14; // rax
long long v16; // [rsp+0h] [rbp-1... | func0:
ENDBR64
PUSH RBP
LEA R9D,[RSI + -0x1]
MOV R8D,ESI
MOV RDX,RDI
MOV RBP,RSP
SUB RSP,0x10
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RBP + -0x8],RAX
XOR EAX,EAX
MOVSXD RAX,R9D
MOV RSI,RSP
LEA RAX,[0xf + RAX*0x4]
MOV RCX,RAX
AND RAX,-0x1000
SUB RSI,RAX
AND RCX,-0x10
CMP RSP,RSI
JZ 0x001012ed
LAB_001012d8:
SUB RSP,0x... | char * func0(long param_1,int param_2)
{
uint uVar1;
int *piVar2;
int *piVar3;
int8 uVar4;
int8 uVar5;
long lVar6;
int iVar7;
int iVar8;
int iVar9;
int iVar10;
int iVar11;
int *puVar12;
int iVar13;
long lVar14;
int *piVar15;
char *pcVar16;
ulong uVar17;
int *puVar18;
uint uVar20;
... |
6,104 | func0 |
#include <assert.h>
#include <math.h>
| float func0(int a, int b) {
int digits = 0;
int temp = b;
if (temp == 0) {
digits = 1;
} else {
while (temp != 0) {
digits++;
temp /= 10;
}
}
return a + b / pow(10, digits);
}
| int main() {
assert(func0(4, 56) == 4.56f);
assert(func0(7, 256) == 7.256f);
assert(func0(8, 123) == 8.123f);
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x30,%rsp
mov %edi,-0x14(%rbp)
mov %esi,-0x18(%rbp)
movl $0x0,-0x8(%rbp)
mov -0x18(%rbp),%eax
mov %eax,-0x4(%rbp)
cmpl $0x0,-0x4(%rbp)
jne 11b9 <func0+0x50>
movl $0x1,-0x8(%rbp)
jmp 11bf <func0+0x56>
addl $0x1,-0x8(%rbp)
mov -0x4(%rbp),%ea... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 30h
mov [rbp+var_14], edi
mov [rbp+var_18], esi
mov [rbp+var_8], 0
mov eax, [rbp+var_18]
mov [rbp+var_4], eax
cmp [rbp+var_4], 0
jnz short loc_11B9
mov [rbp+var_8], 1
jmp short loc_11BF
loc_1197:
add [rbp+var_8], 1
mov ... | float func0(int a1, int a2)
{
int v3; // [rsp+28h] [rbp-8h]
int v4; // [rsp+2Ch] [rbp-4h]
v3 = 0;
v4 = a2;
if ( a2 )
{
while ( v4 )
{
++v3;
v4 /= 10;
}
}
else
{
v3 = 1;
}
return (double)a1 + (double)a2 / pow(10.0, (double)v3);
} | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x30
MOV dword ptr [RBP + -0x14],EDI
MOV dword ptr [RBP + -0x18],ESI
MOV dword ptr [RBP + -0x8],0x0
MOV EAX,dword ptr [RBP + -0x18]
MOV dword ptr [RBP + -0x4],EAX
CMP dword ptr [RBP + -0x4],0x0
JNZ 0x001011b9
MOV dword ptr [RBP + -0x8],0x1
JMP 0x001011bf
LAB_00101197:
ADD dwo... | int8 func0(int param_1,int param_2)
{
double dVar1;
int4 local_10;
int4 local_c;
local_10 = 0;
local_c = param_2;
if (param_2 == 0) {
local_10 = 1;
}
else {
for (; local_c != 0; local_c = local_c / 10) {
local_10 = local_10 + 1;
}
}
dVar1 = pow(DAT_00102078,(double)local_10);
... |
6,105 | func0 |
#include <assert.h>
#include <math.h>
| float func0(int a, int b) {
int digits = 0;
int temp = b;
if (temp == 0) {
digits = 1;
} else {
while (temp != 0) {
digits++;
temp /= 10;
}
}
return a + b / pow(10, digits);
}
| int main() {
assert(func0(4, 56) == 4.56f);
assert(func0(7, 256) == 7.256f);
assert(func0(8, 123) == 8.123f);
return 0;
}
| O1 | c | func0:
endbr64
push %rbp
push %rbx
sub $0x8,%rsp
mov %edi,%ebp
mov %esi,%ebx
mov $0x1,%ecx
test %esi,%esi
je 11a1 <func0+0x38>
mov %esi,%edx
mov $0x0,%ecx
add $0x1,%ecx
movslq %edx,%rax
imul $0x66666667,%rax,%rax
sar $0x22,%rax
sar $0x1f,%edx
sub %edx,%eax
mov %eax,%edx
jne ... | func0:
endbr64
push rbp
push rbx
sub rsp, 8
mov ebp, edi
mov ebx, esi
mov ecx, 1
test esi, esi
jz short loc_11A1
mov edx, esi
mov ecx, 0
loc_1187:
add ecx, 1
movsxd rax, edx
imul rax, 66666667h
sar rax, 22h
sar edx, 1Fh
sub eax, edx
mov edx, eax
jnz shor... | float func0(int a1, int a2)
{
int v2; // ecx
int v3; // edx
v2 = 1;
if ( a2 )
{
v3 = a2;
v2 = 0;
do
{
++v2;
v3 /= 10;
}
while ( v3 );
}
return (double)a2 / pow(10.0, (double)v2) + (double)a1;
} | func0:
ENDBR64
PUSH RBP
PUSH RBX
SUB RSP,0x8
MOV EBP,EDI
MOV EBX,ESI
MOV ECX,0x1
TEST ESI,ESI
JZ 0x001011a1
MOV EDX,ESI
MOV ECX,0x0
LAB_00101187:
ADD ECX,0x1
MOVSXD RAX,EDX
IMUL RAX,RAX,0x66666667
SAR RAX,0x22
SAR EDX,0x1f
SUB EAX,EDX
MOV EDX,EAX
JNZ 0x00101187
LAB_001011a1:
PXOR XMM1,XMM1
CVTSI2SD XMM1,ECX
MOVSD XMM0,... | int8 func0(int param_1,int param_2)
{
int iVar1;
int iVar2;
double dVar3;
iVar1 = 1;
if (param_2 != 0) {
iVar1 = 0;
iVar2 = param_2;
do {
iVar1 = iVar1 + 1;
iVar2 = iVar2 / 10;
} while (iVar2 != 0);
}
dVar3 = pow(DAT_00102070,(double)iVar1);
dVar3 = (double)param_2 / dVar... |
6,106 | func0 |
#include <assert.h>
#include <math.h>
| float func0(int a, int b) {
int digits = 0;
int temp = b;
if (temp == 0) {
digits = 1;
} else {
while (temp != 0) {
digits++;
temp /= 10;
}
}
return a + b / pow(10, digits);
}
| int main() {
assert(func0(4, 56) == 4.56f);
assert(func0(7, 256) == 7.256f);
assert(func0(8, 123) == 8.123f);
return 0;
}
| O2 | c | func0:
endbr64
push %rbp
mov %edi,%ebp
push %rbx
mov %esi,%ebx
sub $0x8,%rsp
movsd 0xe92(%rip),%xmm1
test %esi,%esi
je 11a2 <func0+0x42>
mov %esi,%edx
xor %ecx,%ecx
xchg %ax,%ax
movslq %edx,%rax
sar $0x1f,%edx
add $0x1,%ecx
imul $0x66666667,%rax,%rax
sar $0x22,%rax
sub %edx,%ea... | func0:
endbr64
push rbp
mov ebp, edi
push rbx
mov ebx, esi
sub rsp, 8
movsd xmm1, cs:qword_2070
test esi, esi
jz short loc_1276
mov edx, esi
xor r8d, r8d
nop
loc_1250:
movsxd rax, edx
mov ecx, edx
add r8d, 1
imul rax, 66666667h
sar ecx, 1Fh
sar rax, 22h
sub ea... | float func0(int a1, int a2)
{
double v2; // xmm1_8
int v3; // edx
int v4; // r8d
v2 = 1.0;
if ( a2 )
{
v3 = a2;
v4 = 0;
do
{
++v4;
v3 /= 10;
}
while ( v3 );
v2 = (double)v4;
}
return (double)a2 / pow(10.0, v2) + (double)a1;
} | func0:
ENDBR64
PUSH RBP
MOV EBP,EDI
PUSH RBX
MOV EBX,ESI
SUB RSP,0x8
MOVSD XMM1,qword ptr [0x00102070]
TEST ESI,ESI
JZ 0x00101276
MOV EDX,ESI
XOR R8D,R8D
NOP
LAB_00101250:
MOVSXD RAX,EDX
MOV ECX,EDX
ADD R8D,0x1
IMUL RAX,RAX,0x66666667
SAR ECX,0x1f
SAR RAX,0x22
SUB EAX,ECX
MOV EDX,EAX
JNZ 0x00101250
PXOR XMM1,XMM1
CVTSI... | int8 func0(int param_1,int param_2)
{
int iVar1;
int iVar2;
double dVar3;
dVar3 = DAT_00102070;
if (param_2 != 0) {
iVar2 = 0;
iVar1 = param_2;
do {
iVar2 = iVar2 + 1;
iVar1 = iVar1 / 10;
} while (iVar1 != 0);
dVar3 = (double)iVar2;
}
dVar3 = pow(DAT_00102078,dVar3);
... |
6,107 | func0 |
#include <assert.h>
#include <math.h>
| float func0(int a, int b) {
int digits = 0;
int temp = b;
if (temp == 0) {
digits = 1;
} else {
while (temp != 0) {
digits++;
temp /= 10;
}
}
return a + b / pow(10, digits);
}
| int main() {
assert(func0(4, 56) == 4.56f);
assert(func0(7, 256) == 7.256f);
assert(func0(8, 123) == 8.123f);
return 0;
}
| O3 | c | func0:
endbr64
push %rbp
mov %edi,%ebp
push %rbx
mov %esi,%ebx
sub $0x8,%rsp
movsd 0xe92(%rip),%xmm1
test %esi,%esi
je 11a2 <func0+0x42>
mov %esi,%edx
xor %ecx,%ecx
xchg %ax,%ax
movslq %edx,%rax
sar $0x1f,%edx
add $0x1,%ecx
imul $0x66666667,%rax,%rax
sar $0x22,%rax
sub %edx,%ea... | func0:
endbr64
push rbp
mov ebp, edi
push rbx
mov ebx, esi
sub rsp, 8
movsd xmm1, cs:qword_2008
test esi, esi
jz short loc_11A6
mov edx, esi
xor r8d, r8d
nop
loc_1180:
movsxd rax, edx
mov ecx, edx
add r8d, 1
imul rax, 66666667h
sar ecx, 1Fh
sar rax, 22h
sub ea... | float func0(int a1, int a2)
{
double v2; // xmm1_8
int v3; // edx
int v4; // r8d
v2 = 1.0;
if ( a2 )
{
v3 = a2;
v4 = 0;
do
{
++v4;
v3 /= 10;
}
while ( v3 );
v2 = (double)v4;
}
return (double)a2 / pow(10.0, v2) + (double)a1;
} | func0:
ENDBR64
PUSH RBP
MOV EBP,EDI
PUSH RBX
MOV EBX,ESI
SUB RSP,0x8
MOVSD XMM1,qword ptr [0x00102008]
TEST ESI,ESI
JZ 0x001011a6
MOV EDX,ESI
XOR R8D,R8D
NOP
LAB_00101180:
MOVSXD RAX,EDX
MOV ECX,EDX
ADD R8D,0x1
IMUL RAX,RAX,0x66666667
SAR ECX,0x1f
SAR RAX,0x22
SUB EAX,ECX
MOV EDX,EAX
JNZ 0x00101180
PXOR XMM1,XMM1
CVTSI... | int8 func0(int param_1,int param_2)
{
int iVar1;
int iVar2;
double dVar3;
dVar3 = DAT_00102008;
if (param_2 != 0) {
iVar2 = 0;
iVar1 = param_2;
do {
iVar2 = iVar2 + 1;
iVar1 = iVar1 / 10;
} while (iVar1 != 0);
dVar3 = (double)iVar2;
}
dVar3 = pow(DAT_00102010,dVar3);
... |
6,108 | func0 |
#include <assert.h>
#include <stdio.h>
| int* func0(int list[], int length, int* odd_length) {
static int od_li[100];
int j = 0;
for (int i = 0; i < length; i++) {
if (list[i] % 2 != 0) {
od_li[j++] = list[i];
}
}
*odd_length = j;
return od_li;
}
| int main() {
int list1[] = {1, 2, 3, 4, 5, 6};
int list2[] = {10, 11, 12, 13};
int list3[] = {7, 8, 9, 1};
int length1, length2, length3;
int* res;
res = func0(list1, 6, &length1);
assert(length1 == 3 && res[0] == 1 && res[1] == 3 && res[2] == 5);
res = func0(list2, 4, &lengt... | O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
mov %rdi,-0x18(%rbp)
mov %esi,-0x1c(%rbp)
mov %rdx,-0x28(%rbp)
movl $0x0,-0x8(%rbp)
movl $0x0,-0x4(%rbp)
jmp 1201 <func0+0x78>
mov -0x4(%rbp),%eax
cltq
lea 0x0(,%rax,4),%rdx
mov -0x18(%rbp),%rax
add %rdx,%rax
mov (%rax),%eax
and $0x1,%eax
tes... | func0:
endbr64
push rbp
mov rbp, rsp
mov [rbp+var_18], rdi
mov [rbp+var_1C], esi
mov [rbp+var_28], rdx
mov [rbp+var_8], 0
mov [rbp+var_4], 0
jmp short loc_1201
loc_11AC:
mov eax, [rbp+var_4]
cdqe
lea rdx, ds:0[rax*4]
mov rax, [rbp+var_18]
add rax, rdx
mov eax, [rax]
an... | _DWORD * func0(long long a1, int a2, _DWORD *a3)
{
int v3; // eax
int v5; // [rsp+20h] [rbp-8h]
int i; // [rsp+24h] [rbp-4h]
v5 = 0;
for ( i = 0; i < a2; ++i )
{
if ( (*(_DWORD *)(4LL * i + a1) & 1) != 0 )
{
v3 = v5++;
od_li_1[v3] = *(_DWORD *)(4LL * i + a1);
}
}
*a3 = v5;
ret... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
MOV qword ptr [RBP + -0x18],RDI
MOV dword ptr [RBP + -0x1c],ESI
MOV qword ptr [RBP + -0x28],RDX
MOV dword ptr [RBP + -0x8],0x0
MOV dword ptr [RBP + -0x4],0x0
JMP 0x00101201
LAB_001011ac:
MOV EAX,dword ptr [RBP + -0x4]
CDQE
LEA RDX,[RAX*0x4]
MOV RAX,qword ptr [RBP + -0x18]
ADD RAX,RDX... | int1 * func0(long param_1,int param_2,int *param_3)
{
int local_10;
int local_c;
local_10 = 0;
for (local_c = 0; local_c < param_2; local_c = local_c + 1) {
if ((*(uint *)(param_1 + (long)local_c * 4) & 1) != 0) {
*(int4 *)(od_li_1 + (long)local_10 * 4) = *(int4 *)((long)local_c * 4 + param_1);
... |
6,109 | func0 |
#include <assert.h>
#include <stdio.h>
| int* func0(int list[], int length, int* odd_length) {
static int od_li[100];
int j = 0;
for (int i = 0; i < length; i++) {
if (list[i] % 2 != 0) {
od_li[j++] = list[i];
}
}
*odd_length = j;
return od_li;
}
| int main() {
int list1[] = {1, 2, 3, 4, 5, 6};
int list2[] = {10, 11, 12, 13};
int list3[] = {7, 8, 9, 1};
int length1, length2, length3;
int* res;
res = func0(list1, 6, &length1);
assert(length1 == 3 && res[0] == 1 && res[1] == 3 && res[2] == 5);
res = func0(list2, 4, &lengt... | O1 | c | func0:
endbr64
test %esi,%esi
jle 11c6 <func0+0x3d>
mov %rdi,%rax
lea -0x1(%rsi),%ecx
lea 0x4(%rdi,%rcx,4),%rdi
mov $0x0,%esi
lea 0x2e98(%rip),%r9
jmp 11b3 <func0+0x2a>
add $0x4,%rax
cmp %rdi,%rax
je 11cb <func0+0x42>
mov (%rax),%ecx
test $0x1,%cl
je 11aa <func0+0x21>
movslq %e... | func0:
endbr64
test esi, esi
jle short loc_11C6
mov rax, rdi
lea ecx, [rsi-1]
lea rdi, [rdi+rcx*4+4]
mov esi, 0
lea r9, od_li_1
jmp short loc_11B3
loc_11AA:
add rax, 4
cmp rax, rdi
jz short loc_11CB
loc_11B3:
mov ecx, [rax]
test cl, 1
jz short loc_11AA
movsxd r8,... | _DWORD * func0(_DWORD *a1, int a2, _DWORD *a3)
{
_DWORD *v3; // rax
long long v4; // rdi
int v5; // esi
if ( a2 <= 0 )
{
v5 = 0;
}
else
{
v3 = a1;
v4 = (long long)&a1[a2 - 1 + 1];
v5 = 0;
do
{
if ( (*v3 & 1) != 0 )
od_li_1[v5++] = *v3;
++v3;
}
while (... | func0:
ENDBR64
TEST ESI,ESI
JLE 0x001011c6
MOV RAX,RDI
LEA ECX,[RSI + -0x1]
LEA RDI,[RDI + RCX*0x4 + 0x4]
MOV ESI,0x0
LEA R9,[0x104040]
JMP 0x001011b3
LAB_001011aa:
ADD RAX,0x4
CMP RAX,RDI
JZ 0x001011cb
LAB_001011b3:
MOV ECX,dword ptr [RAX]
TEST CL,0x1
JZ 0x001011aa
MOVSXD R8,ESI
MOV dword ptr [R9 + R8*0x4],ECX
LEA ESI... | int4 * func0(uint *param_1,int param_2,int *param_3)
{
uint *puVar1;
int iVar2;
if (param_2 < 1) {
iVar2 = 0;
}
else {
puVar1 = param_1 + (ulong)(param_2 - 1) + 1;
iVar2 = 0;
do {
if ((*param_1 & 1) != 0) {
(&od_li_1)[iVar2] = *param_1;
iVar2 = iVar2 + 1;
}
... |
6,110 | func0 |
#include <assert.h>
#include <stdio.h>
| int* func0(int list[], int length, int* odd_length) {
static int od_li[100];
int j = 0;
for (int i = 0; i < length; i++) {
if (list[i] % 2 != 0) {
od_li[j++] = list[i];
}
}
*odd_length = j;
return od_li;
}
| int main() {
int list1[] = {1, 2, 3, 4, 5, 6};
int list2[] = {10, 11, 12, 13};
int list3[] = {7, 8, 9, 1};
int length1, length2, length3;
int* res;
res = func0(list1, 6, &length1);
assert(length1 == 3 && res[0] == 1 && res[1] == 3 && res[2] == 5);
res = func0(list2, 4, &lengt... | O2 | c | func0:
endbr64
test %esi,%esi
jle 13c8 <func0+0x48>
lea -0x1(%rsi),%eax
xor %ecx,%ecx
lea 0x2cac(%rip),%r9
lea 0x4(%rdi,%rax,4),%rsi
nopl 0x0(%rax)
mov (%rdi),%eax
test $0x1,%al
je 13b0 <func0+0x30>
movslq %ecx,%r8
add $0x1,%ecx
mov %eax,(%r9,%r8,4)
add $0x4,%rdi
cmp %rsi,%rdi
jn... | func0:
endbr64
test esi, esi
jle short loc_1370
lea eax, [rsi-1]
xor ecx, ecx
lea r9, od_li_1
lea rsi, [rdi+rax*4+4]
nop dword ptr [rax+00000000h]
loc_1350:
mov eax, [rdi]
test al, 1
jz short loc_1360
movsxd r8, ecx
add ecx, 1
mov [r9+r8*4], eax
loc_1360:
add rdi, 4
c... | _DWORD * func0(_DWORD *a1, int a2, _DWORD *a3)
{
int v3; // ecx
long long v4; // rsi
long long v5; // r8
if ( a2 <= 0 )
{
*a3 = 0;
return od_li_1;
}
else
{
v3 = 0;
v4 = (long long)&a1[a2 - 1 + 1];
do
{
if ( (*a1 & 1) != 0 )
{
v5 = v3++;
od_li_1[v5] = ... | func0:
ENDBR64
TEST ESI,ESI
JLE 0x00101370
LEA EAX,[RSI + -0x1]
XOR ECX,ECX
LEA R9,[0x104040]
LEA RSI,[RDI + RAX*0x4 + 0x4]
NOP dword ptr [RAX]
LAB_00101350:
MOV EAX,dword ptr [RDI]
TEST AL,0x1
JZ 0x00101360
MOVSXD R8,ECX
ADD ECX,0x1
MOV dword ptr [R9 + R8*0x4],EAX
LAB_00101360:
ADD RDI,0x4
CMP RDI,RSI
JNZ 0x00101350
M... | int4 * func0(uint *param_1,int param_2,int *param_3)
{
uint *puVar1;
int iVar2;
long lVar3;
if (0 < param_2) {
iVar2 = 0;
puVar1 = param_1 + (ulong)(param_2 - 1) + 1;
do {
if ((*param_1 & 1) != 0) {
lVar3 = (long)iVar2;
iVar2 = iVar2 + 1;
(&od_li_1)[lVar3] = *param_... |
6,111 | func0 |
#include <assert.h>
#include <stdio.h>
| int* func0(int list[], int length, int* odd_length) {
static int od_li[100];
int j = 0;
for (int i = 0; i < length; i++) {
if (list[i] % 2 != 0) {
od_li[j++] = list[i];
}
}
*odd_length = j;
return od_li;
}
| int main() {
int list1[] = {1, 2, 3, 4, 5, 6};
int list2[] = {10, 11, 12, 13};
int list3[] = {7, 8, 9, 1};
int length1, length2, length3;
int* res;
res = func0(list1, 6, &length1);
assert(length1 == 3 && res[0] == 1 && res[1] == 3 && res[2] == 5);
res = func0(list2, 4, &lengt... | O3 | c | func0:
endbr64
test %esi,%esi
jle 1438 <func0+0x48>
lea -0x1(%rsi),%eax
xor %ecx,%ecx
lea 0x2c3c(%rip),%r9
lea 0x4(%rdi,%rax,4),%rsi
nopl 0x0(%rax)
mov (%rdi),%eax
test $0x1,%al
je 1420 <func0+0x30>
movslq %ecx,%r8
add $0x1,%ecx
mov %eax,(%r9,%r8,4)
add $0x4,%rdi
cmp %rsi,%rdi
jn... | func0:
endbr64
test esi, esi
jle short loc_11D0
movsxd rsi, esi
xor ecx, ecx
lea r9, od_li_1
lea rsi, [rdi+rsi*4]
nop dword ptr [rax+rax+00000000h]
loc_11B0:
mov eax, [rdi]
test al, 1
jz short loc_11C0
movsxd r8, ecx
add ecx, 1
mov [r9+r8*4], eax
loc_11C0:
add rdi, 4
cmp... | long long * func0(_DWORD *a1, int a2, _DWORD *a3)
{
int v3; // ecx
_DWORD *v4; // rsi
long long v5; // r8
if ( a2 <= 0 )
{
*a3 = 0;
return &od_li_1;
}
else
{
v3 = 0;
v4 = &a1[a2];
do
{
if ( (*a1 & 1) != 0 )
{
v5 = v3++;
*((_DWORD *)&od_li_1 + v5) = *a... | func0:
ENDBR64
TEST ESI,ESI
JLE 0x001011d0
MOVSXD RSI,ESI
XOR ECX,ECX
LEA R9,[0x104040]
LEA RSI,[RDI + RSI*0x4]
NOP dword ptr [RAX + RAX*0x1]
LAB_001011b0:
MOV EAX,dword ptr [RDI]
TEST AL,0x1
JZ 0x001011c0
MOVSXD R8,ECX
ADD ECX,0x1
MOV dword ptr [R9 + R8*0x4],EAX
LAB_001011c0:
ADD RDI,0x4
CMP RDI,RSI
JNZ 0x001011b0
MOV... | int4 * func0(uint *param_1,int param_2,int *param_3)
{
uint *puVar1;
int iVar2;
long lVar3;
if (0 < param_2) {
iVar2 = 0;
puVar1 = param_1 + param_2;
do {
if ((*param_1 & 1) != 0) {
lVar3 = (long)iVar2;
iVar2 = iVar2 + 1;
(&od_li_1)[lVar3] = *param_1;
}
... |
6,112 | func0 |
#include <assert.h>
| int func0(int n) {
int S = (n * (n + 1)) / 2;
int res = S * (S - 1);
return res;
}
| int main() {
assert(func0(3) == 30);
assert(func0(5) == 210);
assert(func0(2) == 6);
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
mov %edi,-0x14(%rbp)
mov -0x14(%rbp),%eax
add $0x1,%eax
imul -0x14(%rbp),%eax
mov %eax,%edx
shr $0x1f,%edx
add %edx,%eax
sar %eax
mov %eax,-0x8(%rbp)
mov -0x8(%rbp),%eax
lea -0x1(%rax),%edx
mov -0x8(%rbp),%eax
imul %edx,%eax
mov %eax,-0... | func0:
endbr64
push rbp
mov rbp, rsp
mov [rbp+var_14], edi
mov eax, [rbp+var_14]
add eax, 1
imul eax, [rbp+var_14]
mov edx, eax
shr edx, 1Fh
add eax, edx
sar eax, 1
mov [rbp+var_8], eax
mov eax, [rbp+var_8]
lea edx, [rax-1]
mov eax, [rbp+var_8]
imul eax, edx
mov ... | long long func0(int a1)
{
return (unsigned int)((a1 * (a1 + 1) / 2 - 1) * (a1 * (a1 + 1) / 2));
} | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
MOV dword ptr [RBP + -0x14],EDI
MOV EAX,dword ptr [RBP + -0x14]
ADD EAX,0x1
IMUL EAX,dword ptr [RBP + -0x14]
MOV EDX,EAX
SHR EDX,0x1f
ADD EAX,EDX
SAR EAX,0x1
MOV dword ptr [RBP + -0x8],EAX
MOV EAX,dword ptr [RBP + -0x8]
LEA EDX,[RAX + -0x1]
MOV EAX,dword ptr [RBP + -0x8]
IMUL EAX,EDX... | int func0(int param_1)
{
int iVar1;
iVar1 = ((param_1 + 1) * param_1) / 2;
return iVar1 * (iVar1 + -1);
} |
6,113 | func0 |
#include <assert.h>
| int func0(int n) {
int S = (n * (n + 1)) / 2;
int res = S * (S - 1);
return res;
}
| int main() {
assert(func0(3) == 30);
assert(func0(5) == 210);
assert(func0(2) == 6);
return 0;
}
| O1 | c | func0:
endbr64
lea 0x1(%rdi),%eax
imul %eax,%edi
mov %edi,%eax
shr $0x1f,%eax
add %edi,%eax
sar %eax
lea -0x1(%rax),%edi
imul %edi,%eax
retq
| func0:
endbr64
lea eax, [rdi+1]
imul eax, edi
mov edx, eax
shr edx, 1Fh
add edx, eax
sar edx, 1
lea eax, [rdx-1]
imul eax, edx
retn | long long func0(int a1)
{
return (unsigned int)(a1 * (a1 + 1) / 2 * (a1 * (a1 + 1) / 2 - 1));
} | func0:
ENDBR64
LEA EAX,[RDI + 0x1]
IMUL EAX,EDI
MOV EDX,EAX
SHR EDX,0x1f
ADD EDX,EAX
SAR EDX,0x1
LEA EAX,[RDX + -0x1]
IMUL EAX,EDX
RET | int func0(int param_1)
{
int iVar1;
iVar1 = ((param_1 + 1) * param_1) / 2;
return (iVar1 + -1) * iVar1;
} |
6,114 | func0 |
#include <assert.h>
| int func0(int n) {
int S = (n * (n + 1)) / 2;
int res = S * (S - 1);
return res;
}
| int main() {
assert(func0(3) == 30);
assert(func0(5) == 210);
assert(func0(2) == 6);
return 0;
}
| O2 | c | func0:
endbr64
lea 0x1(%rdi),%eax
imul %eax,%edi
mov %edi,%eax
shr $0x1f,%eax
add %edi,%eax
sar %eax
lea -0x1(%rax),%edi
imul %edi,%eax
retq
nopw 0x0(%rax,%rax,1)
| func0:
endbr64
lea eax, [rdi+1]
imul eax, edi
mov edx, eax
shr edx, 1Fh
add edx, eax
sar edx, 1
lea eax, [rdx-1]
imul eax, edx
retn | long long func0(int a1)
{
return (unsigned int)(a1 * (a1 + 1) / 2 * (a1 * (a1 + 1) / 2 - 1));
} | func0:
ENDBR64
LEA EAX,[RDI + 0x1]
IMUL EAX,EDI
MOV EDX,EAX
SHR EDX,0x1f
ADD EDX,EAX
SAR EDX,0x1
LEA EAX,[RDX + -0x1]
IMUL EAX,EDX
RET | int func0(int param_1)
{
int iVar1;
iVar1 = ((param_1 + 1) * param_1) / 2;
return (iVar1 + -1) * iVar1;
} |
6,115 | func0 |
#include <assert.h>
| int func0(int n) {
int S = (n * (n + 1)) / 2;
int res = S * (S - 1);
return res;
}
| int main() {
assert(func0(3) == 30);
assert(func0(5) == 210);
assert(func0(2) == 6);
return 0;
}
| O3 | c | func0:
endbr64
lea 0x1(%rdi),%eax
imul %eax,%edi
mov %edi,%eax
shr $0x1f,%eax
add %edi,%eax
sar %eax
lea -0x1(%rax),%edi
imul %edi,%eax
retq
nopw 0x0(%rax,%rax,1)
| func0:
endbr64
lea eax, [rdi+1]
imul eax, edi
mov edx, eax
shr edx, 1Fh
add edx, eax
sar edx, 1
lea eax, [rdx-1]
imul eax, edx
retn | long long func0(int a1)
{
return (unsigned int)(a1 * (a1 + 1) / 2 * (a1 * (a1 + 1) / 2 - 1));
} | func0:
ENDBR64
LEA EAX,[RDI + 0x1]
IMUL EAX,EDI
MOV EDX,EAX
SHR EDX,0x1f
ADD EDX,EAX
SAR EDX,0x1
LEA EAX,[RDX + -0x1]
IMUL EAX,EDX
RET | int func0(int param_1)
{
int iVar1;
iVar1 = ((param_1 + 1) * param_1) / 2;
return (iVar1 + -1) * iVar1;
} |
6,116 | func0 |
#include <assert.h>
| int func0(int A[], int N) {
int oddPair = 0;
for (int i = 0; i < N; i++) {
for (int j = i + 1; j < N; j++) {
if ((A[i] ^ A[j]) % 2 != 0) {
oddPair++;
}
}
}
return oddPair;
}
| int main() {
int array1[] = {5, 4, 7, 2, 1};
int array2[] = {7, 2, 8, 1, 0, 5, 11};
int array3[] = {1, 2, 3};
assert(func0(array1, 5) == 6);
assert(func0(array2, 7) == 12);
assert(func0(array3, 3) == 2);
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
mov %rdi,-0x18(%rbp)
mov %esi,-0x1c(%rbp)
movl $0x0,-0xc(%rbp)
movl $0x0,-0x8(%rbp)
jmp 11dc <func0+0x73>
mov -0x8(%rbp),%eax
add $0x1,%eax
mov %eax,-0x4(%rbp)
jmp 11d0 <func0+0x67>
mov -0x8(%rbp),%eax
cltq
lea 0x0(,%rax,4),%rdx
mov -0x18(%rb... | func0:
endbr64
push rbp
mov rbp, rsp
mov [rbp+var_18], rdi
mov [rbp+var_1C], esi
mov [rbp+var_C], 0
mov [rbp+var_8], 0
jmp short loc_11DC
loc_1188:
mov eax, [rbp+var_8]
add eax, 1
mov [rbp+var_4], eax
jmp short loc_11D0
loc_1193:
mov eax, [rbp+var_8]
cdqe
lea rdx, ds:0... | long long func0(long long a1, int a2)
{
unsigned int v3; // [rsp+10h] [rbp-Ch]
int i; // [rsp+14h] [rbp-8h]
int j; // [rsp+18h] [rbp-4h]
v3 = 0;
for ( i = 0; i < a2; ++i )
{
for ( j = i + 1; j < a2; ++j )
{
if ( (((unsigned __int8)*(_DWORD *)(4LL * i + a1) ^ (unsigned __int8)*(_DWORD *)(4LL ... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
MOV qword ptr [RBP + -0x18],RDI
MOV dword ptr [RBP + -0x1c],ESI
MOV dword ptr [RBP + -0xc],0x0
MOV dword ptr [RBP + -0x8],0x0
JMP 0x001011dc
LAB_00101188:
MOV EAX,dword ptr [RBP + -0x8]
ADD EAX,0x1
MOV dword ptr [RBP + -0x4],EAX
JMP 0x001011d0
LAB_00101193:
MOV EAX,dword ptr [RBP + -... | int func0(long param_1,int param_2)
{
int4 local_14;
int4 local_10;
int4 local_c;
local_14 = 0;
for (local_10 = 0; local_c = local_10, local_10 < param_2; local_10 = local_10 + 1) {
while (local_c = local_c + 1, local_c < param_2) {
if (((*(uint *)(param_1 + (long)local_c * 4) ^ *(uint *)(param_... |
6,117 | func0 |
#include <assert.h>
| int func0(int A[], int N) {
int oddPair = 0;
for (int i = 0; i < N; i++) {
for (int j = i + 1; j < N; j++) {
if ((A[i] ^ A[j]) % 2 != 0) {
oddPair++;
}
}
}
return oddPair;
}
| int main() {
int array1[] = {5, 4, 7, 2, 1};
int array2[] = {7, 2, 8, 1, 0, 5, 11};
int array3[] = {1, 2, 3};
assert(func0(array1, 5) == 6);
assert(func0(array2, 7) == 12);
assert(func0(array3, 3) == 2);
return 0;
}
| O1 | c | func0:
endbr64
test %esi,%esi
jle 11ae <func0+0x45>
lea -0x1(%rsi),%r10d
add $0x1,%r10
mov $0x1,%r9d
mov $0x0,%ecx
cmp %r10,%r9
je 11b3 <func0+0x4a>
mov -0x4(%rdi,%r9,4),%r8d
mov %r9,%rax
mov %r8d,%edx
xor (%rdi,%rax,4),%edx
and $0x1,%edx
cmp $0x1,%edx
sbb $0xffffffff,%ecx
a... | func0:
endbr64
test esi, esi
jle short loc_11A9
mov r10d, esi
mov r9d, 1
mov ecx, 0
loc_117F:
cmp r9, r10
jz short loc_11AE
mov r8d, [rdi+r9*4-4]
mov rax, r9
loc_118C:
mov edx, r8d
xor edx, [rdi+rax*4]
and edx, 1
cmp edx, 1
sbb ecx, 0FFFFFFFFh
add rax, 1
cmp ... | long long func0(long long a1, int a2)
{
long long v2; // r9
unsigned int v3; // ecx
long long v4; // rax
if ( a2 <= 0 )
{
return 0;
}
else
{
v2 = 1LL;
v3 = 0;
while ( v2 != a2 )
{
v4 = v2;
do
v3 -= (((*(_DWORD *)(a1 + 4 * v4++) ^ *(_DWORD *)(a1 + 4 * v2 - 4)) & ... | func0:
ENDBR64
TEST ESI,ESI
JLE 0x001011a9
MOV R10D,ESI
MOV R9D,0x1
MOV ECX,0x0
LAB_0010117f:
CMP R9,R10
JZ 0x001011ae
MOV R8D,dword ptr [RDI + R9*0x4 + -0x4]
MOV RAX,R9
LAB_0010118c:
MOV EDX,R8D
XOR EDX,dword ptr [RDI + RAX*0x4]
AND EDX,0x1
CMP EDX,0x1
SBB ECX,-0x1
ADD RAX,0x1
CMP ESI,EAX
JG 0x0010118c
ADD R9,0x1
JMP ... | int func0(long param_1,uint param_2)
{
ulong uVar1;
int iVar2;
ulong uVar3;
if ((int)param_2 < 1) {
iVar2 = 0;
}
else {
iVar2 = 0;
for (uVar3 = 1; uVar3 != param_2; uVar3 = uVar3 + 1) {
uVar1 = uVar3;
do {
iVar2 = (iVar2 + 1) -
(uint)(((*(uint *)(param_1 +... |
6,118 | func0 |
#include <assert.h>
| int func0(int A[], int N) {
int oddPair = 0;
for (int i = 0; i < N; i++) {
for (int j = i + 1; j < N; j++) {
if ((A[i] ^ A[j]) % 2 != 0) {
oddPair++;
}
}
}
return oddPair;
}
| int main() {
int array1[] = {5, 4, 7, 2, 1};
int array2[] = {7, 2, 8, 1, 0, 5, 11};
int array3[] = {1, 2, 3};
assert(func0(array1, 5) == 6);
assert(func0(array2, 7) == 12);
assert(func0(array3, 3) == 2);
return 0;
}
| O2 | c | func0:
endbr64
test %esi,%esi
jle 13c4 <func0+0x54>
lea -0x1(%rsi),%r10d
mov $0x1,%r9d
xor %r8d,%r8d
add $0x1,%r10
cmp %r10,%r9
je 13c0 <func0+0x50>
xchg %ax,%ax
mov -0x4(%rdi,%r9,4),%ecx
mov %r9,%rax
nopl 0x0(%rax,%rax,1)
mov (%rdi,%rax,4),%edx
xor %ecx,%edx
and $0x1,%edx
cmp... | func0:
endbr64
test esi, esi
jle short loc_1304
movsxd r10, esi
mov r9d, 1
xor r8d, r8d
cmp r9, r10
jz short loc_1300
nop dword ptr [rax+00000000h]
loc_12D0:
mov ecx, [rdi+r9*4-4]
mov rax, r9
nop dword ptr [rax+rax+00000000h]
loc_12E0:
mov edx, [rdi+rax*4]
xor edx, ecx
a... | long long func0(long long a1, int a2)
{
long long v2; // r9
unsigned int i; // r8d
long long v4; // rax
if ( a2 <= 0 )
return 0LL;
v2 = 1LL;
for ( i = 0; v2 != a2; ++v2 )
{
v4 = v2;
do
i -= ((((unsigned __int8)*(_DWORD *)(a1 + 4 * v2 - 4) ^ (unsigned __int8)*(_DWORD *)(a1 + 4 * v4++)) ... | func0:
ENDBR64
TEST ESI,ESI
JLE 0x00101304
MOVSXD R10,ESI
MOV R9D,0x1
XOR R8D,R8D
CMP R9,R10
JZ 0x00101300
NOP dword ptr [RAX]
LAB_001012d0:
MOV ECX,dword ptr [RDI + R9*0x4 + -0x4]
MOV RAX,R9
NOP dword ptr [RAX + RAX*0x1]
LAB_001012e0:
MOV EDX,dword ptr [RDI + RAX*0x4]
XOR EDX,ECX
AND EDX,0x1
CMP EDX,0x1
SBB R8D,-0x1
A... | int func0(long param_1,int param_2)
{
long lVar1;
int iVar2;
long lVar3;
if (0 < param_2) {
lVar3 = 1;
iVar2 = 0;
if ((long)param_2 != 1) {
do {
lVar1 = lVar3;
do {
iVar2 = (iVar2 + 1) -
(uint)(((*(uint *)(param_1 + lVar1 * 4) ^ *(uint *)(param_1... |
6,119 | func0 |
#include <assert.h>
| int func0(int A[], int N) {
int oddPair = 0;
for (int i = 0; i < N; i++) {
for (int j = i + 1; j < N; j++) {
if ((A[i] ^ A[j]) % 2 != 0) {
oddPair++;
}
}
}
return oddPair;
}
| int main() {
int array1[] = {5, 4, 7, 2, 1};
int array2[] = {7, 2, 8, 1, 0, 5, 11};
int array3[] = {1, 2, 3};
assert(func0(array1, 5) == 6);
assert(func0(array2, 7) == 12);
assert(func0(array3, 3) == 2);
return 0;
}
| O3 | c | func0:
endbr64
test %esi,%esi
jle 14a3 <func0+0x153>
cmp $0x1,%esi
je 14a3 <func0+0x153>
push %r14
lea 0x4(%rdi),%r10
xor %r8d,%r8d
mov $0x1,%ecx
push %rbp
mov $0x1,%r11d
pxor %xmm4,%xmm4
pcmpeqd %xmm3,%xmm3
movdqa 0xd06(%rip),%xmm5
push %rbx
lea -0x1(%rsi),%ebx
xchg %ax,%ax
mov ... | func0:
endbr64
test esi, esi
jle loc_127E
mov r8d, esi
cmp esi, 1
jz loc_127E
push r14
mov r11, rdi
lea r10, [rdi+4]
mov ecx, 1
movdqa xmm4, cs:xmmword_2010
push rbp
xor edi, edi
lea ebp, [rsi-1]
push rbx
pxor xmm2, xmm2
mov ebx, 1
xchg ax, ax
loc_1180:
mov ... | long long func0(long long a1, int a2)
{
const __m128i *v4; // r10
int v5; // ecx
__m128i si128; // xmm4
unsigned int v7; // edi
int v8; // ebp
unsigned int v9; // esi
unsigned int v10; // r9d
__m128i v11; // xmm1
const __m128i *v12; // rax
__m128i v13; // xmm3
__m128i v14; // xmm0
__m128i v15; ... | func0:
ENDBR64
TEST ESI,ESI
JLE 0x0010127e
MOV R8D,ESI
CMP ESI,0x1
JZ 0x0010127e
PUSH R14
MOV R11,RDI
LEA R10,[RDI + 0x4]
MOV ECX,0x1
MOVDQA XMM4,xmmword ptr [0x00102010]
PUSH RBP
XOR EDI,EDI
LEA EBP,[RSI + -0x1]
PUSH RBX
PXOR XMM2,XMM2
MOV EBX,0x1
NOP
LAB_00101180:
MOV R9D,R8D
MOV EAX,EBP
MOV ESI,dword ptr [R10 + -0x4... | /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
int func0(long param_1,int param_2)
{
long lVar1;
uint uVar2;
uint uVar3;
uint uVar4;
uint *puVar5;
uint *puVar6;
uint *puVar7;
uint *puVar8;
int iVar9;
int iVar10;
uint *puVar11;
int iVar12;
int iVar13;
i... |
6,120 | func0 |
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <string.h>
| char* func0(char* string) {
static char toggled_string[100];
strcpy(toggled_string, string);
for (int i = 0; toggled_string[i] != '\0'; i++) {
if (isupper(toggled_string[i])) {
toggled_string[i] = tolower(toggled_string[i]);
} else if (islower(toggled_string[i])) {
... | int main() {
assert(strcmp(func0("Python"), "pYTHON") == 0);
assert(strcmp(func0("Pangram"), "pANGRAM") == 0);
assert(strcmp(func0("LIttLE"), "liTTle") == 0);
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x20,%rsp
mov %rdi,-0x18(%rbp)
mov -0x18(%rbp),%rax
mov %rax,%rsi
lea 0x2e39(%rip),%rdi
callq 10a0 <strcpy@plt>
movl $0x0,-0x4(%rbp)
jmpq 12d6 <func0+0xed>
callq 10f0 <__ctype_b_loc@plt>
mov (%rax),%rdx
mov -0x4(%rbp),%eax
cltq
lea 0x2e14(%r... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 20h
mov [rbp+src], rdi
mov rax, [rbp+src]
mov rsi, rax; src
lea rax, toggled_string_1
mov rdi, rax; dest
call _strcpy
mov [rbp+var_4], 0
jmp loc_12D9
loc_121B:
call ___ctype_b_loc
mov rdx, [rax]
mov eax, [rbp+var_4]
cdqe
... | char * func0(const char *a1)
{
int i; // [rsp+1Ch] [rbp-4h]
strcpy(toggled_string_1, a1);
for ( i = 0; toggled_string_1[i]; ++i )
{
if ( ((*__ctype_b_loc())[toggled_string_1[i]] & 0x100) != 0 )
{
toggled_string_1[i] = tolower(toggled_string_1[i]);
}
else if ( ((*__ctype_b_loc())[toggled_s... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x20
MOV qword ptr [RBP + -0x18],RDI
MOV RAX,qword ptr [RBP + -0x18]
MOV RSI,RAX
LEA RAX,[0x104040]
MOV RDI,RAX
CALL 0x001010a0
MOV dword ptr [RBP + -0x4],0x0
JMP 0x001012d9
LAB_0010121b:
CALL 0x001010f0
MOV RDX,qword ptr [RAX]
MOV EAX,dword ptr [RBP + -0x4]
CDQE
LEA RCX,[0x1... | int1 * func0(char *param_1)
{
int iVar1;
ushort **ppuVar2;
int local_c;
strcpy(toggled_string_1,param_1);
for (local_c = 0; toggled_string_1[local_c] != '\0'; local_c = local_c + 1) {
ppuVar2 = __ctype_b_loc();
if (((*ppuVar2)[(char)toggled_string_1[local_c]] & 0x100) == 0) {
ppuVar2 = __cty... |
6,121 | func0 |
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <string.h>
| char* func0(char* string) {
static char toggled_string[100];
strcpy(toggled_string, string);
for (int i = 0; toggled_string[i] != '\0'; i++) {
if (isupper(toggled_string[i])) {
toggled_string[i] = tolower(toggled_string[i]);
} else if (islower(toggled_string[i])) {
... | int main() {
assert(strcmp(func0("Python"), "pYTHON") == 0);
assert(strcmp(func0("Pangram"), "pANGRAM") == 0);
assert(strcmp(func0("LIttLE"), "liTTle") == 0);
return 0;
}
| O1 | c | func0:
endbr64
push %r12
push %rbp
push %rbx
mov %rdi,%rsi
mov $0x64,%edx
lea 0x2e60(%rip),%rdi
callq 10b0 <__strcpy_chk@plt>
movzbl 0x2e54(%rip),%ebx
test %bl,%bl
je 1241 <func0+0x78>
callq 10d0 <__ctype_b_loc@plt>
mov %rax,%r12
lea 0x2e41(%rip),%rbp
jmp 1220 <func0+0x57>
test $0x2,%a... | func0:
endbr64
push r12
push rbp
push rbx
mov rsi, rdi
mov edx, 64h ; 'd'
lea rdi, toggled_string_1
call ___strcpy_chk
movzx ebx, cs:toggled_string_1
test bl, bl
jz short loc_1261
call ___ctype_b_loc
mov r12, rax
lea rbp, toggled_string_1
jmp short loc_1240
loc_1221:
tes... | char * func0(long long a1)
{
char v1; // bl
_QWORD *v2; // r12
char *v3; // rbp
__int16 v4; // ax
__strcpy_chk(&toggled_string_1, a1, 100LL);
v1 = toggled_string_1;
if ( toggled_string_1 )
{
v2 = (_QWORD *)__ctype_b_loc();
v3 = &toggled_string_1;
do
{
v4 = *(_WORD *)(*v2 + 2LL * v... | func0:
ENDBR64
PUSH R12
PUSH RBP
PUSH RBX
MOV RSI,RDI
MOV EDX,0x64
LEA RDI,[0x104040]
CALL 0x001010d0
MOVZX EBX,byte ptr [0x00104040]
TEST BL,BL
JZ 0x00101261
CALL 0x001010f0
MOV R12,RAX
LEA RBP,[0x104040]
JMP 0x00101240
LAB_00101221:
TEST AH,0x2
JZ 0x00101234
CALL 0x001010a0
MOV RAX,qword ptr [RAX]
MOV EAX,dword ptr [... | int1 * func0(int8 param_1)
{
ushort **ppuVar1;
__int32_t **pp_Var2;
char cVar3;
char *pcVar4;
__strcpy_chk(&toggled_string_1,param_1,100);
cVar3 = toggled_string_1;
if (toggled_string_1 != '\0') {
ppuVar1 = __ctype_b_loc();
pcVar4 = &toggled_string_1;
do {
if (((*ppuVar1)[cVar3] & 0x... |
6,122 | func0 |
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <string.h>
| char* func0(char* string) {
static char toggled_string[100];
strcpy(toggled_string, string);
for (int i = 0; toggled_string[i] != '\0'; i++) {
if (isupper(toggled_string[i])) {
toggled_string[i] = tolower(toggled_string[i]);
} else if (islower(toggled_string[i])) {
... | int main() {
assert(strcmp(func0("Python"), "pYTHON") == 0);
assert(strcmp(func0("Pangram"), "pANGRAM") == 0);
assert(strcmp(func0("LIttLE"), "liTTle") == 0);
return 0;
}
| O2 | c | func0:
endbr64
push %r12
mov %rdi,%rsi
mov $0x64,%edx
lea 0x2d7b(%rip),%rdi
push %rbp
push %rbx
callq 10b0 <__strcpy_chk@plt>
movsbq 0x2d6c(%rip),%rbx
test %bl,%bl
je 1338 <func0+0x88>
callq 10d0 <__ctype_b_loc@plt>
lea 0x2d5c(%rip),%rbp
mov %rax,%r12
jmp 130b <func0+0x5b>
nopl 0x0(%ra... | func0:
endbr64
push r13
mov rsi, rdi
mov edx, 64h ; 'd'
push r12
lea r12, toggled_string_1
push rbp
mov rdi, r12
push rbx
sub rsp, 8
call ___strcpy_chk
movsx rbx, cs:toggled_string_1
test bl, bl
jz short loc_1348
call ___ctype_b_loc
mov rbp, r12
mov r13, rax
jmp ... | char * func0(long long a1)
{
long long v1; // rbx
char *v2; // rbp
_QWORD *v3; // r13
__int16 v4; // ax
__strcpy_chk(&toggled_string_1, a1, 100LL);
v1 = toggled_string_1;
if ( toggled_string_1 )
{
v2 = &toggled_string_1;
v3 = (_QWORD *)__ctype_b_loc();
do
{
while ( 1 )
{
... | func0:
ENDBR64
PUSH R13
MOV RSI,RDI
MOV EDX,0x64
PUSH R12
LEA R12,[0x104040]
PUSH RBP
MOV RDI,R12
PUSH RBX
SUB RSP,0x8
CALL 0x001010d0
MOVSX RBX,byte ptr [0x00104040]
TEST BL,BL
JZ 0x00101348
CALL 0x001010f0
MOV RBP,R12
MOV R13,RAX
JMP 0x0010131b
LAB_00101300:
CALL 0x001010e0
MOV RAX,qword ptr [RAX]
MOV EAX,dword ptr [... | int1 * func0(int8 param_1)
{
char *pcVar1;
char cVar2;
ushort **ppuVar3;
__int32_t **pp_Var4;
long lVar5;
char *pcVar6;
__strcpy_chk(&toggled_string_1,param_1,100);
lVar5 = (long)toggled_string_1;
if (toggled_string_1 != '\0') {
ppuVar3 = __ctype_b_loc();
pcVar6 = &toggled_string_1;
do... |
6,123 | func0 |
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <string.h>
| char* func0(char* string) {
static char toggled_string[100];
strcpy(toggled_string, string);
for (int i = 0; toggled_string[i] != '\0'; i++) {
if (isupper(toggled_string[i])) {
toggled_string[i] = tolower(toggled_string[i]);
} else if (islower(toggled_string[i])) {
... | int main() {
assert(strcmp(func0("Python"), "pYTHON") == 0);
assert(strcmp(func0("Pangram"), "pANGRAM") == 0);
assert(strcmp(func0("LIttLE"), "liTTle") == 0);
return 0;
}
| O3 | c | func0:
endbr64
push %r12
mov %rdi,%rsi
mov $0x64,%edx
lea 0x2d7b(%rip),%rdi
push %rbp
push %rbx
callq 10b0 <__strcpy_chk@plt>
movsbq 0x2d6c(%rip),%rbx
test %bl,%bl
je 1338 <func0+0x88>
callq 10d0 <__ctype_b_loc@plt>
lea 0x2d5c(%rip),%rbp
mov %rax,%r12
jmp 130b <func0+0x5b>
nopl 0x0(%ra... | func0:
endbr64
push r13
mov rsi, rdi
mov edx, 64h ; 'd'
push r12
lea r12, toggled_string_1
push rbp
mov rdi, r12
push rbx
sub rsp, 8
call ___strcpy_chk
movsx rbx, cs:toggled_string_1
test bl, bl
jz short loc_1348
call ___ctype_b_loc
mov rbp, r12
mov r13, rax
jmp ... | char * func0(long long a1)
{
long long v1; // rbx
char *v2; // rbp
const unsigned __int16 **v3; // r13
unsigned __int16 v4; // ax
__strcpy_chk(&toggled_string_1, a1, 100LL);
v1 = toggled_string_1;
if ( toggled_string_1 )
{
v2 = &toggled_string_1;
v3 = __ctype_b_loc();
do
{
while (... | func0:
ENDBR64
PUSH R13
MOV RSI,RDI
MOV EDX,0x64
PUSH R12
LEA R12,[0x104040]
PUSH RBP
MOV RDI,R12
PUSH RBX
SUB RSP,0x8
CALL 0x001010d0
MOVSX RBX,byte ptr [0x00104040]
TEST BL,BL
JZ 0x00101348
CALL 0x001010f0
MOV RBP,R12
MOV R13,RAX
JMP 0x0010131b
LAB_00101300:
CALL 0x001010e0
MOV RAX,qword ptr [RAX]
MOV EAX,dword ptr [... | int1 * func0(int8 param_1)
{
char *pcVar1;
char cVar2;
ushort **ppuVar3;
__int32_t **pp_Var4;
long lVar5;
char *pcVar6;
__strcpy_chk(&toggled_string_1,param_1,100);
lVar5 = (long)toggled_string_1;
if (toggled_string_1 != '\0') {
ppuVar3 = __ctype_b_loc();
pcVar6 = &toggled_string_1;
do... |
6,124 | func0 | #include <stdlib.h>
#include <stdio.h>
#include <assert.h>
| int func0(int n1, int n2) {
int distance = abs(n1 - n2);
int sum = 0;
while (distance > 0) {
sum += distance % 10;
distance /= 10;
}
return sum;
}
| int main() {
assert(func0(1, 2) == 1);
assert(func0(23, 56) == 6);
assert(func0(123, 256) == 7);
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
mov %edi,-0x14(%rbp)
mov %esi,-0x18(%rbp)
mov -0x14(%rbp),%eax
sub -0x18(%rbp),%eax
mov %eax,%edx
mov %edx,%eax
sar $0x1f,%eax
xor %eax,%edx
mov %edx,-0x8(%rbp)
sub %eax,-0x8(%rbp)
movl $0x0,-0x4(%rbp)
jmp 11c0 <func0+0x77>
mov -0x8(%rbp)... | func0:
endbr64
push rbp
mov rbp, rsp
mov [rbp+var_14], edi
mov [rbp+var_18], esi
mov eax, [rbp+var_14]
sub eax, [rbp+var_18]
mov edx, eax
neg edx
cmovns eax, edx
mov [rbp+var_8], eax
mov [rbp+var_4], 0
jmp short loc_11BB
loc_1170:
mov ecx, [rbp+var_8]
movsxd rax, ecx
imu... | long long func0(int a1, int a2)
{
int v2; // eax
int v4; // [rsp+10h] [rbp-8h]
unsigned int v5; // [rsp+14h] [rbp-4h]
v2 = a1 - a2;
if ( a2 - a1 >= 0 )
v2 = a2 - a1;
v4 = v2;
v5 = 0;
while ( v4 > 0 )
{
v5 += v4 % 10;
v4 /= 10;
}
return v5;
} | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
MOV dword ptr [RBP + -0x14],EDI
MOV dword ptr [RBP + -0x18],ESI
MOV EAX,dword ptr [RBP + -0x14]
SUB EAX,dword ptr [RBP + -0x18]
MOV EDX,EAX
NEG EDX
CMOVNS EAX,EDX
MOV dword ptr [RBP + -0x8],EAX
MOV dword ptr [RBP + -0x4],0x0
JMP 0x001011bb
LAB_00101170:
MOV ECX,dword ptr [RBP + -0x8]... | int func0(int param_1,int param_2)
{
int4 local_10;
int4 local_c;
local_10 = param_1 - param_2;
if (local_10 < 1) {
local_10 = -local_10;
}
local_c = 0;
for (; 0 < local_10; local_10 = local_10 / 10) {
local_c = local_c + local_10 % 10;
}
return local_c;
} |
6,125 | func0 | #include <stdlib.h>
#include <stdio.h>
#include <assert.h>
| int func0(int n1, int n2) {
int distance = abs(n1 - n2);
int sum = 0;
while (distance > 0) {
sum += distance % 10;
distance /= 10;
}
return sum;
}
| int main() {
assert(func0(1, 2) == 1);
assert(func0(23, 56) == 6);
assert(func0(123, 256) == 7);
return 0;
}
| O1 | c | func0:
endbr64
sub %esi,%edi
mov %edi,%eax
sar $0x1f,%eax
xor %eax,%edi
sub %eax,%edi
test %edi,%edi
jle 118d <func0+0x44>
mov $0x0,%ecx
movslq %edi,%rax
imul $0x66666667,%rax,%rax
sar $0x22,%rax
mov %edi,%edx
sar $0x1f,%edx
sub %edx,%eax
lea (%rax,%rax,4),%edx
add %edx,%edx
m... | func0:
endbr64
sub edi, esi
mov edx, edi
neg edx
cmovs edx, edi
test edx, edx
jle short loc_118B
mov esi, 0
loc_115F:
movsxd rax, edx
imul rax, 66666667h
sar rax, 22h
mov ecx, edx
sar ecx, 1Fh
sub eax, ecx
lea ecx, [rax+rax*4]
add ecx, ecx
mov edi, edx
sub ed... | long long func0(int a1, int a2)
{
int v2; // edi
int v3; // edx
unsigned int v4; // esi
int v5; // ecx
v2 = a1 - a2;
v3 = -v2;
if ( v2 > 0 )
v3 = v2;
if ( v3 <= 0 )
{
return 0;
}
else
{
v4 = 0;
do
{
v4 += v3 % 10;
v5 = v3;
v3 /= 10;
}
while ( v5 > ... | func0:
ENDBR64
SUB EDI,ESI
MOV EDX,EDI
NEG EDX
CMOVS EDX,EDI
TEST EDX,EDX
JLE 0x0010118b
MOV ESI,0x0
LAB_0010115f:
MOVSXD RAX,EDX
IMUL RAX,RAX,0x66666667
SAR RAX,0x22
MOV ECX,EDX
SAR ECX,0x1f
SUB EAX,ECX
LEA ECX,[RAX + RAX*0x4]
ADD ECX,ECX
MOV EDI,EDX
SUB EDI,ECX
ADD ESI,EDI
MOV ECX,EDX
MOV EDX,EAX
CMP ECX,0x9
JG 0x001... | int func0(int param_1,int param_2)
{
bool bVar1;
int iVar2;
int iVar3;
param_1 = param_1 - param_2;
iVar2 = -param_1;
if (0 < param_1) {
iVar2 = param_1;
}
if (iVar2 < 1) {
iVar3 = 0;
}
else {
iVar3 = 0;
do {
iVar3 = iVar3 + iVar2 % 10;
bVar1 = 9 < iVar2;
iVar2 ... |
6,126 | func0 | #include <stdlib.h>
#include <stdio.h>
#include <assert.h>
| int func0(int n1, int n2) {
int distance = abs(n1 - n2);
int sum = 0;
while (distance > 0) {
sum += distance % 10;
distance /= 10;
}
return sum;
}
| int main() {
assert(func0(1, 2) == 1);
assert(func0(23, 56) == 6);
assert(func0(123, 256) == 7);
return 0;
}
| O2 | c | func0:
endbr64
mov %edi,%edx
xor %r8d,%r8d
sub %esi,%edx
mov %edx,%eax
sar $0x1f,%eax
xor %eax,%edx
sub %eax,%edx
cmp %esi,%edi
je 117a <func0+0x3a>
mov $0xcccccccd,%esi
nopl (%rax)
mov %edx,%eax
imul %rsi,%rax
shr $0x23,%rax
lea (%rax,%rax,4),%ecx
add %ecx,%ecx
sub %ec... | func0:
endbr64
mov eax, edi
sub eax, esi
mov edx, eax
neg edx
cmovs edx, eax
xor r8d, r8d
cmp edi, esi
jz short loc_117A
mov esi, 0CCCCCCCDh
nop dword ptr [rax+rax+00h]
loc_1160:
mov eax, edx
imul rax, rsi
shr rax, 23h
lea ecx, [rax+rax*4]
add ecx, ecx
sub e... | long long func0(int a1, int a2)
{
unsigned int v2; // edx
unsigned int v3; // r8d
v2 = a2 - a1;
if ( a2 - a1 < 0 )
v2 = a1 - a2;
v3 = 0;
if ( a1 != a2 )
{
do
{
v3 += v2 % 0xA;
v2 /= 0xAu;
}
while ( v2 );
}
return v3;
} | func0:
ENDBR64
MOV EAX,EDI
SUB EAX,ESI
MOV EDX,EAX
NEG EDX
CMOVS EDX,EAX
XOR R8D,R8D
CMP EDI,ESI
JZ 0x0010117a
MOV ESI,0xcccccccd
NOP dword ptr [RAX + RAX*0x1]
LAB_00101160:
MOV EAX,EDX
IMUL RAX,RSI
SHR RAX,0x23
LEA ECX,[RAX + RAX*0x4]
ADD ECX,ECX
SUB EDX,ECX
ADD R8D,EDX
MOV EDX,EAX
TEST EAX,EAX
JNZ 0x00101160
LAB_0010... | int func0(int param_1,int param_2)
{
uint uVar1;
uint uVar2;
int iVar3;
uVar1 = param_1 - param_2;
uVar2 = -uVar1;
if (0 < (int)uVar1) {
uVar2 = uVar1;
}
iVar3 = 0;
if (param_1 != param_2) {
do {
iVar3 = iVar3 + uVar2 % 10;
uVar2 = uVar2 / 10;
} while (uVar2 != 0);
}
re... |
6,127 | func0 | #include <stdlib.h>
#include <stdio.h>
#include <assert.h>
| int func0(int n1, int n2) {
int distance = abs(n1 - n2);
int sum = 0;
while (distance > 0) {
sum += distance % 10;
distance /= 10;
}
return sum;
}
| int main() {
assert(func0(1, 2) == 1);
assert(func0(23, 56) == 6);
assert(func0(123, 256) == 7);
return 0;
}
| O3 | c | func0:
endbr64
mov %edi,%edx
xor %r8d,%r8d
sub %esi,%edx
mov %edx,%eax
sar $0x1f,%eax
xor %eax,%edx
sub %eax,%edx
cmp %esi,%edi
je 117a <func0+0x3a>
mov $0xcccccccd,%esi
nopl (%rax)
mov %edx,%eax
imul %rsi,%rax
shr $0x23,%rax
lea (%rax,%rax,4),%ecx
add %ecx,%ecx
sub %ec... | func0:
endbr64
mov eax, edi
sub eax, esi
mov edx, eax
neg edx
cmovs edx, eax
cmp edi, esi
mov esi, 0
jz short loc_1179
mov edi, 0CCCCCCCDh
nop dword ptr [rax]
loc_1160:
mov eax, edx
imul rax, rdi
shr rax, 23h
lea ecx, [rax+rax*4]
add ecx, ecx
sub edx, ecx
ad... | long long func0(int a1, int a2)
{
unsigned int v2; // edx
bool v3; // zf
unsigned int v4; // esi
v2 = a2 - a1;
if ( a2 - a1 < 0 )
v2 = a1 - a2;
v3 = a1 == a2;
v4 = 0;
if ( !v3 )
{
do
{
v4 += v2 % 0xA;
v2 /= 0xAu;
}
while ( v2 );
}
return v4;
} | func0:
ENDBR64
MOV EAX,EDI
SUB EAX,ESI
MOV EDX,EAX
NEG EDX
CMOVS EDX,EAX
CMP EDI,ESI
MOV ESI,0x0
JZ 0x00101179
MOV EDI,0xcccccccd
NOP dword ptr [RAX]
LAB_00101160:
MOV EAX,EDX
IMUL RAX,RDI
SHR RAX,0x23
LEA ECX,[RAX + RAX*0x4]
ADD ECX,ECX
SUB EDX,ECX
ADD ESI,EDX
MOV EDX,EAX
TEST EAX,EAX
JNZ 0x00101160
LAB_00101179:
MOV ... | int func0(int param_1,int param_2)
{
uint uVar1;
uint uVar2;
int iVar3;
uVar1 = param_1 - param_2;
uVar2 = -uVar1;
if (0 < (int)uVar1) {
uVar2 = uVar1;
}
iVar3 = 0;
if (param_1 != param_2) {
do {
iVar3 = iVar3 + uVar2 % 10;
uVar2 = uVar2 / 10;
} while (uVar2 != 0);
}
re... |
6,128 | func0 |
#include <assert.h>
| int func0(int a[], int size) {
int max_so_far = 0;
int max_ending_here = 0;
for (int i = 0; i < size; i++) {
max_ending_here = max_ending_here + a[i];
if (max_ending_here < 0) {
max_ending_here = 0;
} else if (max_so_far < max_ending_here) {
max_so_far... | int main() {
int arr1[] = {-2, -3, 4, -1, -2, 1, 5, -3};
int arr2[] = {-3, -4, 5, -2, -3, 2, 6, -4};
int arr3[] = {-4, -5, 6, -3, -4, 3, 7, -5};
assert(func0(arr1, 8) == 7);
assert(func0(arr2, 8) == 8);
assert(func0(arr3, 8) == 10);
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
mov %rdi,-0x18(%rbp)
mov %esi,-0x1c(%rbp)
movl $0x0,-0xc(%rbp)
movl $0x0,-0x8(%rbp)
movl $0x0,-0x4(%rbp)
jmp 11c9 <func0+0x60>
mov -0x4(%rbp),%eax
cltq
lea 0x0(,%rax,4),%rdx
mov -0x18(%rbp),%rax
add %rdx,%rax
mov (%rax),%eax
add %eax,-0x8(%rbp... | func0:
endbr64
push rbp
mov rbp, rsp
mov [rbp+var_18], rdi
mov [rbp+var_1C], esi
mov [rbp+var_C], 0
mov [rbp+var_8], 0
mov [rbp+var_4], 0
jmp short loc_11C9
loc_118F:
mov eax, [rbp+var_4]
cdqe
lea rdx, ds:0[rax*4]
mov rax, [rbp+var_18]
add rax, rdx
mov eax, [rax]
add ... | long long func0(long long a1, int a2)
{
int v3; // [rsp+10h] [rbp-Ch]
int v4; // [rsp+14h] [rbp-8h]
int i; // [rsp+18h] [rbp-4h]
v3 = 0;
v4 = 0;
for ( i = 0; i < a2; ++i )
{
v4 += *(_DWORD *)(4LL * i + a1);
if ( v4 >= 0 )
{
if ( v3 < v4 )
v3 = v4;
}
else
{
v4 ... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
MOV qword ptr [RBP + -0x18],RDI
MOV dword ptr [RBP + -0x1c],ESI
MOV dword ptr [RBP + -0xc],0x0
MOV dword ptr [RBP + -0x8],0x0
MOV dword ptr [RBP + -0x4],0x0
JMP 0x001011c9
LAB_0010118f:
MOV EAX,dword ptr [RBP + -0x4]
CDQE
LEA RDX,[RAX*0x4]
MOV RAX,qword ptr [RBP + -0x18]
ADD RAX,RDX
... | int func0(long param_1,int param_2)
{
int4 local_14;
int4 local_10;
int4 local_c;
local_14 = 0;
local_10 = 0;
for (local_c = 0; local_c < param_2; local_c = local_c + 1) {
local_10 = local_10 + *(int *)(param_1 + (long)local_c * 4);
if (local_10 < 0) {
local_10 = 0;
}
else if (loca... |
6,129 | func0 |
#include <assert.h>
| int func0(int a[], int size) {
int max_so_far = 0;
int max_ending_here = 0;
for (int i = 0; i < size; i++) {
max_ending_here = max_ending_here + a[i];
if (max_ending_here < 0) {
max_ending_here = 0;
} else if (max_so_far < max_ending_here) {
max_so_far... | int main() {
int arr1[] = {-2, -3, 4, -1, -2, 1, 5, -3};
int arr2[] = {-3, -4, 5, -2, -3, 2, 6, -4};
int arr3[] = {-4, -5, 6, -3, -4, 3, 7, -5};
assert(func0(arr1, 8) == 7);
assert(func0(arr2, 8) == 8);
assert(func0(arr3, 8) == 10);
return 0;
}
| O1 | c | func0:
endbr64
test %esi,%esi
jle 11a9 <func0+0x40>
mov %rdi,%rdx
lea -0x1(%rsi),%eax
lea 0x4(%rdi,%rax,4),%rdi
mov $0x0,%ecx
mov $0x0,%esi
mov $0x0,%r8d
jmp 119a <func0+0x31>
mov %r8d,%ecx
add $0x4,%rdx
cmp %rdi,%rdx
je 11ae <func0+0x45>
mov %ecx,%eax
add (%rdx),%eax
mov ... | func0:
endbr64
test esi, esi
jle short loc_11A9
mov rdx, rdi
lea eax, [rsi-1]
lea rdi, [rdi+rax*4+4]
mov ecx, 0
mov esi, 0
mov r8d, 0
jmp short loc_119C
loc_118E:
cmp esi, eax
cmovl esi, eax
loc_1193:
add rdx, 4
cmp rdx, rdi
jz short loc_11AE
loc_119C:
mov eax, ... | long long func0(_DWORD *a1, int a2)
{
_DWORD *v2; // rdx
long long v3; // rdi
int v4; // ecx
unsigned int v5; // esi
bool v6; // sf
int v7; // eax
if ( a2 <= 0 )
{
return 0;
}
else
{
v2 = a1;
v3 = (long long)&a1[a2 - 1 + 1];
v4 = 0;
v5 = 0;
do
{
v6 = *v2 + v4 < ... | func0:
ENDBR64
TEST ESI,ESI
JLE 0x001011a9
MOV RDX,RDI
LEA EAX,[RSI + -0x1]
LEA RDI,[RDI + RAX*0x4 + 0x4]
MOV ECX,0x0
MOV ESI,0x0
MOV R8D,0x0
JMP 0x0010119c
LAB_0010118e:
CMP ESI,EAX
CMOVL ESI,EAX
LAB_00101193:
ADD RDX,0x4
CMP RDX,RDI
JZ 0x001011ae
LAB_0010119c:
MOV EAX,ECX
ADD EAX,dword ptr [RDX]
MOV ECX,EAX
JNS 0x001... | int func0(int *param_1,int param_2)
{
int *piVar1;
int iVar2;
int iVar3;
if (param_2 < 1) {
iVar3 = 0;
}
else {
piVar1 = param_1 + (ulong)(param_2 - 1) + 1;
iVar2 = 0;
iVar3 = 0;
do {
iVar2 = iVar2 + *param_1;
if (iVar2 < 0) {
iVar2 = 0;
}
else if (iVa... |
6,130 | func0 |
#include <assert.h>
| int func0(int a[], int size) {
int max_so_far = 0;
int max_ending_here = 0;
for (int i = 0; i < size; i++) {
max_ending_here = max_ending_here + a[i];
if (max_ending_here < 0) {
max_ending_here = 0;
} else if (max_so_far < max_ending_here) {
max_so_far... | int main() {
int arr1[] = {-2, -3, 4, -1, -2, 1, 5, -3};
int arr2[] = {-3, -4, 5, -2, -3, 2, 6, -4};
int arr3[] = {-4, -5, 6, -3, -4, 3, 7, -5};
assert(func0(arr1, 8) == 7);
assert(func0(arr2, 8) == 8);
assert(func0(arr3, 8) == 10);
return 0;
}
| O2 | c | func0:
endbr64
test %esi,%esi
jle 13a8 <func0+0x48>
lea -0x1(%rsi),%eax
xor %r8d,%r8d
lea 0x4(%rdi,%rax,4),%rdx
xor %eax,%eax
jmp 1390 <func0+0x30>
nopw 0x0(%rax,%rax,1)
cmp %eax,%r8d
cmovl %eax,%r8d
add $0x4,%rdi
cmp %rdx,%rdi
je 139f <func0+0x3f>
add (%rdi),%eax
jns 1380 <fun... | func0:
endbr64
test esi, esi
jle short loc_13A8
lea eax, [rsi-1]
xor r8d, r8d
lea rdx, [rdi+rax*4+4]
xor eax, eax
jmp short loc_1390
loc_1380:
cmp r8d, eax
cmovl r8d, eax
add rdi, 4
cmp rdi, rdx
jz short loc_139F
loc_1390:
add eax, [rdi]
jns short loc_1380
add r... | long long func0(_DWORD *a1, int a2)
{
unsigned int v2; // r8d
long long v3; // rdx
int v4; // eax
if ( a2 <= 0 )
return 0LL;
v2 = 0;
v3 = (long long)&a1[a2 - 1 + 1];
v4 = 0;
do
{
while ( 1 )
{
v4 += *a1;
if ( v4 >= 0 )
break;
++a1;
v4 = 0;
if ( a1 ==... | func0:
ENDBR64
TEST ESI,ESI
JLE 0x001013a8
LEA EAX,[RSI + -0x1]
XOR R8D,R8D
LEA RDX,[RDI + RAX*0x4 + 0x4]
XOR EAX,EAX
JMP 0x00101390
LAB_00101380:
CMP R8D,EAX
CMOVL R8D,EAX
ADD RDI,0x4
CMP RDI,RDX
JZ 0x0010139f
LAB_00101390:
ADD EAX,dword ptr [RDI]
JNS 0x00101380
ADD RDI,0x4
XOR EAX,EAX
CMP RDI,RDX
JNZ 0x00101390
LAB_0... | int func0(int *param_1,int param_2)
{
int *piVar1;
int iVar2;
int iVar3;
if (param_2 < 1) {
return 0;
}
iVar3 = 0;
piVar1 = param_1 + (ulong)(param_2 - 1) + 1;
iVar2 = 0;
do {
while (iVar2 = iVar2 + *param_1, iVar2 < 0) {
param_1 = param_1 + 1;
iVar2 = 0;
if (param_1 == p... |
6,131 | func0 |
#include <assert.h>
| int func0(int a[], int size) {
int max_so_far = 0;
int max_ending_here = 0;
for (int i = 0; i < size; i++) {
max_ending_here = max_ending_here + a[i];
if (max_ending_here < 0) {
max_ending_here = 0;
} else if (max_so_far < max_ending_here) {
max_so_far... | int main() {
int arr1[] = {-2, -3, 4, -1, -2, 1, 5, -3};
int arr2[] = {-3, -4, 5, -2, -3, 2, 6, -4};
int arr3[] = {-4, -5, 6, -3, -4, 3, 7, -5};
assert(func0(arr1, 8) == 7);
assert(func0(arr2, 8) == 8);
assert(func0(arr3, 8) == 10);
return 0;
}
| O3 | c | func0:
endbr64
test %esi,%esi
jle 1458 <func0+0x48>
lea -0x1(%rsi),%eax
xor %r8d,%r8d
lea 0x4(%rdi,%rax,4),%rdx
xor %eax,%eax
jmp 1440 <func0+0x30>
nopw 0x0(%rax,%rax,1)
cmp %eax,%r8d
cmovl %eax,%r8d
add $0x4,%rdi
cmp %rdi,%rdx
je 144f <func0+0x3f>
add (%rdi),%eax
jns 1430 <fun... | func0:
endbr64
test esi, esi
jle short loc_1180
movsxd rsi, esi
xor eax, eax
xor edx, edx
lea rcx, [rdi+rsi*4]
jmp short loc_1166
loc_1158:
cmp edx, eax
cmovl edx, eax
add rdi, 4
cmp rcx, rdi
jz short loc_1175
loc_1166:
add eax, [rdi]
jns short loc_1158
add rdi, 4
... | long long func0(_DWORD *a1, int a2)
{
int v2; // eax
unsigned int v3; // edx
_DWORD *v4; // rcx
if ( a2 <= 0 )
return 0LL;
v2 = 0;
v3 = 0;
v4 = &a1[a2];
do
{
while ( 1 )
{
v2 += *a1;
if ( v2 >= 0 )
break;
++a1;
v2 = 0;
if ( v4 == a1 )
return ... | func0:
ENDBR64
TEST ESI,ESI
JLE 0x00101180
MOVSXD RSI,ESI
XOR EAX,EAX
XOR EDX,EDX
LEA RCX,[RDI + RSI*0x4]
JMP 0x00101166
LAB_00101158:
CMP EDX,EAX
CMOVL EDX,EAX
ADD RDI,0x4
CMP RCX,RDI
JZ 0x00101175
LAB_00101166:
ADD EAX,dword ptr [RDI]
JNS 0x00101158
ADD RDI,0x4
XOR EAX,EAX
CMP RCX,RDI
JNZ 0x00101166
LAB_00101175:
MOV... | int func0(int *param_1,int param_2)
{
int *piVar1;
int iVar2;
int iVar3;
if (param_2 < 1) {
return 0;
}
iVar2 = 0;
iVar3 = 0;
piVar1 = param_1 + param_2;
do {
while (iVar2 = iVar2 + *param_1, iVar2 < 0) {
param_1 = param_1 + 1;
iVar2 = 0;
if (piVar1 == param_1) {
... |
6,132 | func0 |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct {
int *elements;
int size;
} UniqueTuple;
| UniqueTuple func0(int *test_tup1, int size1, int *test_tup2, int size2) {
UniqueTuple result;
result.elements = (int *)malloc((size1 + size2) * sizeof(int));
int k = 0;
for (int i = 0; i < size1; i++) {
int j;
for (j = 0; j < k; j++) {
if (result.elements[j] == test_tu... | int main() {
int tuple1[] = {3, 4, 5, 6};
int tuple2[] = {5, 7, 4, 10};
UniqueTuple res1 = func0(tuple1, 4, tuple2, 4);
int expected1[] = {3, 4, 5, 6, 7, 10};
assert(res1.size == sizeof(expected1) / sizeof(int));
for (int i = 0; i < res1.size; i++) {
assert(res1.elements[i] == exp... | O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x50,%rsp
mov %rdi,-0x38(%rbp)
mov %esi,-0x3c(%rbp)
mov %rdx,-0x48(%rbp)
mov %ecx,-0x40(%rbp)
mov -0x3c(%rbp),%edx
mov -0x40(%rbp),%eax
add %edx,%eax
cltq
shl $0x2,%rax
mov %rax,%rdi
callq 10d0 <malloc@plt>
mov %rax,-0x10(%rbp)
movl $0... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 50h
mov [rbp+var_38], rdi
mov [rbp+var_3C], esi
mov [rbp+var_48], rdx
mov [rbp+var_40], ecx
mov edx, [rbp+var_3C]
mov eax, [rbp+var_40]
add eax, edx
cdqe
shl rax, 2
mov rdi, rax; size
call _malloc
mov [rbp+var_10], rax
m... | _DWORD * func0(long long a1, int a2, long long a3, int a4)
{
int v4; // eax
int v5; // eax
int v9; // [rsp+2Ch] [rbp-24h]
int i; // [rsp+30h] [rbp-20h]
int j; // [rsp+34h] [rbp-1Ch]
int k; // [rsp+38h] [rbp-18h]
int m; // [rsp+3Ch] [rbp-14h]
_DWORD *v14; // [rsp+40h] [rbp-10h]
v14 = malloc(4LL * (a2 ... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x50
MOV qword ptr [RBP + -0x38],RDI
MOV dword ptr [RBP + -0x3c],ESI
MOV qword ptr [RBP + -0x48],RDX
MOV dword ptr [RBP + -0x40],ECX
MOV EDX,dword ptr [RBP + -0x3c]
MOV EAX,dword ptr [RBP + -0x40]
ADD EAX,EDX
CDQE
SHL RAX,0x2
MOV RDI,RAX
CALL 0x001010d0
MOV qword ptr [RBP + -... | int [16] func0(long param_1,int param_2,long param_3,int param_4)
{
int auVar1 [16];
void *pvVar2;
int local_2c;
int local_28;
int local_24;
int local_20;
int local_1c;
int4 uStack_c;
pvVar2 = malloc((long)(param_4 + param_2) << 2);
local_2c = 0;
for (local_28 = 0; local_28 < param_2; local_2... |
6,133 | func0 |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct {
int *elements;
int size;
} UniqueTuple;
| UniqueTuple func0(int *test_tup1, int size1, int *test_tup2, int size2) {
UniqueTuple result;
result.elements = (int *)malloc((size1 + size2) * sizeof(int));
int k = 0;
for (int i = 0; i < size1; i++) {
int j;
for (j = 0; j < k; j++) {
if (result.elements[j] == test_tu... | int main() {
int tuple1[] = {3, 4, 5, 6};
int tuple2[] = {5, 7, 4, 10};
UniqueTuple res1 = func0(tuple1, 4, tuple2, 4);
int expected1[] = {3, 4, 5, 6, 7, 10};
assert(res1.size == sizeof(expected1) / sizeof(int));
for (int i = 0; i < res1.size; i++) {
assert(res1.elements[i] == exp... | O1 | c | func0:
endbr64
push %r13
push %r12
push %rbp
push %rbx
sub $0x8,%rsp
mov %rdi,%r13
mov %esi,%r12d
mov %rdx,%rbp
mov %ecx,%ebx
lea (%rsi,%rcx,1),%edi
movslq %edi,%rdi
shl $0x2,%rdi
callq 10d0 <malloc@plt>
test %r12d,%r12d
jle 1266 <func0+0x9d>
mov %r13,%r10
lea -0x1(%r12),%edx
le... | func0:
endbr64
push r13
push r12
push rbp
push rbx
sub rsp, 8
mov r13, rdi
mov r12d, esi
mov rbp, rdx
mov ebx, ecx
lea edi, [rsi+rcx]
movsxd rdi, edi
shl rdi, 2
call _malloc
mov r8, rax
test r12d, r12d
jle short loc_1254
mov rdi, r13
lea eax, [r12-1]
lea ... | long long func0(_DWORD *a1, int a2, _DWORD *a3, int a4)
{
_DWORD *v4; // r13
long long v7; // r8
int v8; // ecx
int v9; // eax
_DWORD *v10; // rdx
_DWORD *v11; // rdi
int v12; // eax
_DWORD *v13; // rdx
v4 = a1;
v7 = malloc(4LL * (a2 + a4));
if ( a2 <= 0 )
{
v8 = 0;
}
else
{
v8 =... | func0:
ENDBR64
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x8
MOV R13,RDI
MOV R12D,ESI
MOV RBP,RDX
MOV EBX,ECX
LEA EDI,[RSI + RCX*0x1]
MOVSXD RDI,EDI
SHL RDI,0x2
CALL 0x001010d0
MOV R8,RAX
TEST R12D,R12D
JLE 0x00101254
MOV RDI,R13
LEA EAX,[R12 + -0x1]
LEA R9,[R13 + RAX*0x4]
MOV ECX,0x0
MOV EAX,0x0
JMP 0x00101229
LAB_0... | int1 [16] func0(int *param_1,int param_2,int *param_3,int param_4)
{
int *piVar1;
int iVar2;
int iVar3;
int iVar4;
int *piVar5;
int1 auVar6 [16];
auVar6._0_8_ = (int *)malloc((long)(param_2 + param_4) << 2);
if (param_2 < 1) {
iVar4 = 0;
}
else {
piVar1 = param_1 + (param_2 - 1);
iV... |
6,134 | func0 |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct {
int *elements;
int size;
} UniqueTuple;
| UniqueTuple func0(int *test_tup1, int size1, int *test_tup2, int size2) {
UniqueTuple result;
result.elements = (int *)malloc((size1 + size2) * sizeof(int));
int k = 0;
for (int i = 0; i < size1; i++) {
int j;
for (j = 0; j < k; j++) {
if (result.elements[j] == test_tu... | int main() {
int tuple1[] = {3, 4, 5, 6};
int tuple2[] = {5, 7, 4, 10};
UniqueTuple res1 = func0(tuple1, 4, tuple2, 4);
int expected1[] = {3, 4, 5, 6, 7, 10};
assert(res1.size == sizeof(expected1) / sizeof(int));
for (int i = 0; i < res1.size; i++) {
assert(res1.elements[i] == exp... | O2 | c | func0:
endbr64
push %r13
mov %esi,%r13d
push %r12
mov %ecx,%r12d
push %rbp
mov %rdi,%rbp
lea (%rsi,%rcx,1),%edi
push %rbx
movslq %edi,%rdi
mov %rdx,%rbx
shl $0x2,%rdi
sub $0x8,%rsp
callq 10d0 <malloc@plt>
test %r13d,%r13d
jle 1638 <func0+0x138>
lea -0x1(%r13),%edx
mov %rbp,%r10
... | func0:
endbr64
push r13
mov r13d, esi
push r12
mov r12d, ecx
push rbp
mov rbp, rdi
lea edi, [rsi+rcx]
push rbx
movsxd rdi, edi
mov rbx, rdx
shl rdi, 2
sub rsp, 8
call _malloc
mov r8, rax
test r13d, r13d
jle loc_160F
lea eax, [r13-1]
mov r9, rbp
xor edi,... | long long func0(int *a1, int a2, int *a3, int a4)
{
long long v7; // r8
int *v8; // r9
int v9; // edi
long long v10; // r10
int v11; // esi
long long v12; // rax
long long v13; // r9
int v14; // esi
long long v15; // rax
int v17; // edx
long long v18; // rax
int v19; // edx
long long v20; // ... | func0:
ENDBR64
PUSH R13
MOV R13D,ESI
PUSH R12
MOV R12D,ECX
PUSH RBP
MOV RBP,RDI
LEA EDI,[RSI + RCX*0x1]
PUSH RBX
MOVSXD RDI,EDI
MOV RBX,RDX
SHL RDI,0x2
SUB RSP,0x8
CALL 0x001010d0
MOV R8,RAX
TEST R13D,R13D
JLE 0x0010160f
LEA EAX,[R13 + -0x1]
MOV R9,RBP
XOR EDI,EDI
LEA R10,[RBP + RAX*0x4 + 0x4]
NOP dword ptr [RAX + RAX*... | int1 [16] func0(int *param_1,int param_2,int *param_3,int param_4)
{
int *piVar1;
ulong uVar2;
long lVar3;
int iVar4;
int iVar5;
int1 auVar6 [16];
auVar6._0_8_ = malloc((long)(param_2 + param_4) << 2);
if (param_2 < 1) {
iVar5 = 0;
}
else {
iVar5 = 0;
piVar1 = param_1 + (ulong)(para... |
6,135 | func0 |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct {
int *elements;
int size;
} UniqueTuple;
| UniqueTuple func0(int *test_tup1, int size1, int *test_tup2, int size2) {
UniqueTuple result;
result.elements = (int *)malloc((size1 + size2) * sizeof(int));
int k = 0;
for (int i = 0; i < size1; i++) {
int j;
for (j = 0; j < k; j++) {
if (result.elements[j] == test_tu... | int main() {
int tuple1[] = {3, 4, 5, 6};
int tuple2[] = {5, 7, 4, 10};
UniqueTuple res1 = func0(tuple1, 4, tuple2, 4);
int expected1[] = {3, 4, 5, 6, 7, 10};
assert(res1.size == sizeof(expected1) / sizeof(int));
for (int i = 0; i < res1.size; i++) {
assert(res1.elements[i] == exp... | O3 | c | func0:
endbr64
push %r13
mov %esi,%r13d
push %r12
mov %ecx,%r12d
push %rbp
mov %rdi,%rbp
lea (%rsi,%rcx,1),%edi
push %rbx
movslq %edi,%rdi
mov %rdx,%rbx
shl $0x2,%rdi
sub $0x8,%rsp
callq 10d0 <malloc@plt>
test %r13d,%r13d
jle 1618 <func0+0x138>
lea -0x1(%r13),%edx
mov %rbp,%r10
... | func0:
endbr64
push r13
movsxd r13, esi
push r12
movsxd r12, ecx
push rbp
mov rbp, rdi
lea edi, [r13+r12+0]
push rbx
movsxd rdi, edi
mov rbx, rdx
shl rdi, 2; size
sub rsp, 8
call _malloc
mov r8, rax
test r13d, r13d
jle loc_1557
mov rdi, rbp
lea r9, [rbp+r13*4+0]
... | _DWORD * func0(int *a1, int a2, int *a3, int a4)
{
long long v4; // r12
_DWORD *v6; // r8
int *v7; // r9
int v8; // ecx
int v9; // eax
_DWORD *v10; // rdx
int *v11; // rdi
int *v12; // r9
int v13; // eax
_DWORD *v14; // rdx
int v16; // edx
int v17; // edx
v4 = a4;
v6 = malloc(4LL * (a2 + a4... | func0:
ENDBR64
PUSH R13
MOVSXD R13,ESI
PUSH R12
MOVSXD R12,ECX
PUSH RBP
MOV RBP,RDI
LEA EDI,[R13 + R12*0x1]
PUSH RBX
MOVSXD RDI,EDI
MOV RBX,RDX
SHL RDI,0x2
SUB RSP,0x8
CALL 0x001010d0
MOV R8,RAX
TEST R13D,R13D
JLE 0x00101557
MOV RDI,RBP
LEA R9,[RBP + R13*0x4]
XOR ECX,ECX
LAB_00101491:
XOR EAX,EAX
TEST ECX,ECX
JLE 0x001... | int [16] func0(int *param_1,int param_2,int *param_3,int param_4)
{
int *piVar1;
int iVar2;
int iVar3;
int iVar4;
int *piVar5;
int auVar6 [16];
int auVar7 [16];
auVar6._0_8_ = (int *)malloc((long)(param_2 + param_4) << 2);
if (0 < param_2) {
piVar1 = param_1 + param_2;
iVar3 = 0;
LAB_0010... |
6,136 | func0 |
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define MAX_ENTRIES 100
#define MAX_VALUES 10
typedef struct {
int key;
int values[MAX_VALUES];
int count;
} map_entry;
typedef struct {
map_entry entries[MAX_ENTRIES];
int size;
} map;
int find_key(map* m, int key) {... | map func0(int test_keys[], int test_vals[], int n) {
map res;
res.size = 0;
for(int i = 0; i < n; i++) {
int key = test_keys[i];
int val = test_vals[i];
// setdefault(val, [])
if(find_key(&res, val) == -1){
res.entries[res.size].key = val;
res... | int main(){
// First test case
int test1_keys[] = {5, 7, 2, 3, 8};
int test1_vals[] = {3, 5, 7, 8, 4};
int n1 = 5;
map result1 = func0(test1_keys, test1_vals, n1);
map expected1;
expected1.size = 6;
expected1.entries[0].key = 3; expected1.entries[0].count = 1; expected1.entries[0... | O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x1000,%rsp
orq $0x0,(%rsp)
sub $0x300,%rsp
mov %rdi,-0x12e8(%rbp)
mov %rsi,-0x12f0(%rbp)
mov %rdx,-0x12f8(%rbp)
mov %ecx,-0x12fc(%rbp)
mov %fs:0x28,%rax
mov %rax,-0x8(%rbp)
xor %eax,%eax
movl $0x0,-0x10(%rbp)
movl $0x0,-0x12e0(%rbp)
jmp... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 1000h
or [rsp+1000h+var_1000], 0
sub rsp, 300h
mov [rbp+var_12E8], rdi
mov [rbp+var_12F0], rsi
mov [rbp+var_12F8], rdx
mov [rbp+var_12FC], ecx
mov rax, fs:28h
mov [rbp+var_8], rax
xor eax, eax
mov [rbp+var_10], 0
mov [... | _QWORD * func0(_QWORD *a1, long long a2, long long a3, int a4)
{
int v4; // edx
int i; // [rsp+20h] [rbp-12E0h]
int key; // [rsp+24h] [rbp-12DCh]
unsigned int v10; // [rsp+28h] [rbp-12D8h]
unsigned int v11; // [rsp+2Ch] [rbp-12D4h]
_QWORD v12[90]; // [rsp+30h] [rbp-12D0h] BYREF
long long v13; // [rsp+12EC... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x1000
OR qword ptr [RSP],0x0
SUB RSP,0x300
MOV qword ptr [RBP + -0x12e8],RDI
MOV qword ptr [RBP + -0x12f0],RSI
MOV qword ptr [RBP + -0x12f8],RDX
MOV dword ptr [RBP + -0x12fc],ECX
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RBP + -0x8],RAX
XOR EAX,EAX
MOV dword ptr [RBP + -0x1... | int8 * func0(int8 *param_1,long param_2,long param_3,int param_4)
{
int4 uVar1;
int4 uVar2;
int iVar3;
ulong uVar4;
long lVar5;
int8 *puVar6;
int8 *puVar7;
long in_FS_OFFSET;
byte bVar8;
int local_12e8;
int local_12e4;
int8 local_12d8;
int aiStack_12ac [1188];
int4 local_1c;
int iStack_18... |
6,137 | func0 |
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define MAX_ENTRIES 100
#define MAX_VALUES 10
typedef struct {
int key;
int values[MAX_VALUES];
int count;
} map_entry;
typedef struct {
map_entry entries[MAX_ENTRIES];
int size;
} map;
int find_key(map* m, int key) {... | map func0(int test_keys[], int test_vals[], int n) {
map res;
res.size = 0;
for(int i = 0; i < n; i++) {
int key = test_keys[i];
int val = test_vals[i];
// setdefault(val, [])
if(find_key(&res, val) == -1){
res.entries[res.size].key = val;
res... | int main(){
// First test case
int test1_keys[] = {5, 7, 2, 3, 8};
int test1_vals[] = {3, 5, 7, 8, 4};
int n1 = 5;
map result1 = func0(test1_keys, test1_vals, n1);
map expected1;
expected1.size = 6;
expected1.entries[0].key = 3; expected1.entries[0].count = 1; expected1.entries[0... | O1 | c | func0:
endbr64
push %r15
push %r14
push %r13
push %r12
push %rbp
push %rbx
sub $0x1000,%rsp
orq $0x0,(%rsp)
sub $0x2e8,%rsp
mov %rdi,0x8(%rsp)
mov %fs:0x28,%rax
mov %rax,0x12d8(%rsp)
xor %eax,%eax
movl $0x0,0x12d0(%rsp)
test %ecx,%ecx
jle 12d4 <func0+0x13d>
mov %rsi,%r14
mov ... | func0:
endbr64
push r15
push r14
push r13
push r12
push rbp
push rbx
sub rsp, 1000h
or [rsp+1030h+var_1030], 0
sub rsp, 2E8h
mov [rsp+1318h+var_1310], rdi
mov rax, fs:28h
mov [rsp+1318h+var_40], rax
xor eax, eax
mov [rsp+1318h+var_48], 0
test ecx, ecx
jle loc_12... | _QWORD * func0(_QWORD *a1, long long a2, long long a3, int a4)
{
long long i; // rbx
int v7; // edx
long long v8; // rsi
int key; // eax
long long v10; // rsi
int v11; // edx
unsigned int v12; // r12d
unsigned int v13; // ebp
long long v15; // [rsp+0h] [rbp-1318h]
_QWORD v16[91]; // [rsp+10h] [rbp-1... | func0:
ENDBR64
PUSH R15
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x1000
OR qword ptr [RSP],0x0
SUB RSP,0x2e8
MOV qword ptr [RSP + 0x8],RDI
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x12d8],RAX
XOR EAX,EAX
MOV dword ptr [RSP + 0x12d0],0x0
TEST ECX,ECX
JLE 0x001012d0
MOV R14,RSI
MOV R15,RDX
MOV EAX,ECX... | int8 * func0(int8 *param_1,long param_2,long param_3,uint param_4)
{
int4 uVar1;
int4 uVar2;
int iVar3;
long lVar4;
int iVar5;
ulong uVar6;
int8 *puVar7;
int8 *puVar8;
long in_FS_OFFSET;
byte bVar9;
int8 local_1308;
int aiStack_12dc [1188];
int4 local_4c;
int iStack_48;
long local_40;
... |
6,138 | func0 |
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define MAX_ENTRIES 100
#define MAX_VALUES 10
typedef struct {
int key;
int values[MAX_VALUES];
int count;
} map_entry;
typedef struct {
map_entry entries[MAX_ENTRIES];
int size;
} map;
int find_key(map* m, int key) {... | map func0(int test_keys[], int test_vals[], int n) {
map res;
res.size = 0;
for(int i = 0; i < n; i++) {
int key = test_keys[i];
int val = test_vals[i];
// setdefault(val, [])
if(find_key(&res, val) == -1){
res.entries[res.size].key = val;
res... | int main(){
// First test case
int test1_keys[] = {5, 7, 2, 3, 8};
int test1_vals[] = {3, 5, 7, 8, 4};
int n1 = 5;
map result1 = func0(test1_keys, test1_vals, n1);
map expected1;
expected1.size = 6;
expected1.entries[0].key = 3; expected1.entries[0].count = 1; expected1.entries[0... | O2 | c | func0:
endbr64
push %r13
push %r12
push %rbp
push %rbx
sub $0x1000,%rsp
orq $0x0,(%rsp)
sub $0x2d8,%rsp
mov %fs:0x28,%rax
mov %rax,0x12c8(%rsp)
xor %eax,%eax
mov %rdi,%r10
test %ecx,%ecx
jle 19e4 <func0+0x194>
mov %rsi,%r11
xor %r9d,%r9d
xor %edi,%edi
mov %rsp,%rsi
mov (... | func0:
endbr64
push r13
push r12
push rbp
push rbx
sub rsp, 1000h
or [rsp+1020h+var_1020], 0
sub rsp, 2D8h
mov rax, fs:28h
mov [rsp+12F8h+var_30], rax
xor eax, eax
mov r9, rdi
test ecx, ecx
jle loc_19FE
mov r11, rsi
movsxd r10, ecx
mov rbx, rdx
xor r8d, r8d
x... | _QWORD * func0(_QWORD *a1, long long a2, long long a3, int a4)
{
long long v5; // r10
long long v7; // r8
int v8; // ecx
int v9; // r12d
int v10; // edi
_QWORD *v11; // rax
_DWORD *v12; // rdx
long long v13; // rax
long long v14; // rdx
long long v16; // rax
long long v17; // rax
int v18; // r12... | func0:
ENDBR64
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x1000
OR qword ptr [RSP],0x0
SUB RSP,0x2d8
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x12c8],RAX
XOR EAX,EAX
MOV R9,RDI
TEST ECX,ECX
JLE 0x001019fe
MOV R11,RSI
MOVSXD R10,ECX
MOV RBX,RDX
XOR R8D,R8D
XOR ECX,ECX
MOV RSI,RSP
LEA RBP,[RSP + 0x30]
NOP dword... | int8 * func0(int8 *param_1,long param_2,long param_3,int param_4)
{
int iVar1;
int iVar2;
int *piVar3;
long lVar4;
ulong uVar5;
long lVar6;
int8 *puVar7;
int8 *puVar8;
long lVar9;
int iVar10;
long in_FS_OFFSET;
int8 local_12f8;
int aiStack_12cc [1188];
int4 local_3c;
int iStack_38;
long... |
6,139 | func0 |
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define MAX_ENTRIES 100
#define MAX_VALUES 10
typedef struct {
int key;
int values[MAX_VALUES];
int count;
} map_entry;
typedef struct {
map_entry entries[MAX_ENTRIES];
int size;
} map;
int find_key(map* m, int key) {... | map func0(int test_keys[], int test_vals[], int n) {
map res;
res.size = 0;
for(int i = 0; i < n; i++) {
int key = test_keys[i];
int val = test_vals[i];
// setdefault(val, [])
if(find_key(&res, val) == -1){
res.entries[res.size].key = val;
res... | int main(){
// First test case
int test1_keys[] = {5, 7, 2, 3, 8};
int test1_vals[] = {3, 5, 7, 8, 4};
int n1 = 5;
map result1 = func0(test1_keys, test1_vals, n1);
map expected1;
expected1.size = 6;
expected1.entries[0].key = 3; expected1.entries[0].count = 1; expected1.entries[0... | O3 | c | func0:
endbr64
push %r13
push %r12
push %rbp
push %rbx
sub $0x1000,%rsp
orq $0x0,(%rsp)
sub $0x2d8,%rsp
mov %fs:0x28,%rax
mov %rax,0x12c8(%rsp)
xor %eax,%eax
mov %rdi,%r10
test %ecx,%ecx
jle 1c94 <func0+0x194>
mov %rsi,%r11
xor %r9d,%r9d
xor %edi,%edi
mov %rsp,%rsi
mov (... | func0:
endbr64
push r12
push rbp
push rbx
sub rsp, 1000h
or [rsp+1018h+var_1018], 0
sub rsp, 2D0h
mov rax, fs:28h
mov [rsp+12E8h+var_20], rax
xor eax, eax
mov r10, rdi
test ecx, ecx
jle loc_1C69
movsxd rcx, ecx
mov r11, rsi
mov rbx, rdx
xor r9d, r9d
lea rbp,... | _QWORD * func0(_QWORD *a1, long long a2, long long a3, int a4)
{
long long v6; // r9
long long v7; // rbp
int v8; // ecx
int v9; // r8d
int v10; // edi
_DWORD *v11; // rax
int v12; // edx
_DWORD *v13; // rdx
long long v14; // rax
long long v15; // rdx
long long v16; // rax
long long v17; // rax
... | func0:
ENDBR64
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x1000
OR qword ptr [RSP],0x0
SUB RSP,0x2d0
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x12c8],RAX
XOR EAX,EAX
MOV R10,RDI
TEST ECX,ECX
JLE 0x00101c69
MOVSXD RCX,ECX
MOV R11,RSI
MOV RBX,RDX
XOR R9D,R9D
LEA RBP,[RCX*0x4]
MOV RSI,RSP
XOR ECX,ECX
NOP word ptr [RAX + ... | int8 * func0(int8 *param_1,long param_2,long param_3,int param_4)
{
int *piVar1;
long lVar2;
ulong uVar3;
long lVar4;
int8 *puVar5;
int iVar6;
int8 *puVar7;
int iVar8;
long lVar9;
int iVar10;
long in_FS_OFFSET;
int8 local_12e8;
int aiStack_12bc [1188];
int4 local_2c;
int iStack_28;
long... |
6,140 | func0 | #include <assert.h>
#include <stdlib.h>
| int func0(int** lst, int* sizes, int lst_size) {
int maxLength = 0;
for (int i = 0; i < lst_size; i++) {
if (sizes[i] > maxLength) {
maxLength = sizes[i];
}
}
return maxLength;
}
| int main() {
int lst1_sizes[] = {1, 2, 4};
int* lst1[] = {(int[]){1}, (int[]){1, 4}, (int[]){5, 6, 7, 8}};
assert(func0(lst1, lst1_sizes, 3) == 4);
int lst2_sizes[] = {2, 2, 3};
int* lst2[] = {(int[]){0, 1}, (int[]){2, 2}, (int[]){3, 2, 1}};
assert(func0(lst2, lst2_sizes, 3) == 3);
... | O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
mov %rdi,-0x18(%rbp)
mov %rsi,-0x20(%rbp)
mov %edx,-0x24(%rbp)
movl $0x0,-0x8(%rbp)
movl $0x0,-0x4(%rbp)
jmp 11c4 <func0+0x5b>
mov -0x4(%rbp),%eax
cltq
lea 0x0(,%rax,4),%rdx
mov -0x20(%rbp),%rax
add %rdx,%rax
mov (%rax),%eax
cmp %eax,-0x8(%rb... | func0:
endbr64
push rbp
mov rbp, rsp
mov [rbp+var_18], rdi
mov [rbp+var_20], rsi
mov [rbp+var_24], edx
mov [rbp+var_8], 0
mov [rbp+var_4], 0
jmp short loc_11C4
loc_118C:
mov eax, [rbp+var_4]
cdqe
lea rdx, ds:0[rax*4]
mov rax, [rbp+var_20]
add rax, rdx
mov eax, [rax]
cm... | long long func0(long long a1, long long a2, int a3)
{
unsigned int v4; // [rsp+1Ch] [rbp-8h]
int i; // [rsp+20h] [rbp-4h]
v4 = 0;
for ( i = 0; i < a3; ++i )
{
if ( (signed int)v4 < *(_DWORD *)(4LL * i + a2) )
v4 = *(_DWORD *)(4LL * i + a2);
}
return v4;
} | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
MOV qword ptr [RBP + -0x18],RDI
MOV qword ptr [RBP + -0x20],RSI
MOV dword ptr [RBP + -0x24],EDX
MOV dword ptr [RBP + -0x8],0x0
MOV dword ptr [RBP + -0x4],0x0
JMP 0x001011c4
LAB_0010118c:
MOV EAX,dword ptr [RBP + -0x4]
CDQE
LEA RDX,[RAX*0x4]
MOV RAX,qword ptr [RBP + -0x20]
ADD RAX,RDX... | int func0(int8 param_1,long param_2,int param_3)
{
int4 local_10;
int4 local_c;
local_10 = 0;
for (local_c = 0; local_c < param_3; local_c = local_c + 1) {
if (local_10 < *(int *)(param_2 + (long)local_c * 4)) {
local_10 = *(int *)(param_2 + (long)local_c * 4);
}
}
return local_10;
} |
6,141 | func0 | #include <assert.h>
#include <stdlib.h>
| int func0(int** lst, int* sizes, int lst_size) {
int maxLength = 0;
for (int i = 0; i < lst_size; i++) {
if (sizes[i] > maxLength) {
maxLength = sizes[i];
}
}
return maxLength;
}
| int main() {
int lst1_sizes[] = {1, 2, 4};
int* lst1[] = {(int[]){1}, (int[]){1, 4}, (int[]){5, 6, 7, 8}};
assert(func0(lst1, lst1_sizes, 3) == 4);
int lst2_sizes[] = {2, 2, 3};
int* lst2[] = {(int[]){0, 1}, (int[]){2, 2}, (int[]){3, 2, 1}};
assert(func0(lst2, lst2_sizes, 3) == 3);
... | O1 | c | func0:
endbr64
test %edx,%edx
jle 1194 <func0+0x2b>
mov %rsi,%rax
lea -0x1(%rdx),%edx
lea 0x4(%rsi,%rdx,4),%rsi
mov $0x0,%edx
mov (%rax),%ecx
cmp %ecx,%edx
cmovl %ecx,%edx
add $0x4,%rax
cmp %rsi,%rax
jne 1181 <func0+0x18>
mov %edx,%eax
retq
mov $0x0,%edx
jmp 1191 <func0+0x28>
| func0:
endbr64
test edx, edx
jle short loc_1194
mov rax, rsi
lea edx, [rdx-1]
lea rsi, [rsi+rdx*4+4]
mov edx, 0
loc_1181:
mov ecx, [rax]
cmp edx, ecx
cmovl edx, ecx
add rax, 4
cmp rax, rsi
jnz short loc_1181
loc_1191:
mov eax, edx
retn
loc_1194:
mov edx, 0
jmp sh... | long long func0(long long a1, unsigned int *a2, int a3)
{
unsigned int *v3; // rax
long long v4; // rsi
unsigned int v5; // edx
if ( a3 <= 0 )
{
return 0;
}
else
{
v3 = a2;
v4 = (long long)&a2[a3 - 1 + 1];
v5 = 0;
do
{
if ( (int)v5 < (int)*v3 )
v5 = *v3;
++v... | func0:
ENDBR64
TEST EDX,EDX
JLE 0x00101194
MOV RAX,RSI
LEA EDX,[RDX + -0x1]
LEA RSI,[RSI + RDX*0x4 + 0x4]
MOV EDX,0x0
LAB_00101181:
MOV ECX,dword ptr [RAX]
CMP EDX,ECX
CMOVL EDX,ECX
ADD RAX,0x4
CMP RAX,RSI
JNZ 0x00101181
LAB_00101191:
MOV EAX,EDX
RET
LAB_00101194:
MOV EDX,0x0
JMP 0x00101191 | int func0(int8 param_1,int *param_2,int param_3)
{
int *piVar1;
int iVar2;
if (param_3 < 1) {
iVar2 = 0;
}
else {
piVar1 = param_2 + (ulong)(param_3 - 1) + 1;
iVar2 = 0;
do {
if (iVar2 < *param_2) {
iVar2 = *param_2;
}
param_2 = param_2 + 1;
} while (param_2 !... |
6,142 | func0 | #include <assert.h>
#include <stdlib.h>
| int func0(int** lst, int* sizes, int lst_size) {
int maxLength = 0;
for (int i = 0; i < lst_size; i++) {
if (sizes[i] > maxLength) {
maxLength = sizes[i];
}
}
return maxLength;
}
| int main() {
int lst1_sizes[] = {1, 2, 4};
int* lst1[] = {(int[]){1}, (int[]){1, 4}, (int[]){5, 6, 7, 8}};
assert(func0(lst1, lst1_sizes, 3) == 4);
int lst2_sizes[] = {2, 2, 3};
int* lst2[] = {(int[]){0, 1}, (int[]){2, 2}, (int[]){3, 2, 1}};
assert(func0(lst2, lst2_sizes, 3) == 3);
... | O2 | c | func0:
endbr64
test %edx,%edx
jle 1170 <func0+0x30>
lea -0x1(%rdx),%eax
lea 0x4(%rsi,%rax,4),%rcx
xor %eax,%eax
nopw 0x0(%rax,%rax,1)
mov (%rsi),%edx
cmp %edx,%eax
cmovl %edx,%eax
add $0x4,%rsi
cmp %rcx,%rsi
jne 1158 <func0+0x18>
retq
nopl 0x0(%rax)
xor %eax,%eax
retq
nopw %cs:0x0... | func0:
endbr64
test edx, edx
jle short loc_1170
lea eax, [rdx-1]
lea rcx, [rsi+rax*4+4]
xor eax, eax
nop word ptr [rax+rax+00h]
loc_1158:
mov edx, [rsi]
cmp eax, edx
cmovl eax, edx
add rsi, 4
cmp rsi, rcx
jnz short loc_1158
retn
loc_1170:
xor eax, eax
retn | long long func0(long long a1, _DWORD *a2, int a3)
{
long long v3; // rcx
long long result; // rax
if ( a3 <= 0 )
return 0LL;
v3 = (long long)&a2[a3 - 1 + 1];
result = 0LL;
do
{
if ( (int)result < *a2 )
result = (unsigned int)*a2;
++a2;
}
while ( a2 != (_DWORD *)v3 );
return resul... | func0:
ENDBR64
TEST EDX,EDX
JLE 0x00101170
LEA EAX,[RDX + -0x1]
LEA RCX,[RSI + RAX*0x4 + 0x4]
XOR EAX,EAX
NOP word ptr [RAX + RAX*0x1]
LAB_00101158:
MOV EDX,dword ptr [RSI]
CMP EAX,EDX
CMOVL EAX,EDX
ADD RSI,0x4
CMP RSI,RCX
JNZ 0x00101158
RET
LAB_00101170:
XOR EAX,EAX
RET | int func0(int8 param_1,int *param_2,int param_3)
{
int *piVar1;
int iVar2;
if (0 < param_3) {
piVar1 = param_2 + (ulong)(param_3 - 1) + 1;
iVar2 = 0;
do {
if (iVar2 < *param_2) {
iVar2 = *param_2;
}
param_2 = param_2 + 1;
} while (param_2 != piVar1);
return iVar2;... |
6,143 | func0 | #include <assert.h>
#include <stdlib.h>
| int func0(int** lst, int* sizes, int lst_size) {
int maxLength = 0;
for (int i = 0; i < lst_size; i++) {
if (sizes[i] > maxLength) {
maxLength = sizes[i];
}
}
return maxLength;
}
| int main() {
int lst1_sizes[] = {1, 2, 4};
int* lst1[] = {(int[]){1}, (int[]){1, 4}, (int[]){5, 6, 7, 8}};
assert(func0(lst1, lst1_sizes, 3) == 4);
int lst2_sizes[] = {2, 2, 3};
int* lst2[] = {(int[]){0, 1}, (int[]){2, 2}, (int[]){3, 2, 1}};
assert(func0(lst2, lst2_sizes, 3) == 3);
... | O3 | c | func0:
endbr64
test %edx,%edx
jle 1210 <func0+0xd0>
lea -0x1(%rdx),%eax
cmp $0x2,%eax
jbe 1219 <func0+0xd9>
mov %edx,%ecx
mov %rsi,%rax
pxor %xmm2,%xmm2
shr $0x2,%ecx
shl $0x4,%rcx
add %rsi,%rcx
nopl 0x0(%rax,%rax,1)
movdqu (%rax),%xmm0
add $0x10,%rax
movdqa %xmm0,%xmm1
pcmpgtd %xmm2... | func0:
endbr64
mov rdi, rsi
mov ecx, edx
test edx, edx
jle loc_1218
lea eax, [rdx-1]
cmp eax, 2
jbe loc_1221
shr edx, 2
mov rax, rsi
pxor xmm2, xmm2
shl rdx, 4
add rdx, rsi
xchg ax, ax
loc_1170:
movdqu xmm0, xmmword ptr [rax]
add rax, 10h
movdqa xmm1, xmm0
pcmpgtd ... | long long func0(long long a1, const __m128i *a2, int a3)
{
const __m128i *v5; // rax
__m128i v6; // xmm2
const __m128i *v7; // rdx
__m128i v8; // xmm0
__m128i v9; // xmm1
__m128i v10; // xmm0
signed int v11; // edx
__m128i v12; // xmm1
__m128i v13; // xmm1
__m128i v14; // xmm2
__m128i v15; // xmm... | func0:
ENDBR64
MOV RDI,RSI
MOV ECX,EDX
TEST EDX,EDX
JLE 0x00101218
LEA EAX,[RDX + -0x1]
CMP EAX,0x2
JBE 0x00101221
SHR EDX,0x2
MOV RAX,RSI
PXOR XMM2,XMM2
SHL RDX,0x4
ADD RDX,RSI
NOP
LAB_00101170:
MOVDQU XMM0,xmmword ptr [RAX]
ADD RAX,0x10
MOVDQA XMM1,XMM0
PCMPGTD XMM1,XMM2
PAND XMM0,XMM1
PANDN XMM1,XMM2
MOVDQA XMM2,XMM... | uint func0(int8 param_1,uint *param_2,uint param_3)
{
uint *puVar1;
uint *puVar2;
uint *puVar3;
uint *puVar4;
uint uVar5;
uint uVar6;
uint uVar7;
uint uVar8;
uint uVar9;
uint uVar10;
uint uVar11;
uint uVar12;
uint uVar13;
if ((int)param_3 < 1) {
uVar6 = 0;
}
else {
if (param_... |
6,144 | func0 |
#include <stdio.h>
#include <string.h>
#include <assert.h>
| void func0(const char *text, char values[][50], int *count) {
int index = 0;
*count = 0;
const char *start = NULL;
const char *end = NULL;
while ((start = strchr(text, '"')) != NULL) {
end = strchr(start + 1, '"');
if (end == NULL) break;
int len = end... | int main() {
char values[10][50];
int count, i;
func0("\"Python\", \"PHP\", \"Java\"", values, &count);
assert(count == 3);
assert(strcmp(values[0], "Python") == 0);
assert(strcmp(values[1], "PHP") == 0);
assert(strcmp(values[2], "Java") == 0);
func0("\"python\",\"program\",\... | O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x40,%rsp
mov %rdi,-0x28(%rbp)
mov %rsi,-0x30(%rbp)
mov %rdx,-0x38(%rbp)
movl $0x0,-0x18(%rbp)
mov -0x38(%rbp),%rax
movl $0x0,(%rax)
movq $0x0,-0x10(%rbp)
movq $0x0,-0x8(%rbp)
jmpq 12bf <func0+0xf6>
mov -0x10(%rbp),%rax
add $0x1,%rax
mov ... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 40h
mov [rbp+s], rdi
mov [rbp+var_30], rsi
mov [rbp+var_38], rdx
mov [rbp+var_18], 0
mov rax, [rbp+var_38]
mov dword ptr [rax], 0
mov [rbp+var_10], 0
mov [rbp+var_8], 0
jmp loc_12BF
loc_1207:
mov rax, [rbp+var_10]
add r... | _DWORD * func0(const char *a1, long long a2, _DWORD *a3)
{
char *i; // rax
_DWORD *result; // rax
int v6; // [rsp+28h] [rbp-18h]
char *v7; // [rsp+30h] [rbp-10h]
char *v8; // [rsp+38h] [rbp-8h]
v6 = 0;
*a3 = 0;
for ( i = strchr(a1, 34); ; i = strchr(v8 + 1, 34) )
{
v7 = i;
if ( !i )
bre... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x40
MOV qword ptr [RBP + -0x28],RDI
MOV qword ptr [RBP + -0x30],RSI
MOV qword ptr [RBP + -0x38],RDX
MOV dword ptr [RBP + -0x18],0x0
MOV RAX,qword ptr [RBP + -0x38]
MOV dword ptr [RAX],0x0
MOV qword ptr [RBP + -0x10],0x0
MOV qword ptr [RBP + -0x8],0x0
JMP 0x001012bf
LAB_00101... | void func0(char *param_1,long param_2,int *param_3)
{
int iVar1;
char *pcVar2;
char *local_30;
int local_20;
local_20 = 0;
*param_3 = 0;
local_30 = param_1;
while ((pcVar2 = strchr(local_30,0x22), pcVar2 != (char *)0x0 &&
(local_30 = strchr(pcVar2 + 1,0x22), local_30 != (char *)0x0))) {
... |
6,145 | func0 |
#include <stdio.h>
#include <string.h>
#include <assert.h>
| void func0(const char *text, char values[][50], int *count) {
int index = 0;
*count = 0;
const char *start = NULL;
const char *end = NULL;
while ((start = strchr(text, '"')) != NULL) {
end = strchr(start + 1, '"');
if (end == NULL) break;
int len = end... | int main() {
char values[10][50];
int count, i;
func0("\"Python\", \"PHP\", \"Java\"", values, &count);
assert(count == 3);
assert(strcmp(values[0], "Python") == 0);
assert(strcmp(values[1], "PHP") == 0);
assert(strcmp(values[2], "Java") == 0);
func0("\"python\",\"program\",\... | O1 | c | func0:
endbr64
push %r15
push %r14
push %r13
push %r12
push %rbp
push %rbx
sub $0x8,%rsp
mov %rdx,%r13
movl $0x0,(%rdx)
mov %rsi,%rbp
mov $0x0,%r12d
mov $0x22,%esi
callq 10a0 <strchr@plt>
test %rax,%rax
je 1220 <func0+0x77>
lea 0x1(%rax),%rbx
mov $0x22,%esi
mov %rbx,%rdi
cal... | func0:
endbr64
push r15
push r14
push r13
push r12
push rbp
push rbx
sub rsp, 8
mov r13, rdx
mov dword ptr [rdx], 0
mov rbp, rsi
mov r12d, 0
jmp short loc_1218
loc_11EF:
mov r15, rax
sub r15, rbx
movsxd r15, r15d
mov rdx, r15
mov rsi, rbx
mov rdi, rbp
call ... | long long func0(long long a1, long long a2, _DWORD *a3)
{
int i; // r12d
long long v6; // r15
long long result; // rax
long long v8; // rbx
long long v9; // r14
*a3 = 0;
for ( i = 0; ; ++i )
{
result = strchr(a1, 34LL);
if ( !result )
break;
v8 = result + 1;
result = strchr(resul... | func0:
ENDBR64
PUSH R15
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x8
MOV R13,RDX
MOV dword ptr [RDX],0x0
MOV RBP,RSI
MOV R12D,0x0
JMP 0x00101218
LAB_001011ef:
MOV R15,RAX
SUB R15,RBX
MOVSXD R15,R15D
MOV RDX,R15
MOV RSI,RBX
MOV RDI,RBP
CALL 0x00101090
MOV byte ptr [RBP + R15*0x1],0x0
ADD R12D,0x1
LEA RDI,[R1... | void func0(char *param_1,char *param_2,int *param_3)
{
char *pcVar1;
int iVar2;
size_t __n;
*param_3 = 0;
iVar2 = 0;
while( true ) {
pcVar1 = strchr(param_1,0x22);
if (pcVar1 == (char *)0x0) break;
pcVar1 = pcVar1 + 1;
param_1 = strchr(pcVar1,0x22);
if (param_1 == (char *)0x0) break;... |
6,146 | func0 |
#include <stdio.h>
#include <string.h>
#include <assert.h>
| void func0(const char *text, char values[][50], int *count) {
int index = 0;
*count = 0;
const char *start = NULL;
const char *end = NULL;
while ((start = strchr(text, '"')) != NULL) {
end = strchr(start + 1, '"');
if (end == NULL) break;
int len = end... | int main() {
char values[10][50];
int count, i;
func0("\"Python\", \"PHP\", \"Java\"", values, &count);
assert(count == 3);
assert(strcmp(values[0], "Python") == 0);
assert(strcmp(values[1], "PHP") == 0);
assert(strcmp(values[2], "Java") == 0);
func0("\"python\",\"program\",\... | O2 | c | func0:
endbr64
push %r15
push %r14
push %r13
mov %rdx,%r13
push %r12
xor %r12d,%r12d
push %rbp
push %rbx
mov %rsi,%rbx
sub $0x8,%rsp
movl $0x0,(%rdx)
jmp 152a <func0+0x6a>
nopl 0x0(%rax,%rax,1)
lea 0x1(%rax),%rbp
mov $0x22,%esi
mov %rbp,%rdi
callq 10a0 <strchr@plt>
mov %rax,%... | func0:
endbr64
push r15
push r14
push r13
mov r13, rdx
push r12
xor r12d, r12d
push rbp
push rbx
mov rbx, rsi
sub rsp, 8
mov dword ptr [rdx], 0
jmp short loc_152A
loc_14E8:
lea rbp, [rax+1]
mov esi, 22h ; '"'
mov rdi, rbp
call _strchr
mov r14, rax
test rax... | long long func0(long long a1, long long a2, _DWORD *a3)
{
int v4; // r12d
long long v6; // rbp
long long result; // rax
long long v8; // r14
long long v9; // rdi
long long v10; // r15
v4 = 0;
*a3 = 0;
while ( 1 )
{
result = strchr(a1, 34LL);
if ( !result )
break;
v6 = result + 1;... | func0:
ENDBR64
PUSH R15
PUSH R14
PUSH R13
MOV R13,RDX
PUSH R12
XOR R12D,R12D
PUSH RBP
PUSH RBX
MOV RBX,RSI
SUB RSP,0x8
MOV dword ptr [RDX],0x0
JMP 0x0010152a
LAB_001014e8:
LEA RBP,[RAX + 0x1]
MOV ESI,0x22
MOV RDI,RBP
CALL 0x001010a0
MOV R14,RAX
TEST RAX,RAX
JZ 0x00101539
MOV R15,RAX
MOV RDI,RBX
MOV RSI,RBP
ADD R12D,0x1... | void func0(char *param_1,char *param_2,int *param_3)
{
char *pcVar1;
int iVar2;
size_t __n;
iVar2 = 0;
*param_3 = 0;
while( true ) {
pcVar1 = strchr(param_1,0x22);
if (pcVar1 == (char *)0x0) break;
pcVar1 = pcVar1 + 1;
param_1 = strchr(pcVar1,0x22);
if (param_1 == (char *)0x0) break;... |
6,147 | func0 |
#include <stdio.h>
#include <string.h>
#include <assert.h>
| void func0(const char *text, char values[][50], int *count) {
int index = 0;
*count = 0;
const char *start = NULL;
const char *end = NULL;
while ((start = strchr(text, '"')) != NULL) {
end = strchr(start + 1, '"');
if (end == NULL) break;
int len = end... | int main() {
char values[10][50];
int count, i;
func0("\"Python\", \"PHP\", \"Java\"", values, &count);
assert(count == 3);
assert(strcmp(values[0], "Python") == 0);
assert(strcmp(values[1], "PHP") == 0);
assert(strcmp(values[2], "Java") == 0);
func0("\"python\",\"program\",\... | O3 | c | func0:
endbr64
push %r15
push %r14
push %r13
mov %rdx,%r13
push %r12
xor %r12d,%r12d
push %rbp
push %rbx
mov %rsi,%rbx
sub $0x8,%rsp
movl $0x0,(%rdx)
jmp 152a <func0+0x6a>
nopl 0x0(%rax,%rax,1)
lea 0x1(%rax),%rbp
mov $0x22,%esi
mov %rbp,%rdi
callq 10a0 <strchr@plt>
mov %rax,%... | func0:
endbr64
push r15
push r14
push r13
mov r13, rdx
push r12
xor r12d, r12d
push rbp
mov rbp, rsi
push rbx
sub rsp, 8
mov dword ptr [rdx], 0
jmp short loc_150A
loc_14C8:
lea rbx, [rax+1]
mov esi, 22h ; '"'; c
mov rdi, rbx; s
call _strchr
mov r14, rax
test ... | char * func0(const char *a1, char *a2, _DWORD *a3)
{
int v4; // r12d
const char *v6; // rbx
char *result; // rax
char *v8; // r14
char *v9; // rdi
size_t v10; // r15
v4 = 0;
*a3 = 0;
while ( 1 )
{
result = strchr(a1, 34);
if ( !result )
break;
v6 = result + 1;
result = strchr(... | func0:
ENDBR64
PUSH R15
PUSH R14
PUSH R13
MOV R13,RDX
PUSH R12
XOR R12D,R12D
PUSH RBP
MOV RBP,RSI
PUSH RBX
SUB RSP,0x8
MOV dword ptr [RDX],0x0
JMP 0x0010150a
LAB_001014c8:
LEA RBX,[RAX + 0x1]
MOV ESI,0x22
MOV RDI,RBX
CALL 0x001010a0
MOV R14,RAX
TEST RAX,RAX
JZ 0x00101519
MOV R15,RAX
MOV RDI,RBP
MOV RSI,RBX
ADD R12D,0x1... | void func0(char *param_1,char *param_2,int *param_3)
{
char *pcVar1;
int iVar2;
size_t __n;
iVar2 = 0;
*param_3 = 0;
while( true ) {
pcVar1 = strchr(param_1,0x22);
if (pcVar1 == (char *)0x0) break;
pcVar1 = pcVar1 + 1;
param_1 = strchr(pcVar1,0x22);
if (param_1 == (char *)0x0) break;... |
6,148 | func0 |
#include <assert.h>
| int func0(int arr[], int n) {
int cnt = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (arr[i] != arr[j]) {
cnt++;
}
}
}
return cnt;
}
| int main() {
int arr1[] = {1, 2, 1};
int arr2[] = {1, 1, 1, 1};
int arr3[] = {1, 2, 3, 4, 5};
assert(func0(arr1, 3) == 2);
assert(func0(arr2, 4) == 0);
assert(func0(arr3, 5) == 10);
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
mov %rdi,-0x18(%rbp)
mov %esi,-0x1c(%rbp)
movl $0x0,-0xc(%rbp)
movl $0x0,-0x8(%rbp)
jmp 11d7 <func0+0x6e>
mov -0x8(%rbp),%eax
add $0x1,%eax
mov %eax,-0x4(%rbp)
jmp 11cb <func0+0x62>
mov -0x8(%rbp),%eax
cltq
lea 0x0(,%rax,4),%rdx
mov -0x18(%rb... | func0:
endbr64
push rbp
mov rbp, rsp
mov [rbp+var_18], rdi
mov [rbp+var_1C], esi
mov [rbp+var_C], 0
mov [rbp+var_8], 0
jmp short loc_11D7
loc_1188:
mov eax, [rbp+var_8]
add eax, 1
mov [rbp+var_4], eax
jmp short loc_11CB
loc_1193:
mov eax, [rbp+var_8]
cdqe
lea rdx, ds:0... | long long func0(long long a1, int a2)
{
unsigned int v3; // [rsp+10h] [rbp-Ch]
int i; // [rsp+14h] [rbp-8h]
int j; // [rsp+18h] [rbp-4h]
v3 = 0;
for ( i = 0; i < a2; ++i )
{
for ( j = i + 1; j < a2; ++j )
{
if ( *(_DWORD *)(4LL * i + a1) != *(_DWORD *)(4LL * j + a1) )
++v3;
}
}... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
MOV qword ptr [RBP + -0x18],RDI
MOV dword ptr [RBP + -0x1c],ESI
MOV dword ptr [RBP + -0xc],0x0
MOV dword ptr [RBP + -0x8],0x0
JMP 0x001011d7
LAB_00101188:
MOV EAX,dword ptr [RBP + -0x8]
ADD EAX,0x1
MOV dword ptr [RBP + -0x4],EAX
JMP 0x001011cb
LAB_00101193:
MOV EAX,dword ptr [RBP + -... | int func0(long param_1,int param_2)
{
int4 local_14;
int4 local_10;
int4 local_c;
local_14 = 0;
for (local_10 = 0; local_c = local_10, local_10 < param_2; local_10 = local_10 + 1) {
while (local_c = local_c + 1, local_c < param_2) {
if (*(int *)(param_1 + (long)local_10 * 4) != *(int *)(param_1 ... |
6,149 | func0 |
#include <assert.h>
| int func0(int arr[], int n) {
int cnt = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (arr[i] != arr[j]) {
cnt++;
}
}
}
return cnt;
}
| int main() {
int arr1[] = {1, 2, 1};
int arr2[] = {1, 1, 1, 1};
int arr3[] = {1, 2, 3, 4, 5};
assert(func0(arr1, 3) == 2);
assert(func0(arr2, 4) == 0);
assert(func0(arr3, 5) == 10);
return 0;
}
| O1 | c | func0:
endbr64
test %esi,%esi
jle 11ab <func0+0x42>
lea -0x1(%rsi),%r9d
add $0x1,%r9
mov $0x1,%r8d
mov $0x0,%edx
jmp 119c <func0+0x33>
add $0x1,%edx
add $0x1,%rax
cmp %eax,%esi
jle 1198 <func0+0x2f>
cmp (%rdi,%rax,4),%ecx
jne 1186 <func0+0x1d>
jmp 1189 <func0+0x20>
add $0x1,%... | func0:
endbr64
test esi, esi
jle short loc_11A6
mov r9d, esi
mov r8d, 1
mov edx, 0
jmp short loc_1197
loc_1181:
add edx, 1
loc_1184:
add rax, 1
cmp esi, eax
jle short loc_1193
loc_118C:
cmp ecx, [rdi+rax*4]
jnz short loc_1181
jmp short loc_1184
loc_1193:
add r8, 1
... | long long func0(long long a1, int a2)
{
long long v2; // r8
unsigned int v3; // edx
long long v4; // rax
if ( a2 <= 0 )
{
return 0;
}
else
{
v2 = 1LL;
v3 = 0;
while ( v2 != a2 )
{
v4 = v2;
do
{
if ( *(_DWORD *)(a1 + 4 * v2 - 4) != *(_DWORD *)(a1 + 4 * v4) ... | func0:
ENDBR64
TEST ESI,ESI
JLE 0x001011a6
MOV R9D,ESI
MOV R8D,0x1
MOV EDX,0x0
JMP 0x00101197
LAB_00101181:
ADD EDX,0x1
LAB_00101184:
ADD RAX,0x1
CMP ESI,EAX
JLE 0x00101193
LAB_0010118c:
CMP ECX,dword ptr [RDI + RAX*0x4]
JNZ 0x00101181
JMP 0x00101184
LAB_00101193:
ADD R8,0x1
LAB_00101197:
CMP R8,R9
JZ 0x001011ab
MOV EC... | int func0(long param_1,uint param_2)
{
ulong uVar1;
int iVar2;
ulong uVar3;
if ((int)param_2 < 1) {
iVar2 = 0;
}
else {
iVar2 = 0;
for (uVar3 = 1; uVar3 != param_2; uVar3 = uVar3 + 1) {
uVar1 = uVar3;
do {
if (*(int *)(param_1 + -4 + uVar3 * 4) != *(int *)(param_1 + uVar1... |
6,150 | func0 |
#include <assert.h>
| int func0(int arr[], int n) {
int cnt = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (arr[i] != arr[j]) {
cnt++;
}
}
}
return cnt;
}
| int main() {
int arr1[] = {1, 2, 1};
int arr2[] = {1, 1, 1, 1};
int arr3[] = {1, 2, 3, 4, 5};
assert(func0(arr1, 3) == 2);
assert(func0(arr2, 4) == 0);
assert(func0(arr3, 5) == 10);
return 0;
}
| O2 | c | func0:
endbr64
test %esi,%esi
jle 136e <func0+0x4e>
lea -0x1(%rsi),%r9d
mov $0x1,%ecx
xor %r8d,%r8d
add $0x1,%r9
cmp %r9,%rcx
je 136a <func0+0x4a>
nopl (%rax)
mov -0x4(%rdi,%rcx,4),%edx
mov %rcx,%rax
nopw 0x0(%rax,%rax,1)
cmp (%rdi,%rax,4),%edx
je 1359 <func0+0x39>
add $0x1,%... | func0:
endbr64
test esi, esi
jle short loc_12DE
movsxd r9, esi
mov ecx, 1
xor r8d, r8d
cmp rcx, r9
jz short loc_12DA
nop dword ptr [rax+rax+00000000h]
loc_12B0:
mov edx, [rdi+rcx*4-4]
mov rax, rcx
nop word ptr [rax+rax+00000000h]
loc_12C0:
cmp edx, [rdi+rax*4]
jz short ... | long long func0(long long a1, int a2)
{
long long v2; // rcx
unsigned int i; // r8d
long long v4; // rax
if ( a2 <= 0 )
return 0LL;
v2 = 1LL;
for ( i = 0; v2 != a2; ++v2 )
{
v4 = v2;
do
{
if ( *(_DWORD *)(a1 + 4 * v2 - 4) != *(_DWORD *)(a1 + 4 * v4) )
++i;
++v4;
}... | func0:
ENDBR64
TEST ESI,ESI
JLE 0x001012de
MOVSXD R9,ESI
MOV ECX,0x1
XOR R8D,R8D
CMP RCX,R9
JZ 0x001012da
NOP dword ptr [RAX + RAX*0x1]
LAB_001012b0:
MOV EDX,dword ptr [RDI + RCX*0x4 + -0x4]
MOV RAX,RCX
NOP word ptr [RAX + RAX*0x1]
LAB_001012c0:
CMP EDX,dword ptr [RDI + RAX*0x4]
JZ 0x001012c9
ADD R8D,0x1
LAB_001012c9:
... | int func0(long param_1,int param_2)
{
long lVar1;
long lVar2;
int iVar3;
if (param_2 < 1) {
return 0;
}
lVar2 = 1;
iVar3 = 0;
if ((long)param_2 != 1) {
do {
lVar1 = lVar2;
do {
if (*(int *)(param_1 + -4 + lVar2 * 4) != *(int *)(param_1 + lVar1 * 4)) {
iVar3 = iV... |
6,151 | func0 |
#include <assert.h>
| int func0(int arr[], int n) {
int cnt = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (arr[i] != arr[j]) {
cnt++;
}
}
}
return cnt;
}
| int main() {
int arr1[] = {1, 2, 1};
int arr2[] = {1, 1, 1, 1};
int arr3[] = {1, 2, 3, 4, 5};
assert(func0(arr1, 3) == 2);
assert(func0(arr2, 4) == 0);
assert(func0(arr3, 5) == 10);
return 0;
}
| O3 | c | func0:
endbr64
test %esi,%esi
jle 143d <func0+0x12d>
cmp $0x1,%esi
je 143d <func0+0x12d>
push %rbp
lea 0x4(%rdi),%r10
xor %r8d,%r8d
mov $0x1,%ecx
push %rbx
lea -0x1(%rsi),%ebp
mov $0x1,%ebx
pcmpeqd %xmm3,%xmm3
mov %esi,%r9d
mov %ebp,%eax
mov -0x4(%r10),%r11d
sub %ecx,%r9d
cmp ... | func0:
endbr64
test esi, esi
jle loc_1258
cmp esi, 1
jz loc_1258
push rbp
mov r11, rdi
lea r9, [rdi+4]
xor r8d, r8d
push rbx
mov ecx, 1
lea ebp, [rsi-1]
mov ebx, 1
pxor xmm3, xmm3
nop word ptr [rax+rax+00h]
loc_1178:
mov edi, esi
mov eax, ebp
mov r10d, [r... | long long func0(long long a1, int a2)
{
const __m128i *v3; // r9
unsigned int v4; // r8d
int v5; // ecx
unsigned int v6; // r10d
unsigned int v7; // edi
__m128i v8; // xmm1
const __m128i *v9; // rax
__m128i v10; // xmm2
__m128i v11; // xmm0
__m128i v12; // xmm1
int v13; // eax
long long v14; //... | func0:
ENDBR64
TEST ESI,ESI
JLE 0x00101258
CMP ESI,0x1
JZ 0x00101258
PUSH RBP
MOV R11,RDI
LEA R9,[RDI + 0x4]
XOR R8D,R8D
PUSH RBX
MOV ECX,0x1
LEA EBP,[RSI + -0x1]
MOV EBX,0x1
PXOR XMM3,XMM3
NOP word ptr [RAX + RAX*0x1]
LAB_00101178:
MOV EDI,ESI
MOV EAX,EBP
MOV R10D,dword ptr [R9 + -0x4]
SUB EDI,ECX
CMP ESI,ECX
CMOVLE E... | int func0(long param_1,int param_2)
{
long lVar1;
int iVar2;
uint uVar3;
int iVar4;
int *piVar5;
int *piVar6;
int *piVar7;
int *piVar8;
int iVar9;
int iVar10;
int *piVar11;
int iVar12;
int iVar13;
int iVar14;
int iVar15;
if ((param_2 < 1) || (param_2 == 1)) {
return 0;
}
piVa... |
6,152 | func0 |
#include <stdio.h>
#include <string.h>
#include <assert.h>
| char* func0(char* word, char* result) {
int length = strlen(word);
for (int i = 0; i < length; i++) {
result[i] = word[i];
}
result[length] = '\0'; // Null-terminate the resulting array
return result;
}
| int main() {
char result[100];
assert(strcmp(func0("python", result), "python") == 0);
assert(strcmp(func0("Name", result), "Name") == 0);
assert(strcmp(func0("program", result), "program") == 0);
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x20,%rsp
mov %rdi,-0x18(%rbp)
mov %rsi,-0x20(%rbp)
mov -0x18(%rbp),%rax
mov %rax,%rdi
callq 1080 <strlen@plt>
mov %eax,-0x4(%rbp)
movl $0x0,-0x8(%rbp)
jmp 11f8 <func0+0x4f>
mov -0x8(%rbp),%eax
movslq %eax,%rdx
mov -0x18(%rbp),%rax
add %r... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 20h
mov [rbp+s], rdi
mov [rbp+var_20], rsi
mov rax, [rbp+s]
mov rdi, rax; s
call _strlen
mov [rbp+var_4], eax
mov [rbp+var_8], 0
jmp short loc_11F8
loc_11D5:
mov eax, [rbp+var_8]
movsxd rdx, eax
mov rax, [rbp+s]
add rax... | long long func0(const char *a1, long long a2)
{
int i; // [rsp+18h] [rbp-8h]
int v4; // [rsp+1Ch] [rbp-4h]
v4 = strlen(a1);
for ( i = 0; i < v4; ++i )
*(_BYTE *)(i + a2) = a1[i];
*(_BYTE *)(v4 + a2) = 0;
return a2;
} | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x20
MOV qword ptr [RBP + -0x18],RDI
MOV qword ptr [RBP + -0x20],RSI
MOV RAX,qword ptr [RBP + -0x18]
MOV RDI,RAX
CALL 0x00101080
MOV dword ptr [RBP + -0x4],EAX
MOV dword ptr [RBP + -0x8],0x0
JMP 0x001011f8
LAB_001011d5:
MOV EAX,dword ptr [RBP + -0x8]
MOVSXD RDX,EAX
MOV RAX,qw... | long func0(char *param_1,long param_2)
{
size_t sVar1;
int local_10;
sVar1 = strlen(param_1);
for (local_10 = 0; local_10 < (int)sVar1; local_10 = local_10 + 1) {
*(char *)(param_2 + local_10) = param_1[local_10];
}
*(int *)(param_2 + (int)sVar1) = 0;
return param_2;
} |
6,153 | func0 |
#include <stdio.h>
#include <string.h>
#include <assert.h>
| char* func0(char* word, char* result) {
int length = strlen(word);
for (int i = 0; i < length; i++) {
result[i] = word[i];
}
result[length] = '\0'; // Null-terminate the resulting array
return result;
}
| int main() {
char result[100];
assert(strcmp(func0("python", result), "python") == 0);
assert(strcmp(func0("Name", result), "Name") == 0);
assert(strcmp(func0("program", result), "program") == 0);
return 0;
}
| O1 | c | func0:
endbr64
mov %rdi,%r8
mov $0xffffffffffffffff,%rcx
mov $0x0,%eax
repnz scas %es:(%rdi),%al
not %rcx
sub $0x1,%rcx
test %ecx,%ecx
jle 11a5 <func0+0x3c>
lea -0x1(%rcx),%edi
mov $0x0,%eax
movzbl (%r8,%rax,1),%edx
mov %dl,(%rsi,%rax,1)
mov %rax,%rdx
add $0x1,%rax
cmp %rdi,%rdx
jn... | func0:
endbr64
push rbp
push rbx
sub rsp, 8
mov rbp, rdi
mov rbx, rsi
call _strlen
test eax, eax
jle short loc_11DE
lea esi, [rax-1]
mov edx, 0
loc_11CA:
movzx ecx, byte ptr [rbp+rdx+0]
mov [rbx+rdx], cl
mov rcx, rdx
add rdx, 1
cmp rcx, rsi
jnz short loc_11CA
lo... | long long func0(long long a1, long long a2)
{
int v2; // eax
long long v3; // rdx
long long v4; // rcx
v2 = strlen();
if ( v2 > 0 )
{
v3 = 0LL;
do
{
*(_BYTE *)(a2 + v3) = *(_BYTE *)(a1 + v3);
v4 = v3++;
}
while ( v4 != v2 - 1 );
}
*(_BYTE *)(a2 + v2) = 0;
return a2;
} | func0:
ENDBR64
PUSH RBP
PUSH RBX
SUB RSP,0x8
MOV RBP,RDI
MOV RBX,RSI
CALL 0x00101080
TEST EAX,EAX
JLE 0x001011de
LEA ESI,[RAX + -0x1]
MOV EDX,0x0
LAB_001011ca:
MOVZX ECX,byte ptr [RBP + RDX*0x1]
MOV byte ptr [RBX + RDX*0x1],CL
MOV RCX,RDX
ADD RDX,0x1
CMP RCX,RSI
JNZ 0x001011ca
LAB_001011de:
CDQE
MOV byte ptr [RBX + RAX... | long func0(char *param_1,long param_2)
{
int iVar1;
size_t sVar2;
ulong uVar3;
bool bVar4;
sVar2 = strlen(param_1);
iVar1 = (int)sVar2;
if (0 < iVar1) {
uVar3 = 0;
do {
*(char *)(param_2 + uVar3) = param_1[uVar3];
bVar4 = uVar3 != iVar1 - 1;
uVar3 = uVar3 + 1;
} while (bV... |
6,154 | func0 |
#include <stdio.h>
#include <string.h>
#include <assert.h>
| char* func0(char* word, char* result) {
int length = strlen(word);
for (int i = 0; i < length; i++) {
result[i] = word[i];
}
result[length] = '\0'; // Null-terminate the resulting array
return result;
}
| int main() {
char result[100];
assert(strcmp(func0("python", result), "python") == 0);
assert(strcmp(func0("Name", result), "Name") == 0);
assert(strcmp(func0("program", result), "program") == 0);
return 0;
}
| O2 | c | func0:
endbr64
push %r12
mov %rsi,%r12
push %rbx
mov %rdi,%rbx
sub $0x8,%rsp
callq 1070 <strlen@plt>
test %eax,%eax
jle 12e4 <func0+0x34>
lea -0x1(%rax),%esi
xor %edx,%edx
movzbl (%rbx,%rdx,1),%ecx
mov %cl,(%r12,%rdx,1)
mov %rdx,%rcx
add $0x1,%rdx
cmp %rcx,%rsi
jne 12d0 <func0+0x... | func0:
endbr64
push r12
mov r12, rsi
push rbx
mov rbx, rdi
sub rsp, 8
call _strlen
test eax, eax
jle short loc_12E4
lea esi, [rax-1]
xor edx, edx
nop
loc_12D0:
movzx ecx, byte ptr [rbx+rdx]
mov [r12+rdx], cl
mov rcx, rdx
add rdx, 1
cmp rcx, rsi
jnz short loc_12D... | long long func0(long long a1, long long a2)
{
int v2; // eax
long long v3; // rdx
long long v4; // rcx
v2 = strlen();
if ( v2 > 0 )
{
v3 = 0LL;
do
{
*(_BYTE *)(a2 + v3) = *(_BYTE *)(a1 + v3);
v4 = v3++;
}
while ( v4 != v2 - 1 );
}
*(_BYTE *)(a2 + v2) = 0;
return a2;
} | func0:
ENDBR64
PUSH R12
MOV R12,RSI
PUSH RBX
MOV RBX,RDI
SUB RSP,0x8
CALL 0x00101080
TEST EAX,EAX
JLE 0x001012e4
LEA ESI,[RAX + -0x1]
XOR EDX,EDX
NOP
LAB_001012d0:
MOVZX ECX,byte ptr [RBX + RDX*0x1]
MOV byte ptr [R12 + RDX*0x1],CL
MOV RCX,RDX
ADD RDX,0x1
CMP RCX,RSI
JNZ 0x001012d0
LAB_001012e4:
CDQE
MOV byte ptr [R12 +... | long func0(char *param_1,long param_2)
{
int iVar1;
size_t sVar2;
ulong uVar3;
bool bVar4;
sVar2 = strlen(param_1);
iVar1 = (int)sVar2;
if (0 < iVar1) {
uVar3 = 0;
do {
*(char *)(param_2 + uVar3) = param_1[uVar3];
bVar4 = uVar3 != iVar1 - 1;
uVar3 = uVar3 + 1;
} while (bV... |
6,155 | func0 |
#include <stdio.h>
#include <string.h>
#include <assert.h>
| char* func0(char* word, char* result) {
int length = strlen(word);
for (int i = 0; i < length; i++) {
result[i] = word[i];
}
result[length] = '\0'; // Null-terminate the resulting array
return result;
}
| int main() {
char result[100];
assert(strcmp(func0("python", result), "python") == 0);
assert(strcmp(func0("Name", result), "Name") == 0);
assert(strcmp(func0("program", result), "program") == 0);
return 0;
}
| O3 | c | func0:
endbr64
push %r12
mov %rsi,%r12
push %rbx
mov %rdi,%rbx
sub $0x8,%rsp
callq 1070 <strlen@plt>
test %eax,%eax
jle 1443 <func0+0x193>
lea 0xf(%rbx),%rcx
lea -0x1(%rax),%edx
sub %r12,%rcx
cmp $0x1e,%rcx
jbe 1458 <func0+0x1a8>
cmp $0xe,%edx
jbe 1458 <func0+0x1a8>
mov %eax,%... | func0:
endbr64
push rbp
mov rbp, rdi
push rbx
mov rbx, rsi
sub rsp, 8
call _strlen
mov rdx, rax
test eax, eax
jle short loc_1304
lea esi, [rax-1]
mov edi, eax
cmp esi, 6
jbe short loc_12E6
lea rcx, [rbp+1]
mov rax, rbx
sub rax, rcx
cmp rax, 0Eh
ja sho... | long long func0(const char *a1, long long a2)
{
int v4; // eax
int v5; // edx
long long v6; // rsi
int v7; // edi
long long v8; // rax
long long v9; // rcx
long long result; // rax
long long v11; // rax
long long v12; // rcx
signed int v13; // eax
int v14; // ecx
int v15; // eax
v4 = strlen(... | func0:
ENDBR64
PUSH RBP
MOV RBP,RDI
PUSH RBX
MOV RBX,RSI
SUB RSP,0x8
CALL 0x00101080
MOV RDX,RAX
TEST EAX,EAX
JLE 0x00101304
LEA ESI,[RAX + -0x1]
MOV EDI,EAX
CMP ESI,0x6
JBE 0x001012e6
LEA RCX,[RBP + 0x1]
MOV RAX,RBX
SUB RAX,RCX
CMP RAX,0xe
JA 0x00101318
LAB_001012e6:
XOR EAX,EAX
NOP dword ptr [RAX + RAX*0x1]
LAB_00101... | long func0(char *param_1,long param_2)
{
int8 uVar1;
uint uVar2;
int iVar3;
size_t sVar4;
ulong uVar5;
long lVar6;
uint uVar7;
int iVar8;
uint uVar9;
bool bVar10;
sVar4 = strlen(param_1);
uVar2 = (uint)sVar4;
if ((int)uVar2 < 1) goto LAB_00101304;
uVar9 = uVar2 - 1;
if ((uVar9 < 7) || ... |
6,156 | func0 |
#include <assert.h>
| int func0(int n) {
if (n == 0)
return 0;
else
return n % 10 + func0(n / 10);
}
| int main() {
assert(func0(345) == 12);
assert(func0(12) == 3);
assert(func0(97) == 16);
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
push %rbx
sub $0x18,%rsp
mov %edi,-0x14(%rbp)
cmpl $0x0,-0x14(%rbp)
jne 1166 <func0+0x1d>
mov $0x0,%eax
jmp 11b6 <func0+0x6d>
mov -0x14(%rbp),%edx
movslq %edx,%rax
imul $0x66666667,%rax,%rax
shr $0x20,%rax
mov %eax,%ecx
sar $0x2,%ecx
mov %e... | func0:
endbr64
push rbp
mov rbp, rsp
push rbx
sub rsp, 18h
mov [rbp+var_14], edi
cmp [rbp+var_14], 0
jnz short loc_1166
mov eax, 0
jmp short loc_11B6
loc_1166:
mov edx, [rbp+var_14]
movsxd rax, edx
imul rax, 66666667h
shr rax, 20h
mov ecx, eax
sar ecx, 2
mov eax... | long long func0(int a1)
{
if ( a1 )
return a1 % 10 + (unsigned int)func0((unsigned int)(a1 / 10));
else
return 0LL;
} | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
PUSH RBX
SUB RSP,0x18
MOV dword ptr [RBP + -0x14],EDI
CMP dword ptr [RBP + -0x14],0x0
JNZ 0x00101166
MOV EAX,0x0
JMP 0x001011b6
LAB_00101166:
MOV EDX,dword ptr [RBP + -0x14]
MOVSXD RAX,EDX
IMUL RAX,RAX,0x66666667
SHR RAX,0x20
MOV ECX,EAX
SAR ECX,0x2
MOV EAX,EDX
SAR EAX,0x1f
MOV EBX,E... | int func0(int param_1)
{
int iVar1;
if (param_1 == 0) {
iVar1 = 0;
}
else {
iVar1 = func0(param_1 / 10);
iVar1 = iVar1 + param_1 % 10;
}
return iVar1;
} |
6,157 | func0 |
#include <assert.h>
| int func0(int n) {
if (n == 0)
return 0;
else
return n % 10 + func0(n / 10);
}
| int main() {
assert(func0(345) == 12);
assert(func0(12) == 3);
assert(func0(97) == 16);
return 0;
}
| O1 | c | func0:
endbr64
push %rbp
push %rbx
sub $0x8,%rsp
mov %edi,%ebx
test %edi,%edi
jne 1162 <func0+0x19>
mov %ebx,%eax
add $0x8,%rsp
pop %rbx
pop %rbp
retq
movslq %edi,%rbp
imul $0x66666667,%rbp,%rbp
sar $0x22,%rbp
mov %edi,%eax
sar $0x1f,%eax
sub %eax,%ebp
mov %ebp,%edi
callq 11... | func0:
endbr64
push rbp
push rbx
sub rsp, 8
mov ebx, edi
test edi, edi
jnz short loc_1162
loc_1159:
mov eax, ebx
add rsp, 8
pop rbx
pop rbp
retn
loc_1162:
movsxd rbp, edi
imul rbp, 66666667h
sar rbp, 22h
mov eax, edi
sar eax, 1Fh
sub ebp, eax
mov edi, ebp
cal... | long long func0(signed int a1)
{
unsigned int v1; // ebx
v1 = a1;
if ( a1 )
return (unsigned int)func0((unsigned int)(a1 / 10)) + a1 % 10;
return v1;
} | func0:
ENDBR64
PUSH RBP
PUSH RBX
SUB RSP,0x8
MOV EBX,EDI
TEST EDI,EDI
JNZ 0x00101162
LAB_00101159:
MOV EAX,EBX
ADD RSP,0x8
POP RBX
POP RBP
RET
LAB_00101162:
MOVSXD RBP,EDI
IMUL RBP,RBP,0x66666667
SAR RBP,0x22
MOV EAX,EDI
SAR EAX,0x1f
SUB EBP,EAX
MOV EDI,EBP
CALL 0x00101149
MOV EDX,EAX
LEA EAX,[RBP + RBP*0x4]
ADD EAX,EA... | int func0(int param_1)
{
int iVar1;
if (param_1 != 0) {
iVar1 = func0(param_1 / 10);
param_1 = param_1 % 10 + iVar1;
}
return param_1;
} |
6,158 | func0 |
#include <assert.h>
| int func0(int n) {
if (n == 0)
return 0;
else
return n % 10 + func0(n / 10);
}
| int main() {
assert(func0(345) == 12);
assert(func0(12) == 3);
assert(func0(97) == 16);
return 0;
}
| O2 | c | func0:
endbr64
xor %r8d,%r8d
test %edi,%edi
je 1179 <func0+0x39>
nopl 0x0(%rax,%rax,1)
movslq %edi,%rax
mov %edi,%edx
imul $0x66666667,%rax,%rax
sar $0x1f,%edx
sar $0x22,%rax
sub %edx,%eax
mov %eax,%edx
lea (%rax,%rax,4),%eax
add %eax,%eax
sub %eax,%edi
mov %edi,%eax
mov %edx,... | func0:
endbr64
xor r8d, r8d
test edi, edi
jz short loc_1179
nop dword ptr [rax+rax+00h]
loc_1150:
movsxd rax, edi
mov edx, edi
imul rax, 66666667h
sar edx, 1Fh
sar rax, 22h
sub eax, edx
lea ecx, [rax+rax*4]
mov edx, eax
mov eax, edi
add ecx, ecx
mov edi, edx
sub ... | long long func0(int a1)
{
unsigned int i; // r8d
int v2; // eax
int v3; // ecx
for ( i = 0; a1; i += v2 - v3 )
{
v2 = a1;
v3 = 10 * (a1 / 10);
a1 /= 10;
}
return i;
} | func0:
ENDBR64
XOR R8D,R8D
TEST EDI,EDI
JZ 0x00101179
NOP dword ptr [RAX + RAX*0x1]
LAB_00101150:
MOVSXD RAX,EDI
MOV EDX,EDI
IMUL RAX,RAX,0x66666667
SAR EDX,0x1f
SAR RAX,0x22
SUB EAX,EDX
LEA ECX,[RAX + RAX*0x4]
MOV EDX,EAX
MOV EAX,EDI
ADD ECX,ECX
MOV EDI,EDX
SUB EAX,ECX
ADD R8D,EAX
TEST EDX,EDX
JNZ 0x00101150
LAB_00101... | int func0(int param_1)
{
int iVar1;
int iVar2;
iVar2 = 0;
if (param_1 != 0) {
do {
iVar1 = param_1 / 10;
iVar2 = iVar2 + param_1 % 10;
param_1 = iVar1;
} while (iVar1 != 0);
}
return iVar2;
} |
6,159 | func0 |
#include <assert.h>
| int func0(int n) {
if (n == 0)
return 0;
else
return n % 10 + func0(n / 10);
}
| int main() {
assert(func0(345) == 12);
assert(func0(12) == 3);
assert(func0(97) == 16);
return 0;
}
| O3 | c | func0:
endbr64
xor %r8d,%r8d
test %edi,%edi
je 1179 <func0+0x39>
nopl 0x0(%rax,%rax,1)
movslq %edi,%rax
mov %edi,%edx
imul $0x66666667,%rax,%rax
sar $0x1f,%edx
sar $0x22,%rax
sub %edx,%eax
mov %eax,%edx
lea (%rax,%rax,4),%eax
add %eax,%eax
sub %eax,%edi
mov %edi,%eax
mov %edx,... | func0:
endbr64
xor esi, esi
test edi, edi
jz short loc_1178
nop word ptr [rax+rax+00h]
loc_1150:
movsxd rax, edi
mov edx, edi
imul rax, 66666667h
sar edx, 1Fh
sar rax, 22h
sub eax, edx
lea ecx, [rax+rax*4]
mov edx, eax
mov eax, edi
add ecx, ecx
mov edi, edx
sub ... | long long func0(int a1)
{
unsigned int i; // esi
int v2; // eax
int v3; // ecx
for ( i = 0; a1; i += v2 - v3 )
{
v2 = a1;
v3 = 10 * (a1 / 10);
a1 /= 10;
}
return i;
} | func0:
ENDBR64
XOR ESI,ESI
TEST EDI,EDI
JZ 0x00101178
NOP word ptr [RAX + RAX*0x1]
LAB_00101150:
MOVSXD RAX,EDI
MOV EDX,EDI
IMUL RAX,RAX,0x66666667
SAR EDX,0x1f
SAR RAX,0x22
SUB EAX,EDX
LEA ECX,[RAX + RAX*0x4]
MOV EDX,EAX
MOV EAX,EDI
ADD ECX,ECX
MOV EDI,EDX
SUB EAX,ECX
ADD ESI,EAX
TEST EDX,EDX
JNZ 0x00101150
LAB_001011... | int func0(int param_1)
{
int iVar1;
int iVar2;
iVar2 = 0;
if (param_1 != 0) {
do {
iVar1 = param_1 / 10;
iVar2 = iVar2 + param_1 % 10;
param_1 = iVar1;
} while (iVar1 != 0);
}
return iVar2;
} |
6,160 | func0 |
#include <stdbool.h>
#include <assert.h>
| bool func0(int list1[], int size) {
for (int i = 0; i < size - 1; i++) {
if (list1[i] > list1[i + 1]) {
return false;
}
}
return true;
}
| int main() {
int list1[] = {1,2,4,6,8,10,12,14,16,17};
int list2[] = {1, 2, 4, 6, 8, 10, 12, 14, 20, 17};
int list3[] = {1, 2, 4, 6, 8, 10, 15, 14, 20};
assert(func0(list1, 10) == true);
assert(func0(list2, 10) == false);
assert(func0(list3, 9) == false);
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
mov %rdi,-0x18(%rbp)
mov %esi,-0x1c(%rbp)
movl $0x0,-0x4(%rbp)
jmp 11c0 <func0+0x57>
mov -0x4(%rbp),%eax
cltq
lea 0x0(,%rax,4),%rdx
mov -0x18(%rbp),%rax
add %rdx,%rax
mov (%rax),%edx
mov -0x4(%rbp),%eax
cltq
add $0x1,%rax
lea 0x0(,%rax,4),%r... | func0:
endbr64
push rbp
mov rbp, rsp
mov [rbp+var_18], rdi
mov [rbp+var_1C], esi
mov [rbp+var_4], 0
jmp short loc_11C0
loc_1181:
mov eax, [rbp+var_4]
cdqe
lea rdx, ds:0[rax*4]
mov rax, [rbp+var_18]
add rax, rdx
mov edx, [rax]
mov eax, [rbp+var_4]
cdqe
add rax, 1
lea ... | long long func0(long long a1, int a2)
{
int i; // [rsp+18h] [rbp-4h]
for ( i = 0; i < a2 - 1; ++i )
{
if ( *(_DWORD *)(4LL * i + a1) > *(_DWORD *)(4 * (i + 1LL) + a1) )
return 0LL;
}
return 1LL;
} | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
MOV qword ptr [RBP + -0x18],RDI
MOV dword ptr [RBP + -0x1c],ESI
MOV dword ptr [RBP + -0x4],0x0
JMP 0x001011c0
LAB_00101181:
MOV EAX,dword ptr [RBP + -0x4]
CDQE
LEA RDX,[RAX*0x4]
MOV RAX,qword ptr [RBP + -0x18]
ADD RAX,RDX
MOV EDX,dword ptr [RAX]
MOV EAX,dword ptr [RBP + -0x4]
CDQE
AD... | int8 func0(long param_1,int param_2)
{
int local_c;
local_c = 0;
while( true ) {
if (param_2 + -1 <= local_c) {
return 1;
}
if (*(int *)(param_1 + ((long)local_c + 1) * 4) < *(int *)(param_1 + (long)local_c * 4)) break;
local_c = local_c + 1;
}
return 0;
} |
6,161 | func0 |
#include <stdbool.h>
#include <assert.h>
| bool func0(int list1[], int size) {
for (int i = 0; i < size - 1; i++) {
if (list1[i] > list1[i + 1]) {
return false;
}
}
return true;
}
| int main() {
int list1[] = {1,2,4,6,8,10,12,14,16,17};
int list2[] = {1, 2, 4, 6, 8, 10, 12, 14, 20, 17};
int list3[] = {1, 2, 4, 6, 8, 10, 15, 14, 20};
assert(func0(list1, 10) == true);
assert(func0(list2, 10) == false);
assert(func0(list3, 9) == false);
return 0;
}
| O1 | c | func0:
endbr64
cmp $0x1,%esi
jle 1193 <func0+0x2a>
mov %rdi,%rax
lea -0x2(%rsi),%edx
lea 0x4(%rdi,%rdx,4),%rdx
mov 0x4(%rax),%ecx
cmp %ecx,(%rax)
jg 1199 <func0+0x30>
add $0x4,%rax
cmp %rdx,%rax
jne 117d <func0+0x14>
mov $0x1,%eax
retq
mov $0x1,%eax
retq
mov $0x0,%eax
retq
| func0:
endbr64
cmp esi, 1
jle short loc_1193
mov rax, rdi
lea edx, [rsi-2]
lea rdx, [rdi+rdx*4+4]
loc_117D:
mov ecx, [rax+4]
cmp [rax], ecx
jg short loc_1199
add rax, 4
cmp rax, rdx
jnz short loc_117D
mov eax, 1
retn
loc_1193:
mov eax, 1
retn
loc_1199:
mov eax, 0... | long long func0(_DWORD *a1, int a2)
{
_DWORD *v2; // rax
if ( a2 <= 1 )
return 1LL;
v2 = a1;
while ( *v2 <= v2[1] )
{
if ( ++v2 == &a1[a2 - 2 + 1] )
return 1LL;
}
return 0LL;
} | func0:
ENDBR64
CMP ESI,0x1
JLE 0x00101193
MOV RAX,RDI
LEA EDX,[RSI + -0x2]
LEA RDX,[RDI + RDX*0x4 + 0x4]
LAB_0010117d:
MOV ECX,dword ptr [RAX + 0x4]
CMP dword ptr [RAX],ECX
JG 0x00101199
ADD RAX,0x4
CMP RAX,RDX
JNZ 0x0010117d
MOV EAX,0x1
RET
LAB_00101193:
MOV EAX,0x1
RET
LAB_00101199:
MOV EAX,0x0
RET | int8 func0(int *param_1,int param_2)
{
int *piVar1;
if (param_2 < 2) {
return 1;
}
piVar1 = param_1 + (ulong)(param_2 - 2) + 1;
do {
if (param_1[1] < *param_1) {
return 0;
}
param_1 = param_1 + 1;
} while (param_1 != piVar1);
return 1;
} |
6,162 | func0 |
#include <stdbool.h>
#include <assert.h>
| bool func0(int list1[], int size) {
for (int i = 0; i < size - 1; i++) {
if (list1[i] > list1[i + 1]) {
return false;
}
}
return true;
}
| int main() {
int list1[] = {1,2,4,6,8,10,12,14,16,17};
int list2[] = {1, 2, 4, 6, 8, 10, 12, 14, 20, 17};
int list3[] = {1, 2, 4, 6, 8, 10, 15, 14, 20};
assert(func0(list1, 10) == true);
assert(func0(list2, 10) == false);
assert(func0(list3, 9) == false);
return 0;
}
| O2 | c | func0:
endbr64
cmp $0x1,%esi
jle 1340 <func0+0x30>
lea -0x2(%rsi),%eax
lea 0x4(%rdi,%rax,4),%rax
jmp 1331 <func0+0x21>
nopl 0x0(%rax,%rax,1)
add $0x4,%rdi
cmp %rax,%rdi
je 1340 <func0+0x30>
mov 0x4(%rdi),%edx
cmp %edx,(%rdi)
jle 1328 <func0+0x18>
xor %eax,%eax
retq
nopl 0x0(%rax... | func0:
endbr64
cmp esi, 1
jle short loc_1310
lea eax, [rsi-2]
lea rax, [rdi+rax*4+4]
jmp short loc_1301
loc_12F8:
add rdi, 4
cmp rdi, rax
jz short loc_1310
loc_1301:
mov edx, [rdi+4]
cmp [rdi], edx
jle short loc_12F8
xor eax, eax
retn
loc_1310:
mov eax, 1
retn | long long func0(_DWORD *a1, int a2)
{
long long v2; // rax
if ( a2 <= 1 )
return 1LL;
v2 = (long long)&a1[a2 - 2 + 1];
while ( *a1 <= a1[1] )
{
if ( ++a1 == (_DWORD *)v2 )
return 1LL;
}
return 0LL;
} | func0:
ENDBR64
CMP ESI,0x1
JLE 0x00101310
LEA EAX,[RSI + -0x2]
LEA RAX,[RDI + RAX*0x4 + 0x4]
JMP 0x00101301
LAB_001012f8:
ADD RDI,0x4
CMP RDI,RAX
JZ 0x00101310
LAB_00101301:
MOV EDX,dword ptr [RDI + 0x4]
CMP dword ptr [RDI],EDX
JLE 0x001012f8
XOR EAX,EAX
RET
LAB_00101310:
MOV EAX,0x1
RET | int8 func0(int *param_1,int param_2)
{
int *piVar1;
if (1 < param_2) {
piVar1 = param_1 + (ulong)(param_2 - 2) + 1;
do {
if (param_1[1] < *param_1) {
return 0;
}
param_1 = param_1 + 1;
} while (param_1 != piVar1);
}
return 1;
} |
6,163 | func0 |
#include <stdbool.h>
#include <assert.h>
| bool func0(int list1[], int size) {
for (int i = 0; i < size - 1; i++) {
if (list1[i] > list1[i + 1]) {
return false;
}
}
return true;
}
| int main() {
int list1[] = {1,2,4,6,8,10,12,14,16,17};
int list2[] = {1, 2, 4, 6, 8, 10, 12, 14, 20, 17};
int list3[] = {1, 2, 4, 6, 8, 10, 15, 14, 20};
assert(func0(list1, 10) == true);
assert(func0(list2, 10) == false);
assert(func0(list3, 9) == false);
return 0;
}
| O3 | c | func0:
endbr64
cmp $0x1,%esi
jle 1318 <func0+0x38>
lea -0x2(%rsi),%ecx
mov (%rdi),%edx
lea 0x4(%rdi),%rax
lea 0x8(%rdi,%rcx,4),%rsi
jmp 1309 <func0+0x29>
nopl 0x0(%rax)
add $0x4,%rax
cmp %rsi,%rax
je 1318 <func0+0x38>
mov %edx,%ecx
mov (%rax),%edx
cmp %ecx,%edx
jge 1300 <fun... | func0:
endbr64
cmp esi, 1
jle short loc_1178
lea ecx, [rsi-2]
mov edx, [rdi]
lea rax, [rdi+4]
lea rsi, [rdi+rcx*4+8]
jmp short loc_1169
loc_1160:
add rax, 4
cmp rax, rsi
jz short loc_1178
loc_1169:
mov ecx, edx
mov edx, [rax]
cmp edx, ecx
jge short loc_1160
xor ... | long long func0(int *a1, int a2)
{
int v2; // edx
int *v3; // rax
long long v4; // rsi
int v5; // ecx
if ( a2 <= 1 )
return 1LL;
v2 = *a1;
v3 = a1 + 1;
v4 = (long long)&a1[a2 - 2 + 2];
while ( 1 )
{
v5 = v2;
v2 = *v3;
if ( *v3 < v5 )
break;
if ( ++v3 == (int *)v4 )
... | func0:
ENDBR64
CMP ESI,0x1
JLE 0x00101178
LEA ECX,[RSI + -0x2]
MOV EDX,dword ptr [RDI]
LEA RAX,[RDI + 0x4]
LEA RSI,[RDI + RCX*0x4 + 0x8]
JMP 0x00101169
LAB_00101160:
ADD RAX,0x4
CMP RAX,RSI
JZ 0x00101178
LAB_00101169:
MOV ECX,EDX
MOV EDX,dword ptr [RAX]
CMP EDX,ECX
JGE 0x00101160
XOR EAX,EAX
RET
LAB_00101178:
MOV EAX,0... | int8 func0(int *param_1,int param_2)
{
int iVar1;
int *piVar2;
int iVar3;
if (1 < param_2) {
piVar2 = param_1 + 1;
iVar3 = *param_1;
do {
iVar1 = *piVar2;
if (iVar1 < iVar3) {
return 0;
}
piVar2 = piVar2 + 1;
iVar3 = iVar1;
} while (piVar2 != param_1 + (... |
6,164 | func0 |
#include <assert.h>
#include <stdlib.h>
// Define a function to create an array of empty dictionaries
struct EmptyDict {
// We can use an empty struct to represent an empty dictionary
};
| struct EmptyDict* func0(int length) {
struct EmptyDict* array = malloc(sizeof(struct EmptyDict) * length);
return array;
}
| int main() {
// Test the function with different lengths
assert(func0(5) != NULL);
assert(func0(6) != NULL);
assert(func0(7) != NULL);
// Free the allocated memory after using
free(func0(5));
free(func0(6));
free(func0(7));
return 0;
}
| O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x20,%rsp
mov %edi,-0x14(%rbp)
mov $0x0,%edi
callq 1090 <malloc@plt>
mov %rax,-0x8(%rbp)
mov -0x8(%rbp),%rax
leaveq
retq
| func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 20h
mov [rbp+var_14], edi
mov edi, 0; size
call _malloc
mov [rbp+var_8], rax
mov rax, [rbp+var_8]
leave
retn | void *func0()
{
return malloc(0LL);
} | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x20
MOV dword ptr [RBP + -0x14],EDI
MOV EDI,0x0
CALL 0x00101090
MOV qword ptr [RBP + -0x8],RAX
MOV RAX,qword ptr [RBP + -0x8]
LEAVE
RET | void * func0(void)
{
void *pvVar1;
pvVar1 = malloc(0);
return pvVar1;
} |
6,165 | func0 |
#include <assert.h>
#include <stdlib.h>
// Define a function to create an array of empty dictionaries
struct EmptyDict {
// We can use an empty struct to represent an empty dictionary
};
| struct EmptyDict* func0(int length) {
struct EmptyDict* array = malloc(sizeof(struct EmptyDict) * length);
return array;
}
| int main() {
// Test the function with different lengths
assert(func0(5) != NULL);
assert(func0(6) != NULL);
assert(func0(7) != NULL);
// Free the allocated memory after using
free(func0(5));
free(func0(6));
free(func0(7));
return 0;
}
| O1 | c | func0:
endbr64
sub $0x8,%rsp
mov $0x0,%edi
callq 1070 <malloc@plt>
add $0x8,%rsp
retq
| func0:
endbr64
sub rsp, 8
mov edi, 0
call _malloc
add rsp, 8
retn | long long func0()
{
return malloc(0LL);
} | func0:
ENDBR64
SUB RSP,0x8
MOV EDI,0x0
CALL 0x00101070
ADD RSP,0x8
RET | void func0(void)
{
malloc(0);
return;
} |
6,166 | func0 |
#include <assert.h>
#include <stdlib.h>
// Define a function to create an array of empty dictionaries
struct EmptyDict {
// We can use an empty struct to represent an empty dictionary
};
| struct EmptyDict* func0(int length) {
struct EmptyDict* array = malloc(sizeof(struct EmptyDict) * length);
return array;
}
| int main() {
// Test the function with different lengths
assert(func0(5) != NULL);
assert(func0(6) != NULL);
assert(func0(7) != NULL);
// Free the allocated memory after using
free(func0(5));
free(func0(6));
free(func0(7));
return 0;
}
| O2 | c | func0:
endbr64
xor %edi,%edi
jmpq 1070 <malloc@plt>
nopl 0x0(%rax,%rax,1)
| func0:
endbr64
xor edi, edi
jmp _malloc | long long func0()
{
return malloc(0LL);
} | func0:
ENDBR64
XOR EDI,EDI
JMP 0x00101070 | void func0(void)
{
malloc(0);
return;
} |
6,167 | func0 |
#include <assert.h>
#include <stdlib.h>
// Define a function to create an array of empty dictionaries
struct EmptyDict {
// We can use an empty struct to represent an empty dictionary
};
| struct EmptyDict* func0(int length) {
struct EmptyDict* array = malloc(sizeof(struct EmptyDict) * length);
return array;
}
| int main() {
// Test the function with different lengths
assert(func0(5) != NULL);
assert(func0(6) != NULL);
assert(func0(7) != NULL);
// Free the allocated memory after using
free(func0(5));
free(func0(6));
free(func0(7));
return 0;
}
| O3 | c | func0:
endbr64
xor %edi,%edi
jmpq 1070 <malloc@plt>
nopl 0x0(%rax,%rax,1)
| func0:
endbr64
xor edi, edi; size
jmp _malloc | void *func0()
{
return malloc(0LL);
} | func0:
ENDBR64
XOR EDI,EDI
JMP 0x00101070 | void func0(void)
{
malloc(0);
return;
} |
6,168 | func0 |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
// Function to compare two strings for qsort
int cmpfunc(const void * a, const void * b) {
const char **sa = (const char **)a;
const char **sb = (const char **)b;
return strcmp(*sa, *sb);
}
// Function to sort sub... | int func0(char ***a, char ***b, int num_sublists, int *sizes_a, int *sizes_b) {
for(int i=0; i<num_sublists; i++) {
if(sizes_a[i] != sizes_b[i]) return 0;
for(int j=0; j<sizes_a[i]; j++) {
if(strcmp(a[i][j], b[i][j]) !=0 ) return 0;
}
}
return 1;
}
| int main() {
// First test case
char *test1[][3] = { {"green", "orange", NULL}, {"black", "white", NULL}, {"white", "black", "orange"} };
int sizes1[] = {2, 2, 3};
// Expected
char *expected1[][3] = { {"green", "orange", NULL}, {"black", "white", NULL}, {"black", "orange", "white"} };
//... | O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x40,%rsp
mov %rdi,-0x18(%rbp)
mov %rsi,-0x20(%rbp)
mov %edx,-0x24(%rbp)
mov %rcx,-0x30(%rbp)
mov %r8,-0x38(%rbp)
movl $0x0,-0x8(%rbp)
jmpq 1357 <func0+0xf9>
mov -0x8(%rbp),%eax
cltq
lea 0x0(,%rax,4),%rdx
mov -0x30(%rbp),%rax
add %rdx,%r... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 40h
mov [rbp+var_18], rdi
mov [rbp+var_20], rsi
mov [rbp+var_24], edx
mov [rbp+var_30], rcx
mov [rbp+var_38], r8
mov [rbp+var_8], 0
jmp loc_135A
loc_128C:
mov eax, [rbp+var_8]
cdqe
lea rdx, ds:0[rax*4]
mov rax, [rbp+var_30]... | long long func0(long long a1, long long a2, int a3, long long a4, long long a5)
{
int i; // [rsp+38h] [rbp-8h]
int j; // [rsp+3Ch] [rbp-4h]
for ( i = 0; i < a3; ++i )
{
if ( *(_DWORD *)(4LL * i + a4) != *(_DWORD *)(4LL * i + a5) )
return 0LL;
for ( j = 0; j < *(_DWORD *)(4LL * i + a4); ++j )
... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x40
MOV qword ptr [RBP + -0x18],RDI
MOV qword ptr [RBP + -0x20],RSI
MOV dword ptr [RBP + -0x24],EDX
MOV qword ptr [RBP + -0x30],RCX
MOV qword ptr [RBP + -0x38],R8
MOV dword ptr [RBP + -0x8],0x0
JMP 0x0010135a
LAB_0010128c:
MOV EAX,dword ptr [RBP + -0x8]
CDQE
LEA RDX,[RAX*0x4... | int8 func0(long param_1,long param_2,int param_3,long param_4,long param_5)
{
int iVar1;
int local_10;
int local_c;
local_10 = 0;
while( true ) {
if (param_3 <= local_10) {
return 1;
}
if (*(int *)(param_4 + (long)local_10 * 4) != *(int *)(param_5 + (long)local_10 * 4)) break;
for (l... |
6,169 | func0 |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
// Function to compare two strings for qsort
int cmpfunc(const void * a, const void * b) {
const char **sa = (const char **)a;
const char **sb = (const char **)b;
return strcmp(*sa, *sb);
}
// Function to sort sub... | int func0(char ***a, char ***b, int num_sublists, int *sizes_a, int *sizes_b) {
for(int i=0; i<num_sublists; i++) {
if(sizes_a[i] != sizes_b[i]) return 0;
for(int j=0; j<sizes_a[i]; j++) {
if(strcmp(a[i][j], b[i][j]) !=0 ) return 0;
}
}
return 1;
}
| int main() {
// First test case
char *test1[][3] = { {"green", "orange", NULL}, {"black", "white", NULL}, {"white", "black", "orange"} };
int sizes1[] = {2, 2, 3};
// Expected
char *expected1[][3] = { {"green", "orange", NULL}, {"black", "white", NULL}, {"black", "orange", "white"} };
//... | O1 | c | func0:
endbr64
push %r15
push %r14
push %r13
push %r12
push %rbp
push %rbx
sub $0x28,%rsp
mov %rdi,0x8(%rsp)
mov %rsi,0x10(%rsp)
mov %rcx,(%rsp)
test %edx,%edx
jle 12ae <func0+0x99>
mov %r8,%r15
lea -0x1(%rdx),%eax
mov %rax,0x18(%rsp)
mov $0x0,%r14d
mov (%rsp),%rax
mov (%r... | func0:
endbr64
push r15
push r14
push r13
push r12
push rbp
push rbx
sub rsp, 28h
mov [rsp+58h+var_50], rdi
mov [rsp+58h+var_48], rsi
mov [rsp+58h+var_58], rcx
test edx, edx
jle short loc_12A3
mov r15, r8
mov eax, edx
mov [rsp+58h+var_40], rax
mov r14d, 0
loc_124... | long long func0(long long a1, long long a2, int a3, long long a4, long long a5)
{
long long v6; // r14
int v7; // eax
long long v8; // r12
long long v9; // rbp
long long v10; // r13
long long i; // rbx
long long v14; // [rsp+18h] [rbp-40h]
if ( a3 <= 0 )
return 1LL;
v14 = (unsigned int)a3;
v6 ... | func0:
ENDBR64
PUSH R15
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x28
MOV qword ptr [RSP + 0x8],RDI
MOV qword ptr [RSP + 0x10],RSI
MOV qword ptr [RSP],RCX
TEST EDX,EDX
JLE 0x001012a3
MOV R15,R8
MOV EAX,EDX
MOV qword ptr [RSP + 0x18],RAX
MOV R14D,0x0
LAB_00101244:
MOV RAX,qword ptr [RSP]
MOV EAX,dword ptr [R... | int8 func0(long param_1,long param_2,uint param_3,long param_4,long param_5)
{
int iVar1;
long lVar2;
long lVar3;
int iVar4;
ulong uVar5;
ulong uVar6;
bool bVar7;
if (0 < (int)param_3) {
uVar6 = 0;
do {
iVar1 = *(int *)(param_4 + uVar6 * 4);
if (iVar1 != *(int *)(param_5 + uVar6 ... |
6,170 | func0 |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
// Function to compare two strings for qsort
int cmpfunc(const void * a, const void * b) {
const char **sa = (const char **)a;
const char **sb = (const char **)b;
return strcmp(*sa, *sb);
}
// Function to sort sub... | int func0(char ***a, char ***b, int num_sublists, int *sizes_a, int *sizes_b) {
for(int i=0; i<num_sublists; i++) {
if(sizes_a[i] != sizes_b[i]) return 0;
for(int j=0; j<sizes_a[i]; j++) {
if(strcmp(a[i][j], b[i][j]) !=0 ) return 0;
}
}
return 1;
}
| int main() {
// First test case
char *test1[][3] = { {"green", "orange", NULL}, {"black", "white", NULL}, {"white", "black", "orange"} };
int sizes1[] = {2, 2, 3};
// Expected
char *expected1[][3] = { {"green", "orange", NULL}, {"black", "white", NULL}, {"black", "orange", "white"} };
//... | O2 | c | func0:
endbr64
push %r15
push %r14
push %r13
push %r12
push %rbp
push %rbx
sub $0x28,%rsp
mov %rdi,0x8(%rsp)
mov %rsi,0x10(%rsp)
mov %rcx,(%rsp)
test %edx,%edx
jle 17c0 <func0+0xa0>
lea -0x1(%rdx),%eax
mov %r8,%r13
xor %ebp,%ebp
mov %rax,0x18(%rsp)
mov (%rsp),%rax
mov (%ra... | func0:
endbr64
push r15
push r14
push r13
push r12
push rbp
push rbx
sub rsp, 28h
mov [rsp+58h+var_50], rdi
mov [rsp+58h+var_48], rsi
mov [rsp+58h+var_58], rcx
test edx, edx
jle short loc_17BB
movsxd rax, edx
mov r13, r8
xor ebp, ebp
mov [rsp+58h+var_40], rax
loc_17... | long long func0(long long a1, long long a2, int a3, long long a4, long long a5)
{
long long v6; // rbp
long long v7; // rbx
long long v8; // r14
long long v9; // r12
long long v10; // r15
long long v13; // [rsp+18h] [rbp-40h]
if ( a3 <= 0 )
return 1LL;
v6 = 0LL;
v13 = a3;
while ( 1 )
{
v... | func0:
ENDBR64
PUSH R15
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x28
MOV qword ptr [RSP + 0x8],RDI
MOV qword ptr [RSP + 0x10],RSI
MOV qword ptr [RSP],RCX
TEST EDX,EDX
JLE 0x001017bb
MOVSXD RAX,EDX
MOV R13,R8
XOR EBP,EBP
MOV qword ptr [RSP + 0x18],RAX
LAB_00101751:
MOV RAX,qword ptr [RSP]
MOVSXD RBX,dword p... | int8 func0(long param_1,long param_2,int param_3,long param_4,long param_5)
{
int iVar1;
long lVar2;
long lVar3;
int iVar4;
long lVar5;
long lVar6;
if (0 < param_3) {
lVar5 = 0;
do {
iVar1 = *(int *)(param_4 + lVar5 * 4);
if (iVar1 != *(int *)(param_5 + lVar5 * 4)) {
return... |
6,171 | func0 |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
// Function to compare two strings for qsort
int cmpfunc(const void * a, const void * b) {
const char **sa = (const char **)a;
const char **sb = (const char **)b;
return strcmp(*sa, *sb);
}
// Function to sort sub... | int func0(char ***a, char ***b, int num_sublists, int *sizes_a, int *sizes_b) {
for(int i=0; i<num_sublists; i++) {
if(sizes_a[i] != sizes_b[i]) return 0;
for(int j=0; j<sizes_a[i]; j++) {
if(strcmp(a[i][j], b[i][j]) !=0 ) return 0;
}
}
return 1;
}
| int main() {
// First test case
char *test1[][3] = { {"green", "orange", NULL}, {"black", "white", NULL}, {"white", "black", "orange"} };
int sizes1[] = {2, 2, 3};
// Expected
char *expected1[][3] = { {"green", "orange", NULL}, {"black", "white", NULL}, {"black", "orange", "white"} };
//... | O3 | c | func0:
endbr64
push %r15
push %r14
push %r13
push %r12
push %rbp
push %rbx
sub $0x28,%rsp
mov %rdi,0x8(%rsp)
mov %rsi,0x10(%rsp)
mov %rcx,(%rsp)
test %edx,%edx
jle 17e0 <func0+0xa0>
lea -0x1(%rdx),%eax
mov %r8,%r13
xor %ebp,%ebp
mov %rax,0x18(%rsp)
mov (%rsp),%rax
mov (%ra... | func0:
endbr64
push r15
push r14
push r13
push r12
push rbp
push rbx
sub rsp, 28h
mov [rsp+58h+var_50], rdi
mov [rsp+58h+var_48], rsi
test edx, edx
jle short loc_18DB
movsxd rdx, edx
mov r12, rcx
mov r13, r8
xor ebp, ebp
lea rax, ds:0[rdx*4]
mov [rsp+58h+var_40]... | long long func0(long long a1, long long a2, int a3, long long a4, long long a5)
{
long long v7; // rbp
long long v8; // rax
const char **v9; // r14
const char **v10; // rbx
const char **v11; // r15
long long v13; // [rsp+18h] [rbp-40h]
if ( a3 <= 0 )
return 1LL;
v7 = 0LL;
v13 = 4LL * a3;
while... | func0:
ENDBR64
PUSH R15
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x28
MOV qword ptr [RSP + 0x8],RDI
MOV qword ptr [RSP + 0x10],RSI
TEST EDX,EDX
JLE 0x001018db
MOVSXD RDX,EDX
MOV R12,RCX
MOV R13,R8
XOR EBP,EBP
LEA RAX,[RDX*0x4]
MOV qword ptr [RSP + 0x18],RAX
LAB_00101878:
MOVSXD RAX,dword ptr [R12 + RBP*0x1]... | int8 func0(long param_1,long param_2,int param_3,long param_4,long param_5)
{
int8 *puVar1;
int iVar2;
long lVar3;
int8 *puVar4;
int8 *puVar5;
if (0 < param_3) {
lVar3 = 0;
do {
iVar2 = *(int *)(param_4 + lVar3);
if (iVar2 != *(int *)(param_5 + lVar3)) {
return 0;
}
... |
6,172 | func0 |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
| char** func0(char* list1[], int n1, char* charlist[], int n_char) {
char** new_list = malloc(n1 * sizeof(char*));
for(int i = 0; i < n1; i++) {
char* line = strdup(list1[i]);
char* token;
char buffer[1024] = "";
token = strtok(line, " ");
while(token != NULL) {
... | int main() {
// Test case 1
char* list1_a[] = {"Red color", "Orange#", "Green", "Orange @", "White"};
char* charlist_a[] = {"#", "color", "@"};
char* expected_a[] = {"Red", "", "Green", "Orange", "White"};
char** result_a = func0(list1_a, 5, charlist_a, 3);
for(int i = 0; i < 5; i++) {
... | O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
push %rbx
sub $0x468,%rsp
mov %rdi,-0x458(%rbp)
mov %esi,-0x45c(%rbp)
mov %rdx,-0x468(%rbp)
mov %ecx,-0x460(%rbp)
mov %fs:0x28,%rax
mov %rax,-0x18(%rbp)
xor %eax,%eax
mov -0x45c(%rbp),%eax
cltq
shl $0x3,%rax
mov %rax,%rdi
callq 1110 <malloc... | func0:
endbr64
push rbp
mov rbp, rsp
push rbx
sub rsp, 468h
mov [rbp+var_458], rdi
mov [rbp+var_45C], esi
mov [rbp+var_468], rdx
mov [rbp+var_460], ecx
mov rax, fs:28h
mov [rbp+var_18], rax
xor eax, eax
mov eax, [rbp+var_45C]
cdqe
shl rax, 3
mov rdi, rax; size
call ... | _QWORD * func0(long long a1, int a2, long long a3, int a4)
{
int i; // [rsp+2Ch] [rbp-444h]
int v8; // [rsp+30h] [rbp-440h]
int j; // [rsp+34h] [rbp-43Ch]
const char *haystack; // [rsp+38h] [rbp-438h]
_QWORD *v11; // [rsp+40h] [rbp-430h]
char *s; // [rsp+48h] [rbp-428h]
char dest[1032]; // [rsp+50h] [rbp-... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
PUSH RBX
SUB RSP,0x468
MOV qword ptr [RBP + -0x458],RDI
MOV dword ptr [RBP + -0x45c],ESI
MOV qword ptr [RBP + -0x468],RDX
MOV dword ptr [RBP + -0x460],ECX
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RBP + -0x18],RAX
XOR EAX,EAX
MOV EAX,dword ptr [RBP + -0x45c]
CDQE
SHL RAX,0x3
MOV RDI... | void * func0(long param_1,int param_2,long param_3,int param_4)
{
bool bVar1;
void *pvVar2;
char *__s;
size_t sVar3;
char *pcVar4;
long lVar5;
long in_FS_OFFSET;
byte bVar6;
int local_44c;
int local_444;
char *local_440;
char local_428 [1032];
long local_20;
bVar6 = 0;
local_20 = *(lon... |
6,173 | func0 |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
| char** func0(char* list1[], int n1, char* charlist[], int n_char) {
char** new_list = malloc(n1 * sizeof(char*));
for(int i = 0; i < n1; i++) {
char* line = strdup(list1[i]);
char* token;
char buffer[1024] = "";
token = strtok(line, " ");
while(token != NULL) {
... | int main() {
// Test case 1
char* list1_a[] = {"Red color", "Orange#", "Green", "Orange @", "White"};
char* charlist_a[] = {"#", "color", "@"};
char* expected_a[] = {"Red", "", "Green", "Orange", "White"};
char** result_a = func0(list1_a, 5, charlist_a, 3);
for(int i = 0; i < 5; i++) {
... | O1 | c | func0:
endbr64
push %r15
push %r14
push %r13
push %r12
push %rbp
push %rbx
sub $0x448,%rsp
mov %rdi,0x28(%rsp)
mov %esi,%ebp
mov %rdx,%rbx
mov %ecx,%r14d
mov %fs:0x28,%rax
mov %rax,0x438(%rsp)
xor %eax,%eax
movslq %esi,%rdi
shl $0x3,%rdi
callq 1120 <malloc@plt>
mov %rax,0x18(%... | func0:
endbr64
push r15
push r14
push r13
push r12
push rbp
push rbx
sub rsp, 448h
mov [rsp+478h+var_450], rdi
mov ebx, esi
mov r14, rdx
mov r15d, ecx
mov rax, fs:28h
mov [rsp+478h+var_40], rax
xor eax, eax
movsxd rdi, esi
shl rdi, 3
call _malloc
mov [rsp+47... | long long func0(long long a1, int a2, _QWORD *a3, int a4)
{
long long j; // rbp
_QWORD *v7; // rbx
long long i; // [rsp+8h] [rbp-470h]
long long v10; // [rsp+10h] [rbp-468h]
long long v11; // [rsp+18h] [rbp-460h]
_QWORD v12[137]; // [rsp+30h] [rbp-448h] BYREF
v12[129] = __readfsqword(0x28u);
v11 = mal... | func0:
ENDBR64
PUSH R15
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x448
MOV qword ptr [RSP + 0x28],RDI
MOV EBX,ESI
MOV R14,RDX
MOV R15D,ECX
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x438],RAX
XOR EAX,EAX
MOVSXD RDI,ESI
SHL RDI,0x3
CALL 0x00101120
MOV qword ptr [RSP + 0x18],RAX
TEST EBX,EBX
JLE 0x0010... | void * func0(long param_1,uint param_2,int8 *param_3,int param_4)
{
void *pvVar1;
char *pcVar2;
char *__s;
char *pcVar3;
long lVar4;
int8 *puVar5;
long in_FS_OFFSET;
byte bVar6;
ulong local_470;
int8 local_448;
int8 local_440;
int8 local_438 [127];
long local_40;
bVar6 = 0;
local_40 = ... |
6,174 | func0 |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
| char** func0(char* list1[], int n1, char* charlist[], int n_char) {
char** new_list = malloc(n1 * sizeof(char*));
for(int i = 0; i < n1; i++) {
char* line = strdup(list1[i]);
char* token;
char buffer[1024] = "";
token = strtok(line, " ");
while(token != NULL) {
... | int main() {
// Test case 1
char* list1_a[] = {"Red color", "Orange#", "Green", "Orange @", "White"};
char* charlist_a[] = {"#", "color", "@"};
char* expected_a[] = {"Red", "", "Green", "Orange", "White"};
char** result_a = func0(list1_a, 5, charlist_a, 3);
for(int i = 0; i < 5; i++) {
... | O2 | c | func0:
endbr64
push %r15
push %r14
mov %rdx,%r14
push %r13
mov %ecx,%r13d
push %r12
push %rbp
push %rbx
sub $0x458,%rsp
mov %rdi,0x30(%rsp)
movslq %esi,%rdi
mov %rdx,0x8(%rsp)
mov %rdi,%rbx
shl $0x3,%rdi
mov %fs:0x28,%rax
mov %rax,0x448(%rsp)
xor %eax,%eax
callq 1120 <malloc@p... | func0:
endbr64
push r15
push r14
mov r14, rdx
push r13
mov r13d, ecx
push r12
push rbp
push rbx
mov ebx, esi
sub rsp, 458h
mov [rsp+488h+var_460], rdi
mov [rsp+488h+var_480], rdx
mov rax, fs:28h
mov [rsp+488h+var_40], rax
xor eax, eax
movsxd rax, esi
lea rdi, d... | long long func0(long long a1, int a2, _QWORD *a3, int a4)
{
long long j; // r15
_QWORD *v7; // r12
long long i; // [rsp+10h] [rbp-478h]
long long v11; // [rsp+18h] [rbp-470h]
long long v12; // [rsp+20h] [rbp-468h]
_OWORD v13[64]; // [rsp+40h] [rbp-448h] BYREF
unsigned long long v14; // [rsp+448h] [rbp-40... | func0:
ENDBR64
PUSH R15
PUSH R14
MOV R14,RDX
PUSH R13
MOV R13D,ECX
PUSH R12
PUSH RBP
PUSH RBX
MOV EBX,ESI
SUB RSP,0x458
MOV qword ptr [RSP + 0x28],RDI
MOV qword ptr [RSP + 0x8],RDX
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x448],RAX
XOR EAX,EAX
MOVSXD RAX,ESI
LEA RDI,[RAX*0x8]
MOV qword ptr [RSP + 0x30],RAX
CAL... | void * func0(long param_1,int param_2,int8 *param_3,int param_4)
{
void *pvVar1;
char *__s;
char *pcVar2;
char *pcVar3;
long lVar4;
int8 *puVar5;
long in_FS_OFFSET;
byte bVar6;
long local_478;
int1 local_448 [16];
int8 local_438 [127];
long local_40;
bVar6 = 0;
local_40 = *(long *)(in_FS... |
6,175 | func0 |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
| char** func0(char* list1[], int n1, char* charlist[], int n_char) {
char** new_list = malloc(n1 * sizeof(char*));
for(int i = 0; i < n1; i++) {
char* line = strdup(list1[i]);
char* token;
char buffer[1024] = "";
token = strtok(line, " ");
while(token != NULL) {
... | int main() {
// Test case 1
char* list1_a[] = {"Red color", "Orange#", "Green", "Orange @", "White"};
char* charlist_a[] = {"#", "color", "@"};
char* expected_a[] = {"Red", "", "Green", "Orange", "White"};
char** result_a = func0(list1_a, 5, charlist_a, 3);
for(int i = 0; i < 5; i++) {
... | O3 | c | func0:
endbr64
push %r15
push %r14
mov %rdx,%r14
push %r13
mov %ecx,%r13d
push %r12
push %rbp
push %rbx
sub $0x458,%rsp
mov %rdi,0x30(%rsp)
movslq %esi,%rdi
mov %rdx,0x8(%rsp)
mov %rdi,%rbx
shl $0x3,%rdi
mov %fs:0x28,%rax
mov %rax,0x448(%rsp)
xor %eax,%eax
callq 1120 <malloc@p... | func0:
endbr64
push r15
mov r15d, ecx
push r14
mov r14, rdx
push r13
push r12
push rbp
mov rbp, rdi
push rbx
movsxd rbx, esi
mov r12, rbx
shl rbx, 3
mov rdi, rbx; size
sub rsp, 448h
mov [rsp+478h+var_474], ecx
mov rax, fs:28h
mov [rsp+478h+var_40], rax
xor ... | _QWORD * func0(const char **a1, int a2, const char **a3, int a4)
{
_QWORD *v6; // rax
const char **v7; // rbp
char *v8; // rbx
const char **v9; // r15
const char **v12; // [rsp+8h] [rbp-470h]
char **v13; // [rsp+10h] [rbp-468h]
char *ptr; // [rsp+18h] [rbp-460h]
_QWORD *v15; // [rsp+28h] [rbp-450h]
ch... | func0:
ENDBR64
PUSH R15
MOV R15D,ECX
PUSH R14
MOV R14,RDX
PUSH R13
PUSH R12
PUSH RBP
MOV RBP,RDI
PUSH RBX
MOVSXD RBX,ESI
MOV R12,RBX
SHL RBX,0x3
MOV RDI,RBX
SUB RSP,0x448
MOV dword ptr [RSP + 0x4],ECX
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x438],RAX
XOR EAX,EAX
CALL 0x00101120
MOV qword ptr [RSP + 0x28],RAX
... | int8 * func0(int8 *param_1,int param_2,int8 *param_3,int param_4)
{
int8 *puVar1;
char *__s;
char *pcVar2;
char *pcVar3;
long lVar4;
int8 *puVar5;
long in_FS_OFFSET;
byte bVar6;
int8 *local_470;
int8 *local_468;
char local_448 [1032];
long local_40;
bVar6 = 0;
local_40 = *(long *)(in_FS_... |
6,176 | func0 |
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int cmpfunc(const void *a, const void *b) {
return (*(int*)a - *(int*)b);
}
| int func0(int arr[], int N, int K) {
qsort(arr, N, sizeof(int), cmpfunc);
int *dp = (int *)malloc(N * sizeof(int));
dp[0] = 0;
for (int i = 1; i < N; i++) {
dp[i] = dp[i-1];
if (arr[i] - arr[i-1] < K) {
if (i >= 2) {
dp[i] = (dp[i] > (dp[i-2] + arr[i... | int main() {
int arr1[] = {3, 5, 10, 15, 17, 12, 9};
int arr2[] = {5, 15, 10, 300};
int arr3[] = {1, 2, 3, 4, 5, 6};
assert(func0(arr1, 7, 4) == 62);
assert(func0(arr2, 4, 12) == 25);
assert(func0(arr3, 6, 6) == 21);
printf("All assertions 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 %edx,-0x20(%rbp)
mov -0x1c(%rbp),%eax
movslq %eax,%rsi
mov -0x18(%rbp),%rax
lea -0x49(%rip),%rcx
mov $0x4,%edx
mov %rax,%rdi
callq 10c0 <qsort@plt>
mov -0x1c(%rbp),%eax
cltq
shl $0x... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 20h
mov [rbp+base], rdi
mov [rbp+var_1C], esi
mov [rbp+var_20], edx
mov eax, [rbp+var_1C]
movsxd rsi, eax; nmemb
mov rax, [rbp+base]
lea rdx, cmpfunc
mov rcx, rdx; compar
mov edx, 4; size
mov rdi, rax; base
call _qsort
mov ... | long long func0(void *a1, int a2, int a3)
{
int v3; // eax
int v4; // eax
int i; // [rsp+10h] [rbp-10h]
unsigned int v8; // [rsp+14h] [rbp-Ch]
_DWORD *ptr; // [rsp+18h] [rbp-8h]
qsort(a1, a2, 4uLL, cmpfunc);
ptr = malloc(4LL * a2);
*ptr = 0;
for ( i = 1; i < a2; ++i )
{
ptr[i] = ptr[i - 1];
... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x20
MOV qword ptr [RBP + -0x18],RDI
MOV dword ptr [RBP + -0x1c],ESI
MOV dword ptr [RBP + -0x20],EDX
MOV EAX,dword ptr [RBP + -0x1c]
MOVSXD RSI,EAX
MOV RAX,qword ptr [RBP + -0x18]
LEA RDX,[0x1011e9]
MOV RCX,RDX
MOV EDX,0x4
MOV RDI,RAX
CALL 0x001010c0
MOV EAX,dword ptr [RBP + ... | int4 func0(void *param_1,int param_2,int param_3)
{
int4 uVar1;
int iVar2;
int4 *__ptr;
int iVar3;
int local_18;
qsort(param_1,(long)param_2,4,cmpfunc);
__ptr = (int4 *)malloc((long)param_2 << 2);
*__ptr = 0;
for (local_18 = 1; local_18 < param_2; local_18 = local_18 + 1) {
__ptr[local_18] = _... |
6,177 | func0 |
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int cmpfunc(const void *a, const void *b) {
return (*(int*)a - *(int*)b);
}
| int func0(int arr[], int N, int K) {
qsort(arr, N, sizeof(int), cmpfunc);
int *dp = (int *)malloc(N * sizeof(int));
dp[0] = 0;
for (int i = 1; i < N; i++) {
dp[i] = dp[i-1];
if (arr[i] - arr[i-1] < K) {
if (i >= 2) {
dp[i] = (dp[i] > (dp[i-2] + arr[i... | int main() {
int arr1[] = {3, 5, 10, 15, 17, 12, 9};
int arr2[] = {5, 15, 10, 300};
int arr3[] = {1, 2, 3, 4, 5, 6};
assert(func0(arr1, 7, 4) == 62);
assert(func0(arr2, 4, 12) == 25);
assert(func0(arr3, 6, 6) == 21);
printf("All assertions passed.\n");
return 0;
}
| O1 | c | func0:
endbr64
push %r13
push %r12
push %rbp
push %rbx
sub $0x8,%rsp
mov %rdi,%rbx
mov %esi,%r13d
mov %edx,%ebp
movslq %esi,%r12
lea -0x29(%rip),%rcx
mov $0x4,%edx
mov %r12,%rsi
callq 10c0 <qsort@plt>
shl $0x2,%r12
mov %r12,%rdi
callq 10f0 <malloc@plt>
mov %rax,%rdi
movl $0x0,(... | func0:
endbr64
push r13
push r12
push rbp
push rbx
sub rsp, 8
mov rbx, rdi
mov r13d, esi
mov ebp, edx
movsxd r12, esi
lea rcx, cmpfunc
mov edx, 4
mov rsi, r12
call _qsort
shl r12, 2
mov rdi, r12
call _malloc
mov rdi, rax
mov dword ptr [rax], 0
cmp r13d,... | long long func0(long long a1, int a2, int a3)
{
long long v6; // r12
_DWORD *v7; // rdi
long long i; // rax
int v9; // edx
int v10; // ecx
int v11; // edx
int v12; // esi
int v13; // edx
unsigned int v14; // ebx
qsort(a1, a2, 4LL, cmpfunc);
v6 = a2;
v7 = (_DWORD *)malloc(v6 * 4);
*v7 = 0;
... | func0:
ENDBR64
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x8
MOV RBX,RDI
MOV R13D,ESI
MOV EBP,EDX
MOVSXD R12,ESI
LEA RCX,[0x1011e9]
MOV EDX,0x4
MOV RSI,R12
CALL 0x001010c0
SHL R12,0x2
MOV RDI,R12
CALL 0x001010f0
MOV RDI,RAX
MOV dword ptr [RAX],0x0
CMP R13D,0x1
JLE 0x00101285
MOV R9D,R13D
MOV EAX,0x1
JMP 0x00101257
LA... | int4 func0(void *param_1,uint param_2,int param_3)
{
int iVar1;
int iVar2;
int4 uVar3;
int4 *__ptr;
ulong uVar4;
int iVar5;
int iVar6;
size_t __nmemb;
__nmemb = (size_t)(int)param_2;
qsort(param_1,__nmemb,4,cmpfunc);
__ptr = (int4 *)malloc(__nmemb * 4);
*__ptr = 0;
if (1 < (int)param_2) {
... |
6,178 | func0 |
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int cmpfunc(const void *a, const void *b) {
return (*(int*)a - *(int*)b);
}
| int func0(int arr[], int N, int K) {
qsort(arr, N, sizeof(int), cmpfunc);
int *dp = (int *)malloc(N * sizeof(int));
dp[0] = 0;
for (int i = 1; i < N; i++) {
dp[i] = dp[i-1];
if (arr[i] - arr[i-1] < K) {
if (i >= 2) {
dp[i] = (dp[i] > (dp[i-2] + arr[i... | int main() {
int arr1[] = {3, 5, 10, 15, 17, 12, 9};
int arr2[] = {5, 15, 10, 300};
int arr3[] = {1, 2, 3, 4, 5, 6};
assert(func0(arr1, 7, 4) == 62);
assert(func0(arr2, 4, 12) == 25);
assert(func0(arr3, 6, 6) == 21);
printf("All assertions passed.\n");
return 0;
}
| O2 | c | func0:
endbr64
push %r13
lea -0x1d(%rip),%rcx
push %r12
movslq %esi,%r12
push %rbp
mov %r12,%rsi
mov %r12,%r13
mov %edx,%ebp
push %rbx
mov $0x4,%edx
shl $0x2,%r12
mov %rdi,%rbx
sub $0x8,%rsp
callq 10c0 <qsort@plt>
mov %r12,%rdi
callq 10f0 <malloc@plt>
movl $0x0,(%rax)
mov %rax,... | func0:
endbr64
push r13
lea rcx, cmpfunc
push r12
movsxd r12, esi
push rbp
mov rsi, r12
mov r13, r12
mov ebp, edx
push rbx
mov edx, 4
shl r12, 2
mov rbx, rdi
sub rsp, 8
call _qsort
mov rdi, r12
call _malloc
mov dword ptr [rax], 0
mov rdi, rax
cmp r13d, ... | long long func0(long long a1, int a2, int a3)
{
long long v4; // r12
_DWORD *v6; // rax
_DWORD *v7; // rdi
long long v8; // r9
long long v9; // rax
int i; // ecx
int v11; // edx
int v12; // edx
int v13; // esi
int v14; // edx
unsigned int v15; // r12d
v4 = a2;
qsort(a1, a2, 4LL, cmpfunc);
... | func0:
ENDBR64
PUSH R13
LEA RCX,[0x101360]
PUSH R12
MOVSXD R12,ESI
PUSH RBP
MOV RSI,R12
MOV R13,R12
MOV EBP,EDX
PUSH RBX
MOV EDX,0x4
SHL R12,0x2
MOV RBX,RDI
SUB RSP,0x8
CALL 0x001010c0
MOV RDI,R12
CALL 0x001010f0
MOV dword ptr [RAX],0x0
MOV RDI,RAX
CMP R13D,0x1
JLE 0x0010140c
LEA R9D,[R13 + -0x1]
MOV EAX,0x1
XOR ECX,EC... | int4 func0(void *param_1,int param_2,int param_3)
{
int iVar1;
int4 uVar2;
int4 *__ptr;
ulong uVar3;
int iVar4;
int iVar5;
int iVar6;
size_t __nmemb;
__nmemb = (size_t)param_2;
qsort(param_1,__nmemb,4,cmpfunc);
__ptr = (int4 *)malloc(__nmemb * 4);
*__ptr = 0;
if (1 < param_2) {
uVar3 =... |
6,179 | func0 |
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int cmpfunc(const void *a, const void *b) {
return (*(int*)a - *(int*)b);
}
| int func0(int arr[], int N, int K) {
qsort(arr, N, sizeof(int), cmpfunc);
int *dp = (int *)malloc(N * sizeof(int));
dp[0] = 0;
for (int i = 1; i < N; i++) {
dp[i] = dp[i-1];
if (arr[i] - arr[i-1] < K) {
if (i >= 2) {
dp[i] = (dp[i] > (dp[i-2] + arr[i... | int main() {
int arr1[] = {3, 5, 10, 15, 17, 12, 9};
int arr2[] = {5, 15, 10, 300};
int arr3[] = {1, 2, 3, 4, 5, 6};
assert(func0(arr1, 7, 4) == 62);
assert(func0(arr2, 4, 12) == 25);
assert(func0(arr3, 6, 6) == 21);
printf("All assertions passed.\n");
return 0;
}
| O3 | c | func0:
endbr64
push %r13
movslq %esi,%r13
lea -0x20(%rip),%rcx
push %r12
mov %r13,%rsi
mov %edx,%r12d
mov $0x4,%edx
push %rbp
mov %r13,%rbp
shl $0x2,%r13
push %rbx
mov %rdi,%rbx
sub $0x8,%rsp
callq 10c0 <qsort@plt>
mov %r13,%rdi
callq 10f0 <malloc@plt>
movl $0x0,(%rax)
mov %rax... | func0:
endbr64
push r13
movsxd r13, esi
lea rcx, cmpfunc; compar
push r12
mov rsi, r13; nmemb
mov r12d, edx
mov edx, 4; size
push rbp
mov rbp, r13
shl r13, 2
push rbx
mov rbx, rdi
sub rsp, 8
call _qsort
mov rdi, r13; size
call _malloc
mov dword ptr [rax], 0
mov... | long long func0(int *a1, int a2, int a3)
{
size_t v5; // r13
_DWORD *v7; // rax
_DWORD *v8; // rdi
int *v9; // rdx
int v10; // esi
long long v11; // rax
long long v12; // r9
int v13; // r8d
int v14; // ecx
int v15; // esi
int v16; // r10d
long long v17; // rcx
unsigned int v18; // ebx
int v... | func0:
ENDBR64
PUSH R13
MOVSXD R13,ESI
LEA RCX,[0x101320]
PUSH R12
MOV RSI,R13
MOV R12D,EDX
MOV EDX,0x4
PUSH RBP
MOV RBP,R13
SHL R13,0x2
PUSH RBX
MOV RBX,RDI
SUB RSP,0x8
CALL 0x001010c0
MOV RDI,R13
CALL 0x001010f0
MOV dword ptr [RAX],0x0
MOV RDI,RAX
CMP EBP,0x1
JLE 0x001013f8
CMP EBP,0x3
JLE 0x00101488
MOV RDX,RAX
LEA ... | int func0(int *param_1,int param_2,int param_3)
{
int iVar1;
int *__ptr;
long lVar2;
int iVar3;
int iVar4;
int *piVar5;
int iVar6;
size_t __nmemb;
__nmemb = (size_t)param_2;
qsort(param_1,__nmemb,4,cmpfunc);
__ptr = (int *)malloc(__nmemb * 4);
*__ptr = 0;
if (1 < param_2) {
if (param_2... |
6,180 | func0 | #include <stdio.h>
#include <assert.h>
#include <stdlib.h>
void print_array(int arr[], int size) {
printf("[");
for (int i = 0; i < size; i++) {
printf("%d", arr[i]);
if (i < size - 1) printf(", ");
}
printf("]\n");
}
int arrays_equal(int a[], int b[], int sizeA, int sizeB... | int* func0(int nums[], int size, int *returnSize) {
int *result = (int*)malloc(size * sizeof(int));
int k = 0;
for (int i = 0; i < size; i++) {
int count = 0;
for (int j = 0; j < size; j++) {
if (nums[i] == nums[j]) {
count++;
}
}
... | int main() {
int sz;
int testArr1[] = {1, 2, 3, 2, 3, 4, 5};
int expected1[] = {1, 4, 5};
int* result1 = func0(testArr1, 7, &sz);
assert(arrays_equal(result1, expected1, sz, 3));
int testArr2[] = {1, 2, 3, 2, 4, 5};
int expected2[] = {1, 3, 4, 5};
int* result2 = func0(tes... | O0 | c | func0:
endbr64
push %rbp
mov %rsp,%rbp
sub $0x40,%rsp
mov %rdi,-0x28(%rbp)
mov %esi,-0x2c(%rbp)
mov %rdx,-0x38(%rbp)
mov -0x2c(%rbp),%eax
cltq
shl $0x2,%rax
mov %rax,%rdi
callq 1110 <malloc@plt>
mov %rax,-0x8(%rbp)
movl $0x0,-0x18(%rbp)
movl $0x0,-0x14(%rbp)
jmpq 13d3 <func0+0xcc>
mo... | func0:
endbr64
push rbp
mov rbp, rsp
sub rsp, 40h
mov [rbp+var_28], rdi
mov [rbp+var_2C], esi
mov [rbp+var_38], rdx
mov eax, [rbp+var_2C]
cdqe
shl rax, 2
mov rdi, rax; size
call _malloc
mov [rbp+var_8], rax
mov [rbp+var_18], 0
mov [rbp+var_14], 0
jmp loc_13DC
loc_13... | _DWORD * func0(long long a1, int a2, _DWORD *a3)
{
int v3; // eax
int v6; // [rsp+28h] [rbp-18h]
int i; // [rsp+2Ch] [rbp-14h]
int v8; // [rsp+30h] [rbp-10h]
int j; // [rsp+34h] [rbp-Ch]
_DWORD *v10; // [rsp+38h] [rbp-8h]
v10 = malloc(4LL * a2);
v6 = 0;
for ( i = 0; i < a2; ++i )
{
v8 = 0;
... | func0:
ENDBR64
PUSH RBP
MOV RBP,RSP
SUB RSP,0x40
MOV qword ptr [RBP + -0x28],RDI
MOV dword ptr [RBP + -0x2c],ESI
MOV qword ptr [RBP + -0x38],RDX
MOV EAX,dword ptr [RBP + -0x2c]
CDQE
SHL RAX,0x2
MOV RDI,RAX
CALL 0x00101110
MOV qword ptr [RBP + -0x8],RAX
MOV dword ptr [RBP + -0x18],0x0
MOV dword ptr [RBP + -0x14],0x0
JMP... | void * func0(long param_1,int param_2,int *param_3)
{
void *pvVar1;
int4 local_20;
int4 local_1c;
int4 local_18;
int4 local_14;
pvVar1 = malloc((long)param_2 << 2);
local_20 = 0;
for (local_1c = 0; local_1c < param_2; local_1c = local_1c + 1) {
local_18 = 0;
for (local_14 = 0; local_14 < par... |
6,181 | func0 | #include <stdio.h>
#include <assert.h>
#include <stdlib.h>
void print_array(int arr[], int size) {
printf("[");
for (int i = 0; i < size; i++) {
printf("%d", arr[i]);
if (i < size - 1) printf(", ");
}
printf("]\n");
}
int arrays_equal(int a[], int b[], int sizeA, int sizeB... | int* func0(int nums[], int size, int *returnSize) {
int *result = (int*)malloc(size * sizeof(int));
int k = 0;
for (int i = 0; i < size; i++) {
int count = 0;
for (int j = 0; j < size; j++) {
if (nums[i] == nums[j]) {
count++;
}
}
... | int main() {
int sz;
int testArr1[] = {1, 2, 3, 2, 3, 4, 5};
int expected1[] = {1, 4, 5};
int* result1 = func0(testArr1, 7, &sz);
assert(arrays_equal(result1, expected1, sz, 3));
int testArr2[] = {1, 2, 3, 2, 4, 5};
int expected2[] = {1, 3, 4, 5};
int* result2 = func0(tes... | O1 | c | func0:
endbr64
push %r12
push %rbp
push %rbx
mov %rdi,%rbp
mov %esi,%r12d
mov %rdx,%rbx
movslq %esi,%rdi
shl $0x2,%rdi
callq 1100 <malloc@plt>
test %r12d,%r12d
jle 1346 <func0+0x74>
mov %rbp,%r11
lea -0x1(%r12),%edx
lea 0x4(%rbp,%rdx,4),%r8
mov %rbp,%r9
mov $0x0,%r10d
jmp 1315 ... | func0:
endbr64
push r12
push rbp
push rbx
mov rbx, rdi
mov r12d, esi
mov rbp, rdx
movsxd rdi, esi
shl rdi, 2
call _malloc
test r12d, r12d
jle short loc_134D
lea edx, [r12-1]
lea r8, [rbx+rdx*4+4]
mov r9, rbx
mov r10d, 0
jmp short loc_131C
loc_1313:
add r9, 4
c... | long long func0(int *a1, int a2, _DWORD *a3)
{
long long result; // rax
long long v6; // r8
int *v7; // r9
int v8; // r10d
int v9; // edi
int *v10; // rdx
int v11; // ecx
result = malloc(4LL * a2);
if ( a2 <= 0 )
{
v8 = 0;
}
else
{
v6 = (long long)&a1[a2 - 1 + 1];
v7 = a1;
v8... | func0:
ENDBR64
PUSH R12
PUSH RBP
PUSH RBX
MOV RBX,RDI
MOV R12D,ESI
MOV RBP,RDX
MOVSXD RDI,ESI
SHL RDI,0x2
CALL 0x00101100
TEST R12D,R12D
JLE 0x0010134d
LEA EDX,[R12 + -0x1]
LEA R8,[RBX + RDX*0x4 + 0x4]
MOV R9,RBX
MOV R10D,0x0
JMP 0x0010131c
LAB_00101313:
ADD R9,0x4
CMP R9,R8
JZ 0x00101353
LAB_0010131c:
MOV EDI,dword pt... | void func0(int *param_1,int param_2,int *param_3)
{
void *pvVar1;
int iVar2;
int *piVar3;
int *piVar4;
int iVar5;
pvVar1 = malloc((long)param_2 << 2);
if (param_2 < 1) {
iVar5 = 0;
}
else {
iVar5 = 0;
piVar4 = param_1;
do {
iVar2 = 0;
piVar3 = param_1;
do {
... |
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.