data_source stringclasses 2
values | prompt listlengths 1 1 | ability stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main(){\nint n,m,i;\nscanf(\"%d %d\",&n,&m);\nfor(i=0;i<n;i++)scanf(\"%*d\");\nprintf(\"%d\\n\",(n-2)/(m-1)+1);\nreturn 0;\n}\n\nUnoptimized Assemb... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"%*d\"\n.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\t... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"%*d\"\n.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr6... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \ni;y;z;main(a){for(;~scanf(\"%d\",&a);)i++?a%2?z--:a%4?y++:z++:0;puts(z<0-!y?\"No\":\"Yes\");}\n\nUnoptimized Assembly Code:\n\n\t.file\t\"temp.c\"\n\t.text\n\t.globl\ti\n... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"No\"\n.LC1:\n\t.string\t\"Yes\"\n.LC2:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"No\"\n.LC1:\n\t.string\t\"Yes\"\n.LC2:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tpu... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\n#define MOD_BY 998244353\n\nint add(int a, int b) {\n\treturn a + b - MOD_BY * (a + b >= MOD_BY);\n}\n\nint mul(int a, int b) {\n\tint r = 0;\n\twhi... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tadd\n\t.type\tadd, @function\nadd:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tleal\t(%rdi,%rsi), %eax\n\tleal\t-998244353(%rax), %edx\n\tcmpl\t$998244352, %eax\n\tcmovg\t%edx, %eax\n\tret\n\t.cfi_endproc\n.LFE23:\n\t.size\tadd, .-add\n\t.p2align 4... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tadd\n\t.type\tadd, @function\nadd:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tleal\t(%rdi,%rsi), %eax\n\tleal\t-998244353(%rax), %edx\n\tcmpl\t$998244352, %eax\n\tcmovg\t%edx, %eax\n\tret\n\t.cfi_endproc\n.LFE23:\n\t.size\tadd, .-add\n\t.p2align 4\n\t.g... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n if(n==1)\n printf(\"0\\n\");\n else if(n==0)\n printf(\"1\\n\");\n return 0;\... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"0\"\n.LC2:\n\t.string\t\"1\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"0\"\n.LC2:\n\t.string\t\"1\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#include<string.h>\nint main(void){\nchar s[11];\n scanf(\"%s\",&s);\n \n for(int i=0;i<strlen(s);i+=2){\n if(s[i]!='h'||s[i+1]!='i'){\nprintf(\"No... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"No\"\n.LC2:\n\t.string\t\"Yes\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB35:\n\t.cfi_startproc\n\tendbr6... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"No\"\n.LC2:\n\t.string\t\"Yes\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB35:\n\t.cfi_startproc\n\tendbr64\n\tp... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <string.h>\n\nint main(void) {\n\t/* [z][y][x] */\n\tchar nowstatus[7][7][7]={0};\n\tchar nextstatus[7][7][7]={0};\n\tchar a[27];\n\tchar b[2... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"Case %d:\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB35:\n\t.cfi_startproc\n... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"Case %d:\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB35:\n\t.cfi_startproc\n\tendb... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint main()\n{\n int N;\n scanf(\"%d\", &N);\n int a[N];\n int all = 0;\n for (int i = 0; i < N; i++)\n {\n scanf(\"%d\", &a... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"\"\n.LC2:\n\t.string\t\"%d \"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"\"\n.LC2:\n\t.string\t\"%d \"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpus... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n\ntypedef long long ll;\ntypedef char keytype;\n\nint gcd(int a, int b){ return (a % b) ? gcd(b, a % b) : b;... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tgcd\n\t.type\tgcd, @function\ngcd:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t%edi, %eax\n\tmovl\t%esi, %edx\n\t.p2align 4,,10\n\t.p2align 3\n.L2:\n\tmovl\t%edx, %ecx\n\tcltd\n\tidivl\t%ecx\n\tmovl\t%ecx, %eax\n\ttestl\t%edx, %edx\n\tjne\t.L... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tgcd\n\t.type\tgcd, @function\ngcd:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t%edi, %eax\n\tmovl\t%esi, %edx\n\t.p2align 4,,10\n\t.p2align 3\n.L2:\n\tmovl\t%edx, %ecx\n\tcltd\n\tidivl\t%ecx\n\tmovl\t%ecx, %eax\n\ttestl\t%edx, %edx\n\tjne\t.L2\n\tr... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <stdlib.h>\n\ntypedef struct {\n\tint key, id;\n} data;\n\nvoid merge_sort(data x[], int n)\n{\n\tstatic data y[100001] = {};\n\tif (n <= 1) ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.type\tmerge_sort.part.0, @function\nmerge_sort.part.0:\n.LFB44:\n\t.cfi_startproc\n\tpushq\t%r12\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 12, -16\n\tmovl\t%esi, %r12d\n\tsarl\t%r12d\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 24\n\t.cfi_offset 6, -24\n\tmovq... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.type\tmerge_sort.part.0, @function\nmerge_sort.part.0:\n.LFB44:\n\t.cfi_startproc\n\tpushq\t%r12\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 12, -16\n\tmovl\t%esi, %r12d\n\tsarl\t%r12d\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 24\n\t.cfi_offset 6, -24\n\tmovq\t%rdi... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint main(void) {\n\tchar s[16];\n\tint y = 0,i,j,sum = 0,u,p[16] = {0},q[16] = {0,2,3,4,5,6,7,2,3,4,5,6},a = 0,c;\n\tscanf(\"%s\",s);\n\tfor(i = 0;i... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC3:\n\t.string\t\"%d\\n\"\n.LC4:\n\t.string\t\"MULTIPLE\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC3:\n\t.string\t\"%d\\n\"\n.LC4:\n\t.string\t\"MULTIPLE\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendb... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main(){\n long int i,x,y;\n scanf(\"%ld%ld\",&x,&y);\n for(i=0;x<<i<=y;i++);\n printf(\"%ld\",i);\n}\n\n\nUnoptimized Assembly Code:\n\n\t.file... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%ld%ld\"\n.LC1:\n\t.string\t\"%ld\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$40, %rsp\n... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%ld%ld\"\n.LC1:\n\t.string\t\"%ld\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$40, %rsp\n\t.cfi... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \nunsigned long long popcnt64(unsigned long long n){\n\tconst unsigned long long m1=0x5555555555555555ULL;\n\tconst unsigned long long m2=0x3333333333333333ULL;\n\tconst un... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tpopcnt64\n\t.type\tpopcnt64, @function\npopcnt64:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tmovabsq\t$6148914691236517205, %rdx\n\tmovq\t%rdi, %rax\n\tmovabsq\t$1085102592571150095, %rcx\n\tshrq\t%rax\n\tandq\t%rdx, %rdi\n\tandq\t%rdx, %rax\n\tmov... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tpopcnt64\n\t.type\tpopcnt64, @function\npopcnt64:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tmovabsq\t$6148914691236517205, %rdx\n\tmovq\t%rdi, %rax\n\tmovabsq\t$1085102592571150095, %rcx\n\tshrq\t%rax\n\tandq\t%rdx, %rdi\n\tandq\t%rdx, %rax\n\tmovabsq\t... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint N;\nint a[114514];\n\nint main(void) {\n\tint i;\n\tint minIndex, minValue;\n\tif (scanf(\"%d\", &N) != 1) return 1;\n\tfor (i = 0; i < N; i++) ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r13\n\t.cfi... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r13\n\t.cfi_def_c... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <stdlib.h>\n\n\nint top, S[10000];\n\nvoid push(int x){\n S[++top] = x;\n}\n\nint pop(){\n top--;\n return S[top+1];\n}\n\nint main(void)\... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tpush\n\t.type\tpush, @function\npush:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tmovl\ttop(%rip), %eax\n\tleaq\tS(%rip), %rdx\n\taddl\t$1, %eax\n\tmovl\t%eax, top(%rip)\n\tcltq\n\tmovl\t%edi, (%rdx,%rax,4)\n\tret\n\t.cfi_endproc\n.LFE39:\n\t.size\... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tpush\n\t.type\tpush, @function\npush:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tmovl\ttop(%rip), %eax\n\tleaq\tS(%rip), %rdx\n\taddl\t$1, %eax\n\tmovl\t%eax, top(%rip)\n\tcltq\n\tmovl\t%edi, (%rdx,%rax,4)\n\tret\n\t.cfi_endproc\n.LFE39:\n\t.size\tpush,... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n//set many funcs template\n//Ver.20181228\n#include<stdio.h>\n#include<string.h>\n#include<stdlib.h>\n#include<stdbool.h>\n#include<time.h>\n#define inf 1072114514\n#defi... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tmax\n\t.type\tmax, @function\nmax:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tcmpl\t%esi, %edi\n\tmovl\t%esi, %eax\n\tcmovge\t%edi, %eax\n\tret\n\t.cfi_endproc\n.LFE51:\n\t.size\tmax, .-max\n\t.p2align 4\n\t.globl\tmin\n\t.type\tmin, @function\nmi... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tmax\n\t.type\tmax, @function\nmax:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tcmpl\t%esi, %edi\n\tmovl\t%esi, %eax\n\tcmovge\t%edi, %eax\n\tret\n\t.cfi_endproc\n.LFE51:\n\t.size\tmax, .-max\n\t.p2align 4\n\t.globl\tmin\n\t.type\tmin, @function\nmin:\n.L... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#include<string.h>\n#include<stdlib.h>\n\nint main() {\n\tlong long int k, s[200050] = {},left,right,memo=0;\n\tscanf(\"%lld\", &k);\n\tfor (int i = 1;... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lld\"\n.LC1:\n\t.string\t\"-1\"\n.LC2:\n\t.string\t\"%lld %lld\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB51:\n\t.cfi_startproc\n... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lld\"\n.LC1:\n\t.string\t\"-1\"\n.LC2:\n\t.string\t\"%lld %lld\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB51:\n\t.cfi_startproc\n\tendb... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <limits.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <time.h>\n#include <unistd.h>\n#include <math.h>\n\n#defi... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcomp\n\t.type\tcomp, @function\ncomp:\n.LFB63:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE63:\n\t.size\tcomp, .-comp\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"Y... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcomp\n\t.type\tcomp, @function\ncomp:\n.LFB63:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE63:\n\t.size\tcomp, .-comp\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"Yes\"\n... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \nd,r;char s[9];main(n){for(scanf(\"%d%*c\",&n);n--;d+=*s-65?-1:1,r|=d<0)gets(s);d=!puts(r|d?\"NO\":\"YES\");}\n\nUnoptimized Assembly Code:\n\n\t.file\t\"temp.c\"\n\t.text... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"NO\"\n.LC1:\n\t.string\t\"YES\"\n.LC2:\n\t.string\t\"%d%*c\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendb... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"NO\"\n.LC1:\n\t.string\t\"YES\"\n.LC2:\n\t.string\t\"%d%*c\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n/* SPDX-License-Identifier: X11\n *\n * Copyright 2020 Elias Yuan <a@jthv.ai>, MIT/X11 License\n * https://jthv.ai/LICENSE/X11.txt\n *\n * ANU-CPC Complexity Workshop -... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lu %lu\"\n.LC1:\n\t.string\t\"%lu\\n\"\n.LC2:\n\t.string\t\"-1\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lu %lu\"\n.LC1:\n\t.string\t\"%lu\\n\"\n.LC2:\n\t.string\t\"-1\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendb... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <stdlib.h>\n\nint main (void) {\n int n;\n scanf(\"%d\", &n);\n long int a[n + 1];\n\n if (n == 1 || n == 2) {\n printf(\"... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"0\"\n.LC3:\n\t.string\t\"%ld\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB39:\n\t.cfi_startproc\n\tendb... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"0\"\n.LC3:\n\t.string\t\"%ld\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint main() {\n\t\n\tint n, k, x=1, y=1, hasil;\n\t\n\tscanf(\"%d\", &n);\n\tscanf(\"%d\", &k);\n\t\n\tfor(int i=0; i<n; i++){\n\t\tif(x*2<=x+k){\n\t... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_of... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 6... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <string.h>\n\nint main(void){\n\n char s[11];\n scanf(\"%s\", s);\n for (int i = 0; i < strlen(s); i += 2) {\n if (s[i] != 'h' || s[i+1... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"No\"\n.LC2:\n\t.string\t\"Yes\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB35:\n\t.cfi_startproc\n\tendbr6... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"No\"\n.LC2:\n\t.string\t\"Yes\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB35:\n\t.cfi_startproc\n\tendbr64\n\tp... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#if 0\ncat <<EOF >mistaken-paste\n#endif\n// thx Ebi-chan!\n\n#pragma GCC diagnostic ignored \"-Wincompatible-pointer-types\"\n#define _USE_MATH_DEFINES\n\n#include <stdi... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tpfracomp\n\t.type\tpfracomp, @function\npfracomp:\n.LFB74:\n\t.cfi_startproc\n\tendbr64\n\tmovq\t(%rdi), %rdx\n\tmovq\t8(%rdi), %rax\n\timulq\t8(%rsi), %rdx\n\timulq\t(%rsi), %rax\n\tcmpq\t%rax, %rdx\n\tmovl\t$-1, %edx\n\tsetg\t%al\n\tmovzbl\t%a... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tpfracomp\n\t.type\tpfracomp, @function\npfracomp:\n.LFB74:\n\t.cfi_startproc\n\tendbr64\n\tmovq\t(%rdi), %rdx\n\tmovq\t8(%rdi), %rax\n\timulq\t8(%rsi), %rdx\n\timulq\t(%rsi), %rax\n\tcmpq\t%rax, %rdx\n\tmovl\t$-1, %edx\n\tsetg\t%al\n\tmovzbl\t%al, %ea... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n\nint main(void)\n{\n char s[5];\n scanf(\"%s\", s);\n for (int i=0; i<3; i++){\n if (s[i] == s[i+1]){\n printf(\"Bad\");\n ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"Bad\"\n.LC2:\n\t.string\t\"Good\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendb... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"Bad\"\n.LC2:\n\t.string\t\"Good\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint main()\n{\n\tint i, N, W, w[101], v[101];\n\tscanf(\"%d %d\", &N, &W);\n\tfor (i = 1; i <= N; i++) scanf(\"%d %d\", &(w[i]), &(v[i]));\n\t\n\tin... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.cfi_de... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint A[100005];\nint tmp[100005];\n\nint main() {\n\n\tint N;\n\n\tscanf(\"%d\",&N);\n\n\tint i;\n\n\tfor (i = 0; i < N; i++) {\n\t\tscanf(\" %d\",&A... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\" %d\"\n.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tend... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\" %d\"\n.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <math.h>\n\nint main(int argc, char** argv)\n{\n int n,k;\n\n scanf(\"%d\", &n);\n scanf(\"%d\", &k);\n\n // log_k(n)\n // log... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_c... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint main (){\n \n char str[10005];\n scanf(\"%[^\\n]\", str);\n int flag = 0;\n for(int i = 0;str[i] != '\\0';i++){\n \tif(str[i] ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%[^\\n]\"\n.LC1:\n\t.string\t\"YES\"\n.LC2:\n\t.string\t\"NO\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\te... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%[^\\n]\"\n.LC1:\n\t.string\t\"YES\"\n.LC2:\n\t.string\t\"NO\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint main()\n{\n\tint i, j, k, N, L[101], count = 0;\n\tscanf(\"%d\", &N);\n\tfor (i = 1; i <= N; i++) scanf(\"%d\", &(L[i]));\n\tfor (i = 1; i <= N ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.cfi... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.cfi_def_c... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\nint main(){\nint H, W, i, j;\nfor (;;){\nscanf(\"%d %d\", &H, &W);\nif (H == 0 && W == 0 ) break;\nfor ( i = 1; i < H+1; i++ ){\nfor ( j = 1; j < W+1;... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r14\n\t.cfi_def_cfa_offset 16\n\t.cfi... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r14\n\t.cfi_def_cfa_offset 16\n\t.cfi_offse... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <float.h>\n#include <limits.h>\n#include <math.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <time.h>\n\n// 内部定数\n#define D_ON\t\t\t... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tfSortFncVd\n\t.type\tfSortFncVd, @function\nfSortFncVd:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rsi), %eax\n\tcmpl\t%eax, (%rdi)\n\tmovl\t$-1, %edx\n\tsetl\t%al\n\tmovzbl\t%al, %eax\n\tcmovg\t%edx, %eax\n\tret\n\t.cfi_endproc\n.LFE51:\n... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tfSortFncVd\n\t.type\tfSortFncVd, @function\nfSortFncVd:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rsi), %eax\n\tcmpl\t%eax, (%rdi)\n\tmovl\t$-1, %edx\n\tsetl\t%al\n\tmovzbl\t%al, %eax\n\tcmovg\t%edx, %eax\n\tret\n\t.cfi_endproc\n.LFE51:\n\t.siz... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint main (void){\n\n\tchar s[100000];\n\tscanf(\"%s\",s);\n\n\tint count = 0;\n\tint i;\n\n\tfor(i = 0; s[i] != '\\0'; i++){\n\n\t\tif(s[i] != s[i +... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tleaq\t-98304(%rsp),... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tleaq\t-98304(%rsp), %r11\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint main()\n{\n\tlong long x;\n\tscanf(\"%lld\", &x);\n\t\n\tlong long ans = (x - 1) / 11 * 2;\n\tif ((x - 1) % 11 < 6) ans += 1;\n\telse ans += 2;\... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lld\"\n.LC1:\n\t.string\t\"%lld\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lld\"\n.LC1:\n\t.string\t\"%lld\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp\n\t.c... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <limits.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\nint f(long h[2], const int a[2], const int b[2]){\n\tif(a[0]*b[1]>a[1]*b[0]){\n\t\tlo... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tf\n\t.type\tf, @function\nf:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rsi), %r8d\n\tmovq\t%rdi, %rcx\n\tmovslq\t4(%rsi), %rdi\n\tmovslq\t%r8d, %rsi\n\timull\t4(%rdx), %r8d\n\tmovq\t%rdi, %rax\n\timull\t(%rdx), %eax\n\tcmpl\t%eax, %r8d\n\... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tf\n\t.type\tf, @function\nf:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rsi), %r8d\n\tmovq\t%rdi, %rcx\n\tmovslq\t4(%rsi), %rdi\n\tmovslq\t%r8d, %rsi\n\timull\t4(%rdx), %r8d\n\tmovq\t%rdi, %rax\n\timull\t(%rdx), %eax\n\tcmpl\t%eax, %r8d\n\tjle\t... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#include<stdlib.h>\n#include<stdint.h>\n#include<inttypes.h>\n\ntypedef int32_t i32;\ntypedef int64_t i64;\n\ntypedef struct directed_edge {\n int32_t... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcmp_deque_size\n\t.type\tcmp_deque_size, @function\ncmp_deque_size:\n.LFB50:\n\t.cfi_startproc\n\tendbr64\n\tmovq\t(%rdi), %rdx\n\tmovq\t(%rsi), %rcx\n\tmovq\t16(%rdx), %rax\n\tsubq\t8(%rdx), %rax\n\tandq\t24(%rdx), %rax\n\tmovq\t16(%rcx), %rdx\... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcmp_deque_size\n\t.type\tcmp_deque_size, @function\ncmp_deque_size:\n.LFB50:\n\t.cfi_startproc\n\tendbr64\n\tmovq\t(%rdi), %rdx\n\tmovq\t(%rsi), %rcx\n\tmovq\t16(%rdx), %rax\n\tsubq\t8(%rdx), %rax\n\tandq\t24(%rdx), %rax\n\tmovq\t16(%rcx), %rdx\n\tsub... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n\nint main(void){\n int n , k;\n scanf(\"%d %d\",&n ,&k);\n\n int check[10] = {0} , a;\n for(int i = 0;i < k;i ++){\n scanf(\"%d\",&a);\n che... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\te... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#include<string.h>\n#include<stdlib.h>\n#define N 2000000\n#define D 20\n\nstruct node{\n int key;\n struct node *next;\n struct node *prev;\n};\n\n... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tinit\n\t.type\tinit, @function\ninit:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$8, %rsp\n\t.cfi_def_cfa_offset 16\n\tmovl\t$24, %edi\n\tcall\tmalloc@PLT\n\tmovq\t%rax, %xmm0\n\tmovq\t%rax, nil(%rip)\n\tpunpcklqdq\t%xmm0, %xmm0\n\tmovups\t%... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tinit\n\t.type\tinit, @function\ninit:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$8, %rsp\n\t.cfi_def_cfa_offset 16\n\tmovl\t$24, %edi\n\tcall\tmalloc@PLT\n\tmovq\t%rax, %xmm0\n\tmovq\t%rax, nil(%rip)\n\tpunpcklqdq\t%xmm0, %xmm0\n\tmovups\t%xmm0, ... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n\nint main(void)\n{\n int x[60], y[60];\n int n;\n int cnt = 0;\n int i;\n double ans;\n\n while(1){\n scanf(\"%d\", &n);\n ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%d %d\"\n.LC4:\n\t.string\t\"%d %.1lf\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startpro... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%d %d\"\n.LC4:\n\t.string\t\"%d %.1lf\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\te... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\nint main(void){\n char ch, C;\n for(;;){\n scanf(\"%c\",&ch);\n if(ch == '\\n'){\n break;\n }\n else if(ch == ' '){\n printf(\" \");\n... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%c\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_of... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%c\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 6... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <string.h>\n\nint main(){\n\tchar a[20];\n\tscanf(\"%s\", &a);\n\tmemset(a+3, '\\0', 17);\n\tprintf(\"%s\\n\", a);\n\n\treturn 0;\n}\n\nUnopt... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB35:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_of... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB35:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 6... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <math.h>\n#include <limits.h>\n#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);\n#define MAX(a... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcomp\n\t.type\tcomp, @function\ncomp:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE51:\n\t.size\tcomp, .-comp\n\t.p2align 4\n\t.globl\tfill\n\t.type\tfill, @function\nfill:\n.LFB52... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcomp\n\t.type\tcomp, @function\ncomp:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE51:\n\t.size\tcomp, .-comp\n\t.p2align 4\n\t.globl\tfill\n\t.type\tfill, @function\nfill:\n.LFB52:\n\t.... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main()\n{\n int a,b,x,y;\n scanf(\"%d%d\",&a,&b);\n if(a>=b)\n {\n x=a;\n a=a-1;\n if(a>=b)\n {\n ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d%d\"\n.LC1:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp\n\t.... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d%d\"\n.LC1:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp\n\t.cfi_de... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <stdlib.h>\n#include <stdbool.h>\n#include <string.h>\n#include <math.h>\n#define Max(a, b) ((a) > (b) ? (a) : (b))\n#define Min(a, b) ((a) >... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"-1\"\n.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB51:\n\t.cfi_startproc\n\tendb... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"-1\"\n.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \nint main(){\nint n,m;\n\tfor(;scanf(\"%d%d\",&n,&m),n;){\n\t\tint t=1001,pre,ans,cnt=0,i;\n\t\tfor(i=0;i<n;i++){\n\t\t\tint a; scanf(\"%d\",&a);\n\n\t\t\tint j;\n\t\t\tfo... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n.LC2:\n\t.string\t\"%d%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tend... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n.LC2:\n\t.string\t\"%d%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <string.h>\n#include <math.h>\n#include <stdlib.h>\n\nstruct tuple {\n int x;\n int y;\n};\n\nint asc(const void *a, const void *b) {\n... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tasc\n\t.type\tasc, @function\nasc:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t4(%rdi), %eax\n\tsubl\t4(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE51:\n\t.size\tasc, .-asc\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tasc\n\t.type\tasc, @function\nasc:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t4(%rdi), %eax\n\tsubl\t4(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE51:\n\t.size\tasc, .-asc\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n// AOJ 1161: Verbal Arithmetic\n// 2018.1.9 bal4u@uu\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\nint m, sz;\nchar str[13][11]; int len[13], max;\nc... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcalc\n\t.type\tcalc, @function\ncalc:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovslq\tm(%rip), %r10\n\tleaq\tlen(%rip), %rax\n\tleaq\tstr(%rip), %r8\n\tleaq\tassign(%rip), %rsi\n\tleaq\t(%r10,%r10,4), %rdx\n\tmovslq\t(%rax,%r10,4), %rax\n\tmovq... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcalc\n\t.type\tcalc, @function\ncalc:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovslq\tm(%rip), %r10\n\tleaq\tlen(%rip), %rax\n\tleaq\tstr(%rip), %r8\n\tleaq\tassign(%rip), %rsi\n\tleaq\t(%r10,%r10,4), %rdx\n\tmovslq\t(%rax,%r10,4), %rax\n\tmovq\t%r10... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#include<stdlib.h>\n#include<limits.h>\n\nstruct node {\n int id;\n int weight;\n struct node *next;\n};\nstruct node **list;\nint *dist;\n\nvoid In... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tInsert\n\t.type\tInsert, @function\nInsert:\n.LFB40:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 12, -16\n\tmovl\t%edx, %r12d\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 24\n\t.cfi_offset 6, -24\n\tmovl\t%esi, ... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tInsert\n\t.type\tInsert, @function\nInsert:\n.LFB40:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 12, -16\n\tmovl\t%edx, %r12d\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 24\n\t.cfi_offset 6, -24\n\tmovl\t%esi, %ebp\n... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint a[200000];\nint b[200000];\n\nint main(void)\n{\n\tint n, m, i, j;\n\tscanf(\"%d\", &n);\n\tfor (i = 0; i < n; i++) {\n\t\tscanf(\"%d\", a + i);... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"1\"\n.LC1:\n\t.string\t\"0\"\n.LC2:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"1\"\n.LC1:\n\t.string\t\"0\"\n.LC2:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpush... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main(void)\n{\n\tint t,n,s;\n\tint i;\n\t\n\tfor(i=0;i<4;i++){\n\t\tscanf(\"%d %d\",&t,&n);\n\t\tif(t==1){\n\t\t\ts=n*6000;\n\t\t}\n\t\telse if(t==... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.cfi_de... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n/*\n AOJ \n title:#3128\n @kankichi57301\n */\n#include <stdio.h>\n\nint n;\nint main()\n{\n int i,c,c0,min_;\n scanf(\"%d \",&n);\n scanf(\"%d \",&c0);\n for(i=mi... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d \"\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%d\\n%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d \"\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%d\\n%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendb... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main(void)\n{\n int H,W,n,i;\n for(;;)\n {\n scanf(\"%d %d\",&H,&W);\n \n if((H==0)&&(W==0)) break;\n \n ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r14\n\t.cfi_def_cfa_offset 16\n\t.cfi... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r14\n\t.cfi_def_cfa_offset 16\n\t.cfi_offse... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <stdlib.h>\n#define int long long\n#define inf (int)(1e18)\n\nint max(int a, int b){\n\treturn a >= b ? a : b;\n}\n\nsigned main(){\n\tint N,... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tmax\n\t.type\tmax, @function\nmax:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tcmpq\t%rsi, %rdi\n\tmovq\t%rsi, %rax\n\tcmovge\t%rdi, %rax\n\tret\n\t.cfi_endproc\n.LFE39:\n\t.size\tmax, .-max\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tmax\n\t.type\tmax, @function\nmax:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tcmpq\t%rsi, %rdi\n\tmovq\t%rsi, %rax\n\tcmovge\t%rdi, %rax\n\tret\n\t.cfi_endproc\n.LFE39:\n\t.size\tmax, .-max\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.stri... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n// AOJ GRL_5_D Tree - Range Query on a Tree\n// 2019.3.29 bal4u\n\n#define _CRT_SECURE_NO_WARNINGS\n#include <stdio.h>\n#include <stdlib.h>\n\n//// 入力の高速化\n#if 1\n#define... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tin\n\t.type\tin, @function\nin:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tmovq\tstdin(%rip), %rdi\n\tpushq\t%r12\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 12, -16\n\tmovq\t8(%rdi), %rax\n\tmovq\t16(%rdi), %rcx\n\tcmpq\t%rcx, %rax\n\tjnb\t.L11\n\tl... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tin\n\t.type\tin, @function\nin:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tmovq\tstdin(%rip), %rdi\n\tpushq\t%r12\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 12, -16\n\tmovq\t8(%rdi), %rax\n\tmovq\t16(%rdi), %rcx\n\tcmpq\t%rcx, %rax\n\tjnb\t.L11\n\tleaq\t1... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#define MAX 100000\nlong long T[MAX];\nint n,k;\n \nint load(long long P) {\n int i=0,j=0;\n long long t;\n for(i = 0; i < k; i++) {\n ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tload\n\t.type\tload, @function\nload:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tmovl\tk(%rip), %r9d\n\ttestl\t%r9d, %r9d\n\tjle\t.L6\n\tmovl\tn(%rip), %ecx\n\txorl\t%r8d, %r8d\n\txorl\t%esi, %esi\n\tleaq\tT(%rip), %r10\n.L3:\n\tmovslq\t%r8d, %rax... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tload\n\t.type\tload, @function\nload:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tmovl\tk(%rip), %r9d\n\ttestl\t%r9d, %r9d\n\tjle\t.L6\n\tmovl\tn(%rip), %ecx\n\txorl\t%r8d, %r8d\n\txorl\t%esi, %esi\n\tleaq\tT(%rip), %r10\n.L3:\n\tmovslq\t%r8d, %rax\n\tle... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n\nint main()\n{\n int R;\n\n scanf(\"%d\",&R);\n int Q;\n int maxi=0;\n int total = 0;\n for(int i=1;i<=R;i++)\n {\n scanf(... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"Yes\"\n.LC2:\n\t.string\t\"No\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr6... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"Yes\"\n.LC2:\n\t.string\t\"No\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tp... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <stdlib.h>\n\nint compare_int(const void *a, const void *b){\n return *(int*)a - *(int*)b;\n}\n\nint main(){\n int n, x, cnt=0, a[100]=... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcompare_int\n\t.type\tcompare_int, @function\ncompare_int:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE39:\n\t.size\tcompare_int, .-compare_int\n\t.section\t.rodata.str1.1,\"aMS\"... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcompare_int\n\t.type\tcompare_int, @function\ncompare_int:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE39:\n\t.size\tcompare_int, .-compare_int\n\t.section\t.rodata.str1.1,\"aMS\",@prog... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n// AOJ 2236 Rabbit Plays Games!\n// 2018.2.10 bal4u\n\n#include <stdio.h>\n#include <stdlib.h>\n\ntypedef struct { int a; int d; } T;\nT tbl[40002];\nint h[40002], a[4000... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcmp\n\t.type\tcmp, @function\ncmp:\n.LFB40:\n\t.cfi_startproc\n\tendbr64\n\tmovslq\t4(%rsi), %rax\n\tmovslq\t(%rdi), %rdx\n\tmovslq\t4(%rdi), %rcx\n\timulq\t%rax, %rdx\n\tmovslq\t(%rsi), %rax\n\timulq\t%rcx, %rax\n\tcmpq\t%rax, %rdx\n\tsetg\t%al... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcmp\n\t.type\tcmp, @function\ncmp:\n.LFB40:\n\t.cfi_startproc\n\tendbr64\n\tmovslq\t4(%rsi), %rax\n\tmovslq\t(%rdi), %rdx\n\tmovslq\t4(%rdi), %rcx\n\timulq\t%rax, %rdx\n\tmovslq\t(%rsi), %rax\n\timulq\t%rcx, %rax\n\tcmpq\t%rax, %rdx\n\tsetg\t%al\n\tmo... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#include<math.h>\ndouble x[4],y[4],eps=1e-6;\nint f(int *a,int *b){\n int i;\n for(i=0;i<2;i++)b[i]-=a[i];\n double l=hypot(b[0],b[1]);\n double c=... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tf\n\t.type\tf, @function\nf:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 15, -16\n\tpxor\t%xmm0, %xmm0\n\tpxor\t%xmm1, %xmm1\n\tpushq\t%r14\n\t.cfi_def_cfa_offset 24\n\t.cfi_offset 14, -24\n\tpus... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tf\n\t.type\tf, @function\nf:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 15, -16\n\tpxor\t%xmm0, %xmm0\n\tpxor\t%xmm1, %xmm1\n\tpushq\t%r14\n\t.cfi_def_cfa_offset 24\n\t.cfi_offset 14, -24\n\tpushq\t%r... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main()\n{\n\nint x, y;\nscanf(\"%d %d\", &x, &y);\n\n if(x==2||y==2){\n printf(\"No\\n\");\n }\n else if((x==1||x==3||x==5||x==7||x... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"No\"\n.LC2:\n\t.string\t\"Yes\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tend... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"No\"\n.LC2:\n\t.string\t\"Yes\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <math.h>\n#include <time.h>\n#include<stdlib.h>\n#include<string.h>\n\nint main(void) {\n int a[5], loss = 0, ans = 0, i;\n\n scanf(\"%... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d %d %d %d\"\n.LC1:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$40,... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d %d %d %d\"\n.LC1:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$40, %rsp\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n\nint main(void) {\n puts(\"square1001\");\n return 0;\n}\n\n\nUnoptimized Assembly Code:\n\n\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata\n.... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"square1001\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$8, %rsp\n\t.cfi_def_cfa_offset 16... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"square1001\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$8, %rsp\n\t.cfi_def_cfa_offset 16\n\tle... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <math.h>\n#include <stdlib.h>\nlong long int x[100], y[100];\nint ind[100], ind2[200];\n\nlong long int naiseki(int a, int b){\n long long... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcompare_angle\n\t.type\tcompare_angle, @function\ncompare_angle:\n.LFB41:\n\t.cfi_startproc\n\tendbr64\n\tmovslq\t(%rdi), %rax\n\tleaq\tx(%rip), %rcx\n\tleaq\ty(%rip), %rdx\n\tmovq\t(%rcx,%rax,8), %rdi\n\tmovq\t(%rdx,%rax,8), %rax\n\ttestq\t%rax... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcompare_angle\n\t.type\tcompare_angle, @function\ncompare_angle:\n.LFB41:\n\t.cfi_startproc\n\tendbr64\n\tmovslq\t(%rdi), %rax\n\tleaq\tx(%rip), %rcx\n\tleaq\ty(%rip), %rdx\n\tmovq\t(%rcx,%rax,8), %rdi\n\tmovq\t(%rdx,%rax,8), %rax\n\ttestq\t%rax, %rax... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#define D(i,a,b)for(int i=a;i>=b;--i)\nf[2005],n,k,M=1e9+7;main(){scanf(\"%d%d\",&n,&k);f[n+1]=1;D(i,n,n-k+1)D(j,n,1)f[j]=j>i?0:(f[j]+f[j+1])%M;D(i,n-k,2)f[1]=f[1]*2%M;pr... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d%d\"\n.LC3:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r14\n\t.cf... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d%d\"\n.LC3:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r14\n\t.cfi_def_... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint z(int a,int b,int c){return a>b&&a>c?a:b<c?c:b;}\nint main(){\n int n,k,i,j,x,y,m[1001][1001]={},s,v,w;\n char a;\n scanf(\"%d%d\",&n,&k);\n fo... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tz\n\t.type\tz, @function\nz:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tcmpl\t%edx, %esi\n\tmovl\t%edi, %eax\n\tcmovl\t%edx, %esi\n\tcmpl\t%edi, %esi\n\tcmovge\t%esi, %eax\n\tret\n\t.cfi_endproc\n.LFE23:\n\t.size\tz, .-z\n\t.section\t.rodata.str1.... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tz\n\t.type\tz, @function\nz:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tcmpl\t%edx, %esi\n\tmovl\t%edi, %eax\n\tcmovl\t%edx, %esi\n\tcmpl\t%edi, %esi\n\tcmovge\t%esi, %eax\n\tret\n\t.cfi_endproc\n.LFE23:\n\t.size\tz, .-z\n\t.section\t.rodata.str1.1,\"aM... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \ns;i;main(a,b,c){\nfor(scanf(\"%d%d%d\",&a,&b,&c);++i<=b;a*i%b-c||s++);\nputs(s?\"YES\":\"NO\");\n}\n\nUnoptimized Assembly Code:\n\n\t.file\t\"temp.c\"\n\t.text\n\t.globl... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"YES\"\n.LC1:\n\t.string\t\"NO\"\n.LC2:\n\t.string\t\"%d%d%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tend... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"YES\"\n.LC1:\n\t.string\t\"NO\"\n.LC2:\n\t.string\t\"%d%d%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nunsigned xor128() {\n\tstatic unsigned x = 123456789, y = 362436069, z = 521288629, w = 88675123;\n\tunsigned t = x ^ (x << 11);\n\tx = y; y = z; z ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\txor128\n\t.type\txor128, @function\nxor128:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tmovl\tx.5(%rip), %eax\n\tmovl\tw.2(%rip), %ecx\n\tmovl\t%eax, %edx\n\tsall\t$11, %edx\n\txorl\t%eax, %edx\n\tmovl\ty.4(%rip), %eax\n\tmovl\t%eax, x.5(%rip)\n\tm... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\txor128\n\t.type\txor128, @function\nxor128:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tmovl\tx.5(%rip), %eax\n\tmovl\tw.2(%rip), %ecx\n\tmovl\t%eax, %edx\n\tsall\t$11, %edx\n\txorl\t%eax, %edx\n\tmovl\ty.4(%rip), %eax\n\tmovl\t%eax, x.5(%rip)\n\tmovl\tz... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\nint main(void){\n // Your code here!\n char str[200001];\n \n scanf(\"%200000s\",str);\n \n for(int i = 0; str[i] != '\\0'; i++){\n ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%200000s\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%200000s\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_of... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <string.h>\n#include <math.h>\n#include <stdlib.h>\n#include <limits.h>\n#include <stdbool.h>\n\n#define rep(i, n) for(int i=0; i<(n); ++i)\n... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tup_comp\n\t.type\tup_comp, @function\nup_comp:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE51:\n\t.size\tup_comp, .-up_comp\n\t.p2align 4\n\t.globl\tdown_comp\n\t.type\tdown_comp,... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tup_comp\n\t.type\tup_comp, @function\nup_comp:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE51:\n\t.size\tup_comp, .-up_comp\n\t.p2align 4\n\t.globl\tdown_comp\n\t.type\tdown_comp, @func... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint dp[100001][3],a[100001][3];\nint main()\n{\n\tint n,i,j,k,max=-1;\n\tscanf(\"%d\",&n);\n\tfor(i=0;i<n;i++){\n\t\tfor(j=0;j<3;j++){\n\t\t\tscanf(\"%... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi_def_c... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main(){\n int n,k,i,j,a,b,c,e,h,mi,min;\n while(scanf(\"%d %d\",&n,&k),n||k){\n int m[100][100]={0};\n while(k--){\n if(scanf(\"%d\",&a)... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d %d %d\"\n.LC2:\n\t.string\t\"%d %d\"\n.LC3:\n\t.string\t\"%d\\n\"\n.LC4:\n\t.string\t\"-1\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.ty... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d %d %d\"\n.LC2:\n\t.string\t\"%d %d\"\n.LC3:\n\t.string\t\"%d\\n\"\n.LC4:\n\t.string\t\"-1\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tma... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint main()\n{\n long long a, b, n;\n scanf(\"%lld %lld %lld\", &a, &b, &n);\n \n printf(\"%lld\", ((n < b) ? (a * n / b) : (a * (b - 1) ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lld %lld %lld\"\n.LC1:\n\t.string\t\"%lld\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$4... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lld %lld %lld\"\n.LC1:\n\t.string\t\"%lld\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$40, %rs... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\nint main(){\n int n, tmp=0, cnt[10000+1]={0};\n scanf(\"%d\", &n);\n for(int x=1; x<=100; x++){\n for(int y=1; y<=100; y++){\n for(int z=1;... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi_def_c... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n//set many funcs template\n//Ver.20180717\n#include<stdio.h>\n#include<string.h>\n#include<stdlib.h>\n#include<stdbool.h>\n#include<time.h>\n#define inf 1072114514\n#defi... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tmax\n\t.type\tmax, @function\nmax:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tcmpl\t%esi, %edi\n\tmovl\t%esi, %eax\n\tcmovge\t%edi, %eax\n\tret\n\t.cfi_endproc\n.LFE51:\n\t.size\tmax, .-max\n\t.p2align 4\n\t.globl\tmin\n\t.type\tmin, @function\nmi... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tmax\n\t.type\tmax, @function\nmax:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tcmpl\t%esi, %edi\n\tmovl\t%esi, %eax\n\tcmovge\t%edi, %eax\n\tret\n\t.cfi_endproc\n.LFE51:\n\t.size\tmax, .-max\n\t.p2align 4\n\t.globl\tmin\n\t.type\tmin, @function\nmin:\n.L... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main()\n{\n\tint x,y;\n\tint i,f1=0,f2=0,flg=0;\n\tint a[7]={1,3,5,7,8,10,12},b[4]={4,6,9,11};\n\tscanf(\"%d %d\",&x,&y);\n\tif(x==2&&y==2) flg=1;\... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC1:\n\t.string\t\"%d %d\"\n.LC5:\n\t.string\t\"Yes\"\n.LC6:\n\t.string\t\"No\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tend... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC1:\n\t.string\t\"%d %d\"\n.LC5:\n\t.string\t\"Yes\"\n.LC6:\n\t.string\t\"No\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#include<stdlib.h>\nint lis(int size, int *A, int *L);\nint main(void)\n{\n int i, n, *a, *l;\n scanf(\"%d\", &n);\n a = (int*)malloc(sizeof(int) * ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tlis\n\t.type\tlis, @function\nlis:\n.LFB40:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rsi), %eax\n\tmovq\t%rdx, %r8\n\tmovl\t%eax, (%rdx)\n\ttestl\t%edi, %edi\n\tjle\t.L10\n\tleal\t-1(%rdi), %edx\n\tmovl\t$1, %r10d\n\tleaq\t4(%rsi,%rdx,4), %r11\n\... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tlis\n\t.type\tlis, @function\nlis:\n.LFB40:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rsi), %eax\n\tmovq\t%rdx, %r8\n\tmovl\t%eax, (%rdx)\n\ttestl\t%edi, %edi\n\tjle\t.L10\n\tleal\t-1(%rdi), %edx\n\tmovl\t$1, %r10d\n\tleaq\t4(%rsi,%rdx,4), %r11\n\tjmp\t... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <stdlib.h>\n#define int long long\n#define inf (int)(1e18)\n\ntypedef struct {\n\tint L;\n\tint R;\n}pair;\n\nsigned compair(const void *a, c... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcompair\n\t.type\tcompair, @function\ncompair:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tmovq\t(%rdi), %rdx\n\taddq\t8(%rdi), %rdx\n\txorl\t%eax, %eax\n\tsubq\t8(%rsi), %rdx\n\tsubq\t(%rsi), %rdx\n\ttestq\t%rdx, %rdx\n\tmovl\t$-1, %edx\n\tsetne\t... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcompair\n\t.type\tcompair, @function\ncompair:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tmovq\t(%rdi), %rdx\n\taddq\t8(%rdi), %rdx\n\txorl\t%eax, %eax\n\tsubq\t8(%rsi), %rdx\n\tsubq\t(%rsi), %rdx\n\ttestq\t%rdx, %rdx\n\tmovl\t$-1, %edx\n\tsetne\t%al\n\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n\nint main(void){\n int a,b;\n scanf(\"%d %d\",&a,&b);\n if(a<=8 && b<=8){\n printf(\"Yay!\\n\");\n }else{\n printf(\":(\\n\");\n }\n retur... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"Yay!\"\n.LC2:\n\t.string\t\":(\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\ten... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"Yay!\"\n.LC2:\n\t.string\t\":(\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <stdlib.h>\n\nint main(void){\n\tint A, B, C, X;\n\tint total;\n\tint count;\n\tint i, j, k;\n\n\tscanf(\"%d %d %d %d\", &A, &B, &C, &X);\n\t... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC1:\n\t.string\t\"%d %d %d %d\"\n.LC3:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r1... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC1:\n\t.string\t\"%d %d %d %d\"\n.LC3:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#define MAX 100000\n\nint X[MAX],num;\n\nint partition(int p,int r){\n int y,i,j,m;\n y = X[r];\n i = p-1;\n for(j=p;j<r;j++){\n if(X[j] <= y){\... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tpartition\n\t.type\tpartition, @function\npartition:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tleaq\tX(%rip), %rcx\n\tmovslq\t%esi, %r11\n\tleal\t-1(%rdi), %r8d\n\tmovl\t(%rcx,%r11,4), %r9d\n\tcmpl\t%edi, %esi\n\tjle\t.L5\n\tsubl\t%edi, %esi\n\tm... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tpartition\n\t.type\tpartition, @function\npartition:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tleaq\tX(%rip), %rcx\n\tmovslq\t%esi, %r11\n\tleal\t-1(%rdi), %r8d\n\tmovl\t(%rcx,%r11,4), %r9d\n\tcmpl\t%edi, %esi\n\tjle\t.L5\n\tsubl\t%edi, %esi\n\tmovslq\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#include<stdlib.h>\n#include<stdint.h>\n#include<inttypes.h>\n#include<string.h>\n\ntypedef int32_t flow_type;\n\nconst flow_type flow_inf = 1000 * 100... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tnew_graph\n\t.type\tnew_graph, @function\nnew_graph:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 12, -16\n\tmovl\t$32, %esi\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 24\n\t.cfi_offset 6, -24\n\tmovsl... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tnew_graph\n\t.type\tnew_graph, @function\nnew_graph:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 12, -16\n\tmovl\t$32, %esi\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 24\n\t.cfi_offset 6, -24\n\tmovslq\t%ed... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#include<string.h>\ntypedef struct i{char f[21];int s,w;} i;\ni g[10];\nint n,t[10],f[10],ans[10],max;\nvoid rec(int d)\n{\n\tint i,w=0,G=0;\n\tif(d==n... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\trec\n\t.type\trec, @function\nrec:\n.LFB35:\n\t.cfi_startproc\n\tendbr64\n\tmovl\tn(%rip), %eax\n\tpushq\t%rbx\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 3, -16\n\tmovl\t%edi, %ebx\n\tcmpl\t%edi, %eax\n\tje\t.L2\n\ttestl\t%eax, %eax\n\tjle\t.L1\n\... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\trec\n\t.type\trec, @function\nrec:\n.LFB35:\n\t.cfi_startproc\n\tendbr64\n\tmovl\tn(%rip), %eax\n\tpushq\t%rbx\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 3, -16\n\tmovl\t%edi, %ebx\n\tcmpl\t%edi, %eax\n\tje\t.L2\n\ttestl\t%eax, %eax\n\tjle\t.L1\n\tmovl\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <math.h>\n#include <stdlib.h>\n#include <string.h>\n#include <limits.h>\n\n#define int64 long long\n\nint main()\n{\n\tint64 dd, gg, min = LL... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lld %lld\"\n.LC1:\n\t.string\t\"%lld\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rb... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lld %lld\"\n.LC1:\n\t.string\t\"%lld\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main(){\n int a,b,h,sum;\n scanf(\"%d\\n%d\\n%d\\n\",&a,&b,&h);\n sum=((a+b)*h)/2;\n printf(\"%d\\n\",sum);\n return 0;\n}\n\n\nUnoptimized As... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\\n%d\\n%d\\n\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\\n%d\\n%d\\n\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$40, %... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main(){\n int n,i,b=0,c=0;\n scanf(\"%d\",&n);\n int a[n+1];\n for(i=0;i<n;i++){\n scanf(\"%d\",&a[i]);\n if(a[i]%2==1)\n b++;\n ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"Yes\"\n.LC2:\n\t.string\t\"No\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr6... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"Yes\"\n.LC2:\n\t.string\t\"No\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tp... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main(void){\n\tchar s[10];\n\tint i,max=0,cnt=0;\n\tscanf(\"%s\",s);\n\tfor(i=0;s[i]!='\\0';i++){\n\t\tif(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$40, %rsp\n\t.cf... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$40, %rsp\n\t.cfi_def_... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#include<stdlib.h>\n#include<stdint.h>\n#include<inttypes.h>\n\ntypedef struct binaryHeap{\n void *array;\n size_t heap_size;\n size_t max_size;\n ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcmp\n\t.type\tcmp, @function\ncmp:\n.LFB45:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tje\t.L1\n\tsarl\t$31, %eax\n\torl\t$1, %eax\n.L1:\n\tret\n\t.cfi_endproc\n.LFE45:\n\t.size\tcmp, .-cmp\n\t.p2align 4\n\t.type... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcmp\n\t.type\tcmp, @function\ncmp:\n.LFB45:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tje\t.L1\n\tsarl\t$31, %eax\n\torl\t$1, %eax\n.L1:\n\tret\n\t.cfi_endproc\n.LFE45:\n\t.size\tcmp, .-cmp\n\t.p2align 4\n\t.type\theap... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main(){\n long long n,i,a,b,p,d[100010];\n scanf(\"%lld\",&n);\n for(i=0;i<n;i++)scanf(\"%lld\",&d[i]);\n a=b=2;\n d[n]=1e9;\n if(d[n-1]-2)go... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lld\"\n.LC1:\n\t.string\t\"%lld %lld\\n\"\n.LC2:\n\t.string\t\"-1\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startpro... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lld\"\n.LC1:\n\t.string\t\"%lld %lld\\n\"\n.LC2:\n\t.string\t\"-1\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\te... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n\tint i, N, h[100001];\n\tscanf(\"%d\", &N);\n\tfor (i = 1; i <= N; i++) scanf(\"%d\", &(h[i]));\n\t\n\tconst in... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi_def_c... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n/*\ncat <<EOF >mistaken-paste\n*/\n\n#pragma GCC diagnostic ignored \"-Wincompatible-pointer-types\"\n#define _USE_MATH_DEFINES\n\n#include <stdio.h>\n#include <stdint.h>... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tumin\n\t.type\tumin, @function\numin:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tcmpq\t%rdi, %rsi\n\tmovq\t%rdi, %rax\n\tcmovbe\t%rsi, %rax\n\tret\n\t.cfi_endproc\n.LFE51:\n\t.size\tumin, .-umin\n\t.p2align 4\n\t.globl\tumax\n\t.type\tumax, @funct... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tumin\n\t.type\tumin, @function\numin:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tcmpq\t%rdi, %rsi\n\tmovq\t%rdi, %rax\n\tcmovbe\t%rsi, %rax\n\tret\n\t.cfi_endproc\n.LFE51:\n\t.size\tumin, .-umin\n\t.p2align 4\n\t.globl\tumax\n\t.type\tumax, @function\nu... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n\nvoid run(void){\n int x,p;\n scanf(\"%d%d\",&x,&p);\n double q=(double)p/100;\n if(x%2==0){\n x/=2;\n printf(\"%.7f\\n\",x/q);\n } else {\... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d%d\"\n.LC2:\n\t.string\t\"%.7f\\n\"\n\t.text\n\t.p2align 4\n\t.globl\trun\n\t.type\trun, @function\nrun:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp\n\t.cfi_def_cfa_offset 32\n\tleaq\t.L... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d%d\"\n.LC2:\n\t.string\t\"%.7f\\n\"\n\t.text\n\t.p2align 4\n\t.globl\trun\n\t.type\trun, @function\nrun:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp\n\t.cfi_def_cfa_offset 32\n\tleaq\t.LC0(%ri... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <string.h>\n\nint main(){\n char s[105]; scanf(\"%s\", s);\n int len = strlen(s);\n char key[] = \"keyence\";\n \n int ans = (strcmp(s,... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"YES\"\n.LC1:\n\t.string\t\"NO\"\n.LC2:\n\t.string\t\"%s\"\n.LC3:\n\t.string\t\"keyence\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"YES\"\n.LC1:\n\t.string\t\"NO\"\n.LC2:\n\t.string\t\"%s\"\n.LC3:\n\t.string\t\"keyence\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB35:\n\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint main()\n{\n\tint i, j, p, N;\n\tscanf(\"%d\", &N);\n\tprintf(\"%d\\n\", (N - 1) * (N - 1) / 2);\n\tfor (i = 1, p = 1 - N % 2; i < N; i++) {\n\t\... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n.LC2:\n\t.string\t\"%d %d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n.LC2:\n\t.string\t\"%d %d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendb... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#define stmin(a,b) ((a)<(b)?(a):(b))\ntypedef unsigned long long ull;\nint main(void){\n\tint n;\n\tlong x;\n\tscanf(\"%d %ld\",&n,&x);\n\tlong ar[n*2]... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %ld\"\n.LC1:\n\t.string\t\"%ld\"\n.LC2:\n\t.string\t\"%llu\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\t... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %ld\"\n.LC1:\n\t.string\t\"%ld\"\n.LC2:\n\t.string\t\"%llu\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr6... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\nint main()\n{\n\tint n, x;\n\tscanf(\"%d %d\", &n, &x);\n\tint i, j;\n\tint a[200005], b[200005];\n\tif (x == 1 || x == 2 * n - 1)\n\t{\n\t\tprintf(\"N... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"No\"\n.LC2:\n\t.string\t\"Yes\"\n.LC3:\n\t.string\t\"1\\n2\\n3\"\n.LC5:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"No\"\n.LC2:\n\t.string\t\"Yes\"\n.LC3:\n\t.string\t\"1\\n2\\n3\"\n.LC5:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\t... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <math.h>\nint main(void){\n int n;\n long long power=1;\n scanf(\"%d\", &n);\n for(int i=1; i<=n; i++) power=(power*i)%(long long... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%lld\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp\n\t.... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%lld\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp\n\t.cfi_de... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n// AOJ 3024 RMQ 2\n// 2019.4.2 bal4u\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#define INF 0x7fffffff\n\n#if 1\n#define gc() getchar_unlocked()\n... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tin\n\t.type\tin, @function\nin:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovq\tstdin(%rip), %rdi\n\tpushq\t%r12\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 12, -16\n\tmovq\t8(%rdi), %rax\n\tmovq\t16(%rdi), %rcx\n\tcmpq\t%rcx, %rax\n\tjnb\t.L11\n\tl... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tin\n\t.type\tin, @function\nin:\n.LFB51:\n\t.cfi_startproc\n\tendbr64\n\tmovq\tstdin(%rip), %rdi\n\tpushq\t%r12\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 12, -16\n\tmovq\t8(%rdi), %rax\n\tmovq\t16(%rdi), %rcx\n\tcmpq\t%rcx, %rax\n\tjnb\t.L11\n\tleaq\t1... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#include<math.h>\n\nint toT(int a,int b,int t)\n{\n\tdouble x,y;\n\ty=a*((100.0+t)/100)+0.000000001;\n\tx=b*((100.0+t)/100)+0.000000001;\n\treturn floo... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\ttoT\n\t.type\ttoT, @function\ntoT:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpxor\t%xmm2, %xmm2\n\tmovsd\t.LC0(%rip), %xmm0\n\tmovsd\t.LC1(%rip), %xmm6\n\tcvtsi2sdl\t%edx, %xmm2\n\tmovq\t.LC3(%rip), %xmm3\n\tmovsd\t.LC2(%rip), %xmm5\n\tmovapd\t%x... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\ttoT\n\t.type\ttoT, @function\ntoT:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpxor\t%xmm2, %xmm2\n\tmovsd\t.LC0(%rip), %xmm0\n\tmovsd\t.LC1(%rip), %xmm6\n\tcvtsi2sdl\t%edx, %xmm2\n\tmovq\t.LC3(%rip), %xmm3\n\tmovsd\t.LC2(%rip), %xmm5\n\tmovapd\t%xmm3, %... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include<stdio.h>\n#include<stdio.h>\n#include<stdlib.h>\n\n\nint main() {\n\tint n, two[25] = {},num[25]={},kosuu,hen=0,memo;\n\ttwo[0] = 1;\n\tscanf(\"%d\", &n);\n\tif ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"2 1\\n1 2 0\"\n.LC2:\n\t.string\t\"%d %d\\n\"\n.LC3:\n\t.string\t\"%d %d 0\\n%d %d %d\\n\"\n.LC4:\n\t.string\t\"%d %d %d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"2 1\\n1 2 0\"\n.LC2:\n\t.string\t\"%d %d\\n\"\n.LC3:\n\t.string\t\"%d %d 0\\n%d %d %d\\n\"\n.LC4:\n\t.string\t\"%d %d %d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n\nint main() {\n unsigned long n = 0;\n unsigned long r = 1;\n scanf(\"%lu\", &n);\n while(n != 0) {\n n >>= 1;\n r <<= 1;\n }\n\n printf(... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lu\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_o... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%lu\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset ... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized assembly code.\nC Code:\n \n#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n int i, j, k, b, d, n, m;\n\n char buf[16] = {0};\n char *p;\n buf[15] = '\\0';\n buf[14] = '\\n';\n char ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"0\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.cfi_def_cfa_offset 16\n\t.cfi_... | {
"answer": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"0\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.