data_source stringclasses 1
value | 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 x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n#include <stdint.h> // uint64_t\n\n#define max(a,b) ((a) > (b) ? (a) : (b))\n#define min(a,b) ((... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tasc_by_end\n\t.type\tasc_by_end, @function\nasc_by_end:\n.LFB55:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t4(%rdi), %eax\n\tsubl\t4(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE55:\n\t.size\tasc_by_end, .-asc_by_end\n\t.section\t.rodata.str1.1,\"aMS\",@p... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tasc_by_end\n\t.type\tasc_by_end, @function\nasc_by_end:\n.LFB55:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t4(%rdi), %eax\n\tsubl\t4(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE55:\n\t.size\tasc_by_end, .-asc_by_end\n\t.section\t.rodata.str1.1,\"a... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\n\n#define MAX 200001\n\nint main(void){\n\n int N,i;\n long int A[MAX],ans = 0;\n\n scanf(\"%d\",&N);\n for(i = 0;i < N;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\"%ld\"\n.LC2:\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.LFB23:\n\t.cfi_startproc\n\ten... | {
"answer": "```assembly\n\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\"%ld\"\n.LC2:\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.LFB23:\n\t.cfi_startpro... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main(){\n char s[1206],w[1204];\n int c=0,i,a=1;\n fgets(s,1205,stdin);\n for(i=0;s[i]!=0;i++){\n if((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\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_cfa_offset 16\n\t.cfi_of... | {
"answer": "```assembly\n\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.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r13\n\t.cfi_def_cfa_offset 16\n\t... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main(void)\n{\n\tfloat a,b;\n\tscanf(\"%f %f\",&a,&b);\n\tprintf(\"%f\",1/(1/a+1/b));\n\treturn 0;\n}```\n\nUnoptimized Assembly Cod... | 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\"%f %f\"\n.LC2:\n\t.string\t\"%f\"\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": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%f %f\"\n.LC2:\n\t.string\t\"%f\"\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, %... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <stdlib.h>\n \nint main(void)\n{\n\n int N;\n int T;\n scanf(\"%d %d\", &N, &T);\n\n if(N < 1 || N > 100) {\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\"TLE\"\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.LFB39:\n\t.cfi_startproc\n\t... | {
"answer": "```assembly\n\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\"TLE\"\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.LFB39:\n\t.cfi_startp... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main(void)\n{\n\tint i;\n\tint j;\n\tint n;\n\tint m;\n\tint question[101] = {0};\n\tint maxPos;\n\tint index;\n\t\n\twhile( 1 )\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%d\"\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"\"\n.LC3:\n\t.string\t\"%s%d\"\n.LC4:\n\t.string\t\" \"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @... | {
"answer": "```assembly\n\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\"\"\n.LC3:\n\t.string\t\"%s%d\"\n.LC4:\n\t.string\t\" \"\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 x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main(void){\n int a, b;\n int i, j, k;\n int h = 0;\n scanf(\"%d %d\", &a, &b);\n for(i = 1; i <= b - a - 1; i++){\n h += i;... | 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.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.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp\... | {
"answer": "```assembly\n\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.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.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\nint main (void){\n int a,ans;\n for(;;){\n ans=0;\n scanf(\"%d\",&a);\n if(a==0)break;\n a=1000-a;\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.LC7:\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": "```assembly\n\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.LC7:\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\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\nt['~~'];s;z;c(int*x){z=*1[&x]-*x;}main(n){for(;s=scanf(\"%d\",&n)*n;printf(\"%u\\n\",s)){for(;s;)scanf(\"%d\",t+--s);for(qsort(t,n,4,c);n;s+=t[--n]*n);}}```\n... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tc\n\t.type\tc, @function\nc:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tmovq\t(%rsp), %rax\n\tmovl\t(%rax), %eax\n\tsubl\t(%rdi), %eax\n\tmovl\t%eax, z(%rip)\n\tret\n\t.cfi_endproc\n.LFE0:\n\t.size\tc, .-c\n\t.section\t.rodata.str1.1,\"aMS\",@progb... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tc\n\t.type\tc, @function\nc:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tmovq\t(%rsp), %rax\n\tmovl\t(%rax), %eax\n\tsubl\t(%rdi), %eax\n\tmovl\t%eax, z(%rip)\n\tret\n\t.cfi_endproc\n.LFE0:\n\t.size\tc, .-c\n\t.section\t.rodata.str1.1,\"aMS\"... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n\nint main(void){\n int n,x,y,nx,ny,max,mx,my,tmp;\n\n scanf(\"%d\",&n);\n while(n--){\n nx=ny=max=0;\n while(1){\n scanf(\"%d%d\",&x,&y);\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%d\"\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.LFB0:\n\t.cfi_startproc\n\t... | {
"answer": "```assembly\n\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\"\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.LFB0:\n\t.cfi_startp... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nsigned main(){\n\n\n\tint n ,k ;\n\tscanf(\"%d %d\",&n ,&k);\n\n\tif(k <= n && 1 <= k && 1 <= n && k <= 50 && n <= 50)\n\t{\n\tprintf(\"%d\... | 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\tsubq\t$24, %rsp\... | {
"answer": "```assembly\n\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\tsubq\t$24... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n// AOJ 2783 Parentheses\n// 2018.2.2 bal4u\n\n#include <stdio.h>\n\nvoid pr(long long len, char c) { while (len--) putchar(c); }\n\nint main()\n{\n\tlong long... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tpr\n\t.type\tpr, @function\npr:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\ttestq\t%rdi, %rdi\n\tje\t.L8\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 6, -16\n\tmovsbl\t%sil, %ebp\n\tpushq\t%rbx\n\t.cfi_def_cfa_offset 24\n\t.cfi_offset 3,... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tpr\n\t.type\tpr, @function\npr:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\ttestq\t%rdi, %rdi\n\tje\t.L8\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 6, -16\n\tmovsbl\t%sil, %ebp\n\tpushq\t%rbx\n\t.cfi_def_cfa_offset 24\n\t.cfi_of... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\nmain(){double a,l,x,s,t;\nfor(;~scanf(\"%lf%lf%lf\",&a,&l,&x);)\nprintf(\"%lf\\n\",sqrt(a*a*(l+l-a)*(l+l+a))/4+sqrt(l*l*x*(l+x+l))/2);exit(0);}```\n\nUnoptimi... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC3:\n\t.string\t\"%lf\\n\"\n.LC4:\n\t.string\t\"%lf%lf%lf\"\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\... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC3:\n\t.string\t\"%lf\\n\"\n.LC4:\n\t.string\t\"%lf%lf%lf\"\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... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\n \nint main(){\n\tint a, b, i;\n\twhile(scanf(\"%d\", &a) != 0){\n\t\tif(a == 0) break;\n\t\tfor(i = 0; i < 9; i++){\n\t\t\tscanf(\"%d\", &... | 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%r14\n\t.cfi... | {
"answer": "```assembly\n\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%r14\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint di[100000];\nint hi[100000];\n\n#define MIN(a, b) ((a) < (b) ? (a) : (b))\n\nint main(){\n int n, h; scanf(\"%d%d\", &n, &h);\n 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%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.c... | {
"answer": "```assembly\n\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%r1... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\n\nint main(void){\n int n,flag,flag2;\n int d1[100],d2[100];\n flag = 0;\n flag2 = 0;\n scanf(\"%d\", &n);\n for(int 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 %d\"\n.LC2:\n\t.string\t\"Yes\"\n.LC3:\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... | {
"answer": "```assembly\n\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\"\n.LC2:\n\t.string\t\"Yes\"\n.LC3:\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:\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n/*\n * FileName: set_difference\n * CreatedDate: 2020-06-09 16:18:09 +0900\n * LastModified: 2020-06-09 16:27:01 +0900\n */\n\n#include <stdio.h>\n#inclu... | 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%r15\n\t.cfi... | {
"answer": "```assembly\n\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%r15\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main(){\n int n,m,i,c,mi,d[10010];\n while(scanf(\"%d %d\",&n,&m),n||m){\n for(i=c=mi=0;i<n;i++)scanf(\"%d\",&d[i]);\n for(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\"%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.LFB23:\n\t.cfi_startproc\n\te... | {
"answer": "```assembly\n\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.LFB23:\n\t.cfi_startpr... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\n\nint main() {\n\tint N;\n\tint ans[10000];\n\tscanf(\"%d\", &N);\n\tint i = 0;\n\tif (N == 0) {\n\t\tprintf(\"0\\n\");\n\t\treturn 0;\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\"0\"\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... | {
"answer": "```assembly\n\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\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.... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\nint main(void){\nint N;\nscanf(\"%d\",&N);\nprintf(\"%d\",(N+1)/2);\nreturn 0;\n}\n```\n\nUnoptimized Assembly Code:\n\n```assembly\n\t.fi... | 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%rbx\n\t.cfi_def_cfa_offset 16\n\t.cfi_of... | {
"answer": "```assembly\n\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%rbx\n\t.cfi_def_cfa_offset 16\n\t... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <string.h>\n\nint main(void){\n // Your code here!\n char S[1001];\n int w,n;\n scanf(\"%s\",S);\n scanf(\"%d\",&w... | 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.LFB37:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_de... | {
"answer": "```assembly\n\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.LFB37:\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 x86-64 assembly code.\nC Code:\n\n```c\np=100000;main(a){for(scanf(\"%d\",&a);a--;p=(p/1000+!!(p%1000))*1000)p+=p/20;return !printf(\"%d\\n\",p);}```\n\nUnoptimized Assembly Code:\n\n```assembly\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\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\tsubq\t$24, %rsp\n\t.... | {
"answer": "```assembly\n\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.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %r... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main(){\n\tlong long n;\n\tscanf(\"%lld\",&n);\n\tlong long s=1;\n\twhile(n&s)s*=2;\n\tprintf(\"%lld\\n\",s);\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\"%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": "```assembly\n\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$2... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\np,c,t,z,n;main(){for(;~scanf(\"%d,%d\\n\",&p,&c);t+=p*c,z+=c,n++);printf(\"%d\\n%d\\n\",t,lround(1.0*z/n));exit(0);}```\n\nUnoptimized Assembly Code:\n\n```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,%d\\n\"\n.LC1:\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.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r... | {
"answer": "```assembly\n\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\"\n.LC1:\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.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 x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\n\nint main ()\n{\n\tint n,q;\n\tscanf(\"%d %d\",&n,&q);\n\twhile(q--)\n\t{\n\t\tint t1,t2,i;\n\t\tscanf(\"%d %d\",&t1,&t2);\n\t\tif(n==1)\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\"\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.... | {
"answer": "```assembly\n\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%r... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main(void)\n{\n\tint a,b,c,d;\n\tscanf(\"%d %d %d %d\",&a,&b,&c,&d);\n\tif(a==b && c==d || a==d && b==c){\n\t\tprintf(\"yes\\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 %d %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\... | {
"answer": "```assembly\n\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\"\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_sta... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main(){\n int a,b,c,d,sum=0;\n scanf(\"%d %d %d\",&a,&b,&c);\n for(d=a;d<=b;d++){\n if(c%d==0){\n sum++;\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 %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\tsubq\t$40, %r... | {
"answer": "```assembly\n\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\"\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... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\n#define abs(x) ((x) > 0 ? (x) : -(x))\n\nint main(void) {\n long x, k, d;\n scanf(\"%ld %ld %ld\", &x, &k, &d);\n long a = abs(x) / d... | 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 %ld\"\n.LC1:\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.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$40... | {
"answer": "```assembly\n\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 %ld\"\n.LC1:\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.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsu... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main(void) {\n\n\tint A;\n\tint B;\n\n\tscanf(\"%d\", &A);\n\tscanf(\"%d\", &B); \n \n if(A >= 13){\n printf(\"%d\",B);... | 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\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%rbx\n\t.cfi_def... | {
"answer": "```assembly\n\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\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%rbx\n\t.... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main()\n{\n long long int n;\n scanf(\"%lld\",&n);\n printf(\"%lld\",n*n*n);\n return 0;\n}```\n\nUnoptimized Assembly Code... | 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\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%rbx\n\t.cfi_def_cfa_offset 16\n\t.cfi_... | {
"answer": "```assembly\n\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\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%rbx\n\t.cfi_def_cfa_offset 16\n... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\nchar m[8][11]={\n \"***** \",\n \" *****\",\n \"==========\",\n \" **** ****\",\n \"* **** ***\",\n \"** **** **\",\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\"%s\"\n.LC1:\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.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.cfi_def_c... | {
"answer": "```assembly\n\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\"\"\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%r15\n\t.cf... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\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_CARD_MAX\t\t2000... | 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\"\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%d\\n\"\n.LC3:\n\t.string\t\"%s\"\n\t.text\n\t.p2align 4\n\t.globl\tfMain\n\t.type\tfMain, @function\nfMain:\n.LFB53:\n\t.cfi_startproc\n\tendbr6... | {
"answer": "```assembly\n\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\"\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%d\\n\"\n.LC3:\n\t.string\t\"%s\"\n\t.text\n\t.p2align 4\n\t.globl\tfMain\n\t.type\tfMain, @function\nfMain:\n.LFB53:\n\t.cfi_startproc\n\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main(){\n int n,d[5010],i,j;\n scanf(\"%d\",&n);\n for(i=0;i<n;i++)scanf(\"%d\",&d[i]);\n for(i=0;i<n;i++){\n int ans=0,a[5010]=... | 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": "```assembly\n\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\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include<math.h>\ndouble hyo(int x,int h)\n{\n double ans=x*x+x*(sqrt(h*h*4+x*x));\n return ans;\n}\nint main(void)\n{\n int x,h;... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\thyo\n\t.type\thyo, @function\nhyo:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\timull\t%esi, %esi\n\tpxor\t%xmm2, %xmm2\n\tpxor\t%xmm0, %xmm0\n\tmovl\t%edi, %eax\n\timull\t%edi, %eax\n\tpxor\t%xmm3, %xmm3\n\tpxor\t%xmm1, %xmm1\n\tcvtsi2sdl\t%edi, %x... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\thyo\n\t.type\thyo, @function\nhyo:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\timull\t%esi, %esi\n\tpxor\t%xmm2, %xmm2\n\tpxor\t%xmm0, %xmm0\n\tmovl\t%edi, %eax\n\timull\t%edi, %eax\n\tpxor\t%xmm3, %xmm3\n\tpxor\t%xmm1, %xmm1\n\tcvtsi2sdl\t%... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main(void)\n{\n for (;;) {\n int n, p;\n int m[50] = {0}, k;\n int i;\n\n scanf(\"%d %d\", &n, &p);\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\"\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.... | {
"answer": "```assembly\n\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%r... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <time.h>\n#include <math.h>\n#include <limits.h>\n#include <assert.h>\n#define FOR(i,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.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE53:\n\t.size\tcomp, .-comp\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcomp\n\t.type\tcomp, @function\ncomp:\n.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE53:\n\t.size\tcomp, .-comp\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 x86-64 assembly code.\nC Code:\n\n```c\ni,a;main(x){for(x=scanf(\"%d\",&a);a>3;x++)i=a%3?1:0,a/=3,a+=i;printf(\"%d\\n\",x);exit(0);}```\n\nUnoptimized Assembly Code:\n\n```assembly\n\t.file\t\"temp.... | 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.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rax\n\t.cfi_... | {
"answer": "```assembly\n\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.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rax\n... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <stdlib.h>\n\nint max(int a,int b){return(a > b ? a : b);}\nint asc(const void *a, const void *b) {return *(int *)a - *(int *)b;}... | 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.LFB40:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE40:\n\t.size\tasc, .-asc\n\t.p2align 4\n\t.globl\tmax\n\t.type\tmax, @function\nmax:\n.LFB39:\n\t.cf... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tasc\n\t.type\tasc, @function\nasc:\n.LFB40:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE40:\n\t.size\tasc, .-asc\n\t.p2align 4\n\t.globl\tmax\n\t.type\tmax, @function\nmax:\n.LFB39:... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main(void)\n{\n\tint n,x,i,a;\n\tint cnt,flg;\n\tscanf(\"%d\",&n);\n\tcnt=0;\n\tfor(i=0;i<n;i++)\t{\n\t\tflg=0;\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\"\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": "```assembly\n\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\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#define _CRT_SECURE_NO_WARNINGS\n////#define _USE_MATH_DEFINES\n#include<stdio.h>\n//#include<stdlib.h>\n//#include<math.h>\n//#include<string.h>\n//#include<... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tsort\n\t.type\tsort, @function\nsort:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tleaq\td(%rip), %rax\n\tmovl\t$2, %edx\n\t.p2align 4,,10\n\t.p2align 3\n.L20:\n\tmovq\t(%rax), %xmm0\n\tpshufd\t$0xe5, %xmm0, %xmm1\n\tmovd\t%xmm0, %esi\n\tmovd\t%xmm1... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tsort\n\t.type\tsort, @function\nsort:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tleaq\td(%rip), %rax\n\tmovl\t$2, %edx\n\t.p2align 4,,10\n\t.p2align 3\n.L20:\n\tmovq\t(%rax), %xmm0\n\tpshufd\t$0xe5, %xmm0, %xmm1\n\tmovd\t%xmm0, %esi\n\tmovd... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\n#include<string.h>\n#include<stdlib.h>\n#include<math.h>\n\n\nint main(void){\n int max=999999999;\nint a,b,c,d;\nscanf(\"%d %d %d %d\",... | 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\"\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.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$40,... | {
"answer": "```assembly\n\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\"\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.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tsub... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main(int argc, char const *argv[]) {\n long long int N, count=0, i, M;\n scanf(\"%lld\", &N);\n for (i = 1; i*i <= N; 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\"%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": "```assembly\n\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$2... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\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#... | 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.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE53:\n\t.size\tcomp, .-comp\n\t.p2align 4\n\t.globl\tfill\n\t.type\tfill, @function\nfill:\n.LFB54... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcomp\n\t.type\tcomp, @function\ncomp:\n.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE53:\n\t.size\tcomp, .-comp\n\t.p2align 4\n\t.globl\tfill\n\t.type\tfill, @function\nfill:\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h> ... | 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.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rsi), %edx\n\tmovl\t$-1, %eax\n\tcmpl\t%edx, (%rdi)\n\tjl\t.L1\n\tsetne\t%al\n\tmovzbl\t%al, %eax\n.L1:\n\tret\n\t.cfi_endproc\n.LFE53:\n\t.size\tcmp, .-cmp\n\t.... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcmp\n\t.type\tcmp, @function\ncmp:\n.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rsi), %edx\n\tmovl\t$-1, %eax\n\tcmpl\t%edx, (%rdi)\n\tjl\t.L1\n\tsetne\t%al\n\tmovzbl\t%al, %eax\n.L1:\n\tret\n\t.cfi_endproc\n.LFE53:\n\t.size\tcmp, .-c... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\nint main(){\n int n,ans=0,v[20],c;\n scanf(\"%d\",&n);\n for(int i=0;i<n;i++)scanf(\"%d\",&v[i]);\n for(int i=0;i<n;i++){\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\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_of... | {
"answer": "```assembly\n\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%r14\n\t.cfi_def_cfa_offset 16\n\t... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <math.h>\n\nint main()\n{\n int a,b;\n\n scanf(\"%d %d\",&a, &b);\n\n if(b/10 == 0){\n a=a*10;\n }\n else 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 %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": "```assembly\n\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.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... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\n#include<stdlib.h>\n\nint compar(const void *a, const void *b)\n{\n\treturn *(int *)b- *(int *)a;\n}\n\nint main(void)\n{\n\tint i,a[5];\n\... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcompar\n\t.type\tcompar, @function\ncompar:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rsi), %eax\n\tsubl\t(%rdi), %eax\n\tret\n\t.cfi_endproc\n.LFE39:\n\t.size\tcompar, .-compar\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.s... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcompar\n\t.type\tcompar, @function\ncompar:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rsi), %eax\n\tsubl\t(%rdi), %eax\n\tret\n\t.cfi_endproc\n.LFE39:\n\t.size\tcompar, .-compar\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <string.h>\nint main(void){\n\tint n,k;\n\tscanf(\"%d\",&n);\n\tchar S[n+1];\n\tscanf(\"%s\",S);\n\tscanf(\"%d\",&k);\n\tchar moz... | 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\"%s\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB37:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_de... | {
"answer": "```assembly\n\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\"%s\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB37:\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 x86-64 assembly code.\nC Code:\n\n```c\n#include <math.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#define MAX(X, Y) (((X) > (Y)) ? (X) : (Y))\n#define MIN(X, Y) (((X) < (Y)) ?... | 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.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.cfi... | {
"answer": "```assembly\n\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.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\n#include<math.h>\n \nint main(){\n int i,j,n,m,total;\n while(1){\n total=0;\n scanf(\"%d\",&n);\n if(n==0) brea... | 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.LC3:\n\t.string\t\"perfect number\"\n.LC4:\n\t.string\t\"abundant number\"\n.LC5:\n\t.string\t\"deficient number\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.t... | {
"answer": "```assembly\n\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.LC3:\n\t.string\t\"perfect number\"\n.LC4:\n\t.string\t\"abundant number\"\n.LC5:\n\t.string\t\"deficient number\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmai... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main(void)\n{\n int n, h, w, count=0, n1, n2;\n scanf(\"%d%d%d\",&n, &h, &w);\n\n for(int i=0; i<n; i++){\n scanf(\"%d... | 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\"\n.LC1:\n\t.string\t\"%d%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... | {
"answer": "```assembly\n\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\"\n.LC1:\n\t.string\t\"%d%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_star... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main()\n{\n\tint s[4],temp,i,j;\n\tfor(i = 0;i < 3;i++)\n\t\tscanf(\"%d\",&s[i]);\n\tfor(i = 0;i < 2;i++)\n\t{\n\t\tfor(j = 0;j < 2 - 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\"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": "```assembly\n\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\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n// AOJ 2699: Koto Municipal Subway\n// 2017.11.6 bal4u@uu\n\n#include <stdio.h>\n#include <math.h>\n#define TM 0\n#if TM\n#include <time.h>\n#endif\n\n\n\nint... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC2:\n\t.string\t\"%.10lf\\n\"\n.LC3:\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%r15\n... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC2:\n\t.string\t\"%.10lf\\n\"\n.LC3:\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\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main(void)\n{\n int i,stu[31],num;\n for(i=0;i<31;i++) stu[i]=0;\n for(i=0;i<28;i++)\n {\n scanf(\"%d\",&num);\n stu[num]=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%r13\n\t.cfi... | {
"answer": "```assembly\n\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\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\n/* -------- main code -------- */\nint main(void)\n{\n int flag;\n int x, y, z, n;\n double sum;\n\n flag = 0;\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 %lf\"\n.LC1:\n\t.string\t\"-1 -1 -1\"\n.LC2:\n\t.string\t\"%d %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_s... | {
"answer": "```assembly\n\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 %lf\"\n.LC1:\n\t.string\t\"-1 -1 -1\"\n.LC2:\n\t.string\t\"%d %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\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\nint solve(int a, int b, int c) {\n int ta, tb, tc;\n int i = 0;\n while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {\n if(i >... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tsolve\n\t.type\tsolve, @function\nsolve:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t%edi, %ecx\n\tmovl\t%esi, %edi\n\torl\t%edx, %edi\n\torl\t%ecx, %edi\n\tandl\t$1, %edi\n\tje\t.L2\n\tjmp\t.L10\n\t.p2align 4,,10\n\t.p2align 3\n.L4:\n\tcmpl\... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tsolve\n\t.type\tsolve, @function\nsolve:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t%edi, %ecx\n\tmovl\t%esi, %edi\n\torl\t%edx, %edi\n\torl\t%ecx, %edi\n\tandl\t$1, %edi\n\tje\t.L2\n\tjmp\t.L10\n\t.p2align 4,,10\n\t.p2align 3\n.L4:\n... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\nint cmp_s(const void * left, const void * right)\n{\n\tchar *left_char = (char *)left;\n char... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcmp_s\n\t.type\tcmp_s, @function\ncmp_s:\n.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tjmp\tstrcmp@PLT\n\t.cfi_endproc\n.LFE53:\n\t.size\tcmp_s, .-cmp_s\n\t.p2align 4\n\t.globl\tcmp_s2\n\t.type\tcmp_s2, @function\ncmp_s2:\n.LFB54:\n\t.cfi_startproc\n... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tcmp_s\n\t.type\tcmp_s, @function\ncmp_s:\n.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tjmp\tstrcmp@PLT\n\t.cfi_endproc\n.LFE53:\n\t.size\tcmp_s, .-cmp_s\n\t.p2align 4\n\t.globl\tcmp_s2\n\t.type\tcmp_s2, @function\ncmp_s2:\n.LFB54:\n\t.cfi_star... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\nint a[1010];\n\nint main(){\n\tint n;\n\tscanf(\"%d\",&n);\n\tfor(int i=0;i<n;i++){\n\t\tint t;\n\t\tscanf(\"%d\",&t);\n\t\tif(a[t%(n-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 %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.... | {
"answer": "```assembly\n\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\\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%r... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\nint main(){\n int a,b,c;\n int i;\n int count=0;\n scanf(\"%d%d%d\",&a,&b,&c);\n for(i=1;;i++){\n if(i%7==0){\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%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\tsubq\t$40, %rsp... | {
"answer": "```assembly\n\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\"\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$4... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n\n#include <stdio.h>\n\nint main()\n{ int n;\n scanf(\"%d\",&n);\n int arr[100001]={0},i;\n arr[1]=1;\n for(i=2;i<100001;i++){\n arr[i]=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\"\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": "```assembly\n\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\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\nint main(){\n\tint n;\n\tint i,j=0,k=30;\n\tchar az[26];\n\tchar str[1025];\n\tchar queue[60];\n\ts... | 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\"%s\"\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.LFB53:\n\t.cfi_startproc\n\tendbr64\n... | {
"answer": "```assembly\n\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\"%s\"\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.LFB53:\n\t.cfi_startproc\n\ten... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\nint main(){\n int N;\n scanf(\"%d\",&N);\n int a[N];\n for (int i=0;i<N;i++){\n scanf(\"%d\",&a[i]);\n }\n int l ... | 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": "```assembly\n\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\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <ctype.h>\n\nint main(void)\n{\n enum { S = 11 };\n char s1[S], s2[S], s3[S];\n scanf(\"%s %s %s\", s1, s2, s3);\n 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\"%s %s %s\"\n.LC1:\n\t.string\t\"%c%c%c\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB25:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$56... | {
"answer": "```assembly\n\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 %s %s\"\n.LC1:\n\t.string\t\"%c%c%c\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB25:\n\t.cfi_startproc\n\tendbr64\n\tsu... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n// AOJ 3040 U and U\n// 2019.4.2 bal4u\n\n#include <stdio.h>\n\nint main()\n{\n\tlong long N, M;\n\n\tscanf(\"%lld%lld\", &N, &M);\n\tif (N >= (M << 1)) puts(... | 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\"0\"\n.LC2:\n\t.string\t\"1\"\n.LC3:\n\t.string\t\"2\"\n.LC4:\n\t.string\t\"3\"\n.LC5:\n\t.string\t\"4\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.glo... | {
"answer": "```assembly\n\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\"0\"\n.LC2:\n\t.string\t\"1\"\n.LC3:\n\t.string\t\"2\"\n.LC4:\n\t.string\t\"3\"\n.LC5:\n\t.string\t\"4\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <inttypes.h>\n\nint main(void) {\n\tint N;\n\tint i;\n\tint64_t mikakosi = 0;\n\tif (scanf(\"%d\", &N) != 1) return 1;\n\tfor (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\"%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.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r13\n\t.cf... | {
"answer": "```assembly\n\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\"%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.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r13... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint f(int a){\n int i;\n for(i=0;a;i++)a/=2;\n return i;\n}\nint main(){\n int n,i,a=0,d,b[50]={};\n scanf(\"%d\",&n);\n for(i=0;i<n;... | 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\txorl\t%eax, %eax\n\ttestl\t%edi, %edi\n\tje\t.L4\n\t.p2align 4,,10\n\t.p2align 3\n.L3:\n\tmovl\t%edi, %edx\n\taddl\t$1, %eax\n\tshrl\t$31, %edx\n\taddl\t%edx, %edi\n\tsarl\t%e... | {
"answer": "```assembly\n\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\txorl\t%eax, %eax\n\ttestl\t%edi, %edi\n\tje\t.L4\n\t.p2align 4,,10\n\t.p2align 3\n.L3:\n\tmovl\t%edi, %edx\n\taddl\t$1, %eax\n\tshrl\t$31, %edx\n\taddl\t%edx, %edi\n\ts... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main(){\n long long s=0,a,b,n,c=1e18;\n scanf(\"%lld\",&n);\n while(n--){\n scanf(\"%lld %lld\",&a,&b);\n s+=a;\n if(a>b&&c... | 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.LC2:\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_startp... | {
"answer": "```assembly\n\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.LC2:\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... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\nint main(){\n int x,y;\n int ans=0;\n scanf(\"%d %d\",&x,&y);\n if(x==1) ans+=300000;\n else if(x==2) ans+=200000;\n else if(x==3) 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 %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": "```assembly\n\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, %... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\n#include<math.h>\n#include<stdlib.h>\n#include<string.h>\n#define df 0\n\n\nint main(){\n long int S;\n scanf(\"%ld\",&S);\n long int 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\"%ld\"\n.LC2:\n\t.string\t\"%ld %ld %ld %ld %ld %ld\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB53:\n\t.cfi_startproc\n\tendbr64\n\t... | {
"answer": "```assembly\n\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\"\n.LC2:\n\t.string\t\"%ld %ld %ld %ld %ld %ld\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB53:\n\t.cfi_startproc\n\tendb... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main(){\n long long a,b;\n scanf(\"%ld%ld\",&a,&b);\n puts(a-b<=1&&b-a<=1?\"Brown\":\"Alice\");\n}```\n\nUnoptimized Assembly Cod... | 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\"Brown\"\n.LC1:\n\t.string\t\"Alice\"\n.LC2:\n\t.string\t\"%ld%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\... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"Brown\"\n.LC1:\n\t.string\t\"Alice\"\n.LC2:\n\t.string\t\"%ld%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_sta... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main(void)\n{\n\tint N,a4=0,a2=0,a0=0,i;\n\tscanf(\"%d\",&N);\n\tlong int a[N];\n\tfor(i=0;i<N;i++)\n\t{\n\t scanf(\"%ld\",&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\"%d\"\n.LC1:\n\t.string\t\"Yes\"\n.LC2:\n\t.string\t\"%ld\"\n.LC3:\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:\... | {
"answer": "```assembly\n\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\"%ld\"\n.LC3:\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.... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main()\n{\n\tint number,x,y;\n\tscanf(\"%d\",&number); //91\n\tx=number%10; //1\n\ty=number/10; //9\n\tif(x==9 || y==9)\n\t{\n\t\tprint... | 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": "```assembly\n\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\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <math.h>\n#include <string.h>\n\ntypedef long long ll;\n\nint main() {\n\tint n;\n\tscanf(\"%d\", &n);\n\t\n\tll ans = 0;\n\tfor ... | 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.LFB37:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp\n\t.... | {
"answer": "```assembly\n\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.LFB37:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %r... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main()\n{\n int a, b, c;\n\n scanf(\"%d %d %d\", &a, &b, &c);\n\n if (a > b && a > c) {\n puts(\"A\");\n } else 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 %d %d\"\n.LC1:\n\t.string\t\"A\"\n.LC2:\n\t.string\t\"B\"\n.LC3:\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:... | {
"answer": "```assembly\n\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\"\n.LC1:\n\t.string\t\"A\"\n.LC2:\n\t.string\t\"B\"\n.LC3:\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... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main(void)\n{\n char s[100001], *p;\n int mod = 1000000007;\n int dp[13] = {1}, nextdp[13];\n int i, j, k, l, r;\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\"%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\tpushq\t%r13\n\t.cfi... | {
"answer": "```assembly\n\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\tpushq\t%r13\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main()\n{\nchar a[3];\n int i;\n for(i=0;i<3;++i)\n {scanf(\"%c\",&a[i]);}\nif(a[0]=='A' && a[1]=='A' && a[2]=='A') printf(\"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\"%c\"\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\tendbr6... | {
"answer": "```assembly\n\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.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\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nlong long int checks[1000000];\n\nint main() {\n long long int N, res = 0;\n scanf(\"%lld\", &N);\n\n int pos = 0;\n long lo... | 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": "```assembly\n\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$2... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#define MAX 100000\n\nint A[MAX], n;\n\nint partition(int p, int r) {\n int x, i, j, t;\n x = A[r];\n i = p-1;\n for(j=p; j<r; j++) {\... | 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\tA(%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\tmovslq\t%edi, %rax\n\... | {
"answer": "```assembly\n\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\tA(%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\tmovslq\t%edi, ... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint eiler(int n){\n int i,k,x;\n k=0;x=1;\n for(i=2;n!=1;){\n if(n%i==0){\n n/=i;\n if(k==0){\n ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\teiler\n\t.type\teiler, @function\neiler:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tcmpl\t$1, %edi\n\tje\t.L8\n\ttestb\t$1, %dil\n\tje\t.L14\n\tmovl\t$1, %esi\n\tmovl\t$2, %ecx\n\t.p2align 4,,10\n\t.p2align 3\n.L6:\n\tmovl\t%edi, %eax\n\taddl\t$1,... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\teiler\n\t.type\teiler, @function\neiler:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tcmpl\t$1, %edi\n\tje\t.L8\n\ttestb\t$1, %dil\n\tje\t.L14\n\tmovl\t$1, %esi\n\tmovl\t$2, %ecx\n\t.p2align 4,,10\n\t.p2align 3\n.L6:\n\tmovl\t%edi, %eax\n\tad... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n// AOJ 2476: Strange Currency System\n// 2018.3.5 bal4u\n\n#include <stdio.h>\n#include <stdlib.h>\n\n//#define getchar_unlocked() getchar()\nint in()\n{\n\t... | 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\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE40:\n\t.size\tcmp, .-cmp\n\t.p2align 4\n\t.globl\tin\n\t.type\tin, @function\nin:\n.LFB39:\n\t.cfi_s... | {
"answer": "```assembly\n\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\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE40:\n\t.size\tcmp, .-cmp\n\t.p2align 4\n\t.globl\tin\n\t.type\tin, @function\nin:\n.LFB39:\n\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\nint main(void){\n long long n,ans=0;\n scanf(\"%lld\",&n);\n long long a[n+1];\n a[n]=0;\n for (long long i=0; i<n; 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\"%lld\"\n.LC1:\n\t.string\t\"0\"\n.LC2:\n\t.string\t\"-1\"\n.LC3:\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.LFB... | {
"answer": "```assembly\n\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\"0\"\n.LC2:\n\t.string\t\"-1\"\n.LC3:\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... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main(){\n int n,d[300010],a,i;\n scanf(\"%d\",&n);\n for(i=0;i<n;i++){\n scanf(\"%d\",&a);\n if(i%2==0)d[(n+i+1-n%2)/2]=a;//,p... | 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%r12\n\t.cfi_def_cfa_offset 16\n\t.cfi_of... | {
"answer": "```assembly\n\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%r12\n\t.cfi_def_cfa_offset 16\n\t... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main()\n{\n\tlong long n,m;\n\tscanf(\"%lld %lld\",&n,&m);\n long long t=m/2;\n if(n>=t)\n printf(\"%lld\\n\",t);//t为c一半,s比c的一... | 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.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$40,... | {
"answer": "```assembly\n\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.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsub... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <string.h>\n\nint main(void){\n\tchar a[11], b[11], c[11];\t\t//a,b,cは10文字以下\n\n\tint a_len, b_len;\n\n\tscanf(\"%s %s %s\", a, b... | 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 %s %s\"\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.LFB37:\n\t.cfi_startproc\n\t... | {
"answer": "```assembly\n\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 %s %s\"\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.LFB37:\n\t.cfi_startp... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <stdlib.h>\nint main(void){\n int n,i,sum=0,min=101;\n scanf(\"%d\",&n);\n int a[n];\n for(i=0;i<n;i++){\n sca... | 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.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_of... | {
"answer": "```assembly\n\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.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\nint min(int a,int b){return a<b?a:b;}\nint main(void){\n int n,ans=0,a[120]={};\n scanf(\"%d\",&n);\n for (int i=1; i<=n; i++){\n... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tmin\n\t.type\tmin, @function\nmin:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tcmpl\t%edi, %esi\n\tmovl\t%edi, %eax\n\tcmovle\t%esi, %eax\n\tret\n\t.cfi_endproc\n.LFE23:\n\t.size\tmin, .-min\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tmin\n\t.type\tmin, @function\nmin:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tcmpl\t%edi, %esi\n\tmovl\t%edi, %eax\n\tcmovle\t%esi, %eax\n\tret\n\t.cfi_endproc\n.LFE23:\n\t.size\tmin, .-min\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <stdlib.h>\n#include <math.h>\n#include <string.h>\n#define ll long long\n#define rep(i,l,r) for(ll i=(l);i<(r);i++)\n#define max... | 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.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi_def_cfa_offset 16\n\t.cfi_of... | {
"answer": "```assembly\n\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.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi_def_cfa_offset 16\n\t... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint max(int a,int b){\n\tif(a>b) return a;\n\treturn b;\n}\nint main(void){\n\tchar s[100100]={0};\n\tint k;\n\tint i;\n\tint n;\n\tint ok=... | 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.LFB23:\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.LFE23:\n\t.size\tmax, .-max\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tmax\n\t.type\tmax, @function\nmax:\n.LFB23:\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.LFE23:\n\t.size\tmax, .-max\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main(){\n\n\tint A,B;\n\n\tscanf(\"%d %d\",&A,&B);\n\n\tprintf(\"%d\\n\",(A*B)-(A+B-1));\n\nreturn 0;\n}```\n\nUnoptimized Assembly ... | 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\tsubq\t$24, %rsp\... | {
"answer": "```assembly\n\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\tsubq\t$24... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include<math.h>\nint main(void){\n \n int a,b;\n scanf(\"%d %d\",&a,&b);\n printf(\"%d\\n\",(a+b)/2);\n \n \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\"\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": "```assembly\n\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\tsubq\t$24... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <string.h>\n\nint main(void)\n{\n\tchar ans[1000];\n\tchar str[1000];\n\tint len, x, y, z;\n\t\n\twhile (scanf(\"%s\", str) != EO... | 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\"%s\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB37:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r13\n\t.cfi_def_cfa_offset 16\n\t.cfi_of... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC1:\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.LFB37:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r13\n\t.cfi_def_cfa_offset 16\n\t... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\n\nint main(void) {\n\tint a, b, N, s, f, i;\n\tscanf(\"%d %d\", &a, &b);\n\tscanf(\"%d\", &N);\n\tfor (i = 0; i < N; i++) {\n\t\tscanf(\"%d... | 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\"1\"\n.LC3:\n\t.string\t\"0\"\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... | {
"answer": "```assembly\n\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\"1\"\n.LC3:\n\t.string\t\"0\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.L... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint gcd(int x,int y){\n \tint r;\n\twhile ((r = x % y) != 0) {\n\t\tx = y;\n\t\ty = r;\n\t}\n\treturn y;\n}\nint main(){\n int n;\n scan... | 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.LFB23:\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": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tgcd\n\t.type\tgcd, @function\ngcd:\n.LFB23:\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\t... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <stdlib.h>\n\nint main(void)\n{\n\tint n, k;\n\tscanf(\"%d %d\",&n, &k);\n\tint *h;\n\th = (int *)malloc(sizeof(int)*(n));\n\tint... | 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.LFB39:\n\t.cfi_startproc\n\te... | {
"answer": "```assembly\n\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.LFB39:\n\t.cfi_startpr... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n\nint main(void)\n{\n int i,N,color,max=0,min=0,sum=0;\n int kind[9]={};\n\n scanf(\"%d\",&N);\n for(i=0;i<N;i++){\n sc... | 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\\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.... | {
"answer": "```assembly\n\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\\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%r... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\nint main()\n{\n int y, m, d;\n char s[20];\n char *g;\n \n while (1) {\n fgets(s, size... | 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.LC1:\n\t.string\t\"HEISEI %d %d %d\\n\"\n.LC2:\n\t.string\t\"? %d %d %d\\n\"\n.LC3:\n\t.string\t\"? 1 %d %d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type... | {
"answer": "```assembly\n\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.LC1:\n\t.string\t\"HEISEI %d %d %d\\n\"\n.LC2:\n\t.string\t\"? %d %d %d\\n\"\n.LC3:\n\t.string\t\"? 1 %d %d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint Nibusearch(int A[],int n,int key){\n int i=0,left=0,right=n,mid;\n while(left < right){\n mid = (left + right) / 2;\n if( A[mid... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tNibusearch\n\t.type\tNibusearch, @function\nNibusearch:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\txorl\t%r8d, %r8d\n\tjmp\t.L4\n\t.p2align 4,,10\n\t.p2align 3\n.L5:\n\tleal\t(%r8,%rsi), %ecx\n\tmovl\t%ecx, %eax\n\tshrl\t$31, %eax\n\taddl\t%ecx, %... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tNibusearch\n\t.type\tNibusearch, @function\nNibusearch:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\txorl\t%r8d, %r8d\n\tjmp\t.L4\n\t.p2align 4,,10\n\t.p2align 3\n.L5:\n\tleal\t(%r8,%rsi), %ecx\n\tmovl\t%ecx, %eax\n\tshrl\t$31, %eax\n\taddl\t... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n char a[10];\n char b[10];\n scanf(\"%s%s\",a,b);\n\n if(a[0]==b[2]&&a[1]==b[1]&&a[2]==b... | 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%s\"\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.LFB39:\n\t.cfi_startproc\n\tendb... | {
"answer": "```assembly\n\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%s\"\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.LFB39:\n\t.cfi_startproc\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\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; ... | 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": "```assembly\n\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\... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n\n#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf(\"not enough memory\\n\");exit(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\"not enough memory\"\n.LC2:\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.LFB53:\n\t.cfi_start... | {
"answer": "```assembly\n\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\"not enough memory\"\n.LC2:\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.LFB53:\n\t.cf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.