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\nmain(a,b,c,d){scanf(\"%d%d%d%d\",&a,&b,&c,&d);puts(a&b&(c^d)&1?\"No\":\"Yes\");}\n```\n\nUnoptimized Assembly Code:\n\n```assembly\n\t.file\t\"temp.c\"\n\t.te... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"No\"\n.LC1:\n\t.string\t\"Yes\"\n.LC2:\n\t.string\t\"%d%d%d%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\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\"No\"\n.LC1:\n\t.string\t\"Yes\"\n.LC2:\n\t.string\t\"%d%d%d%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_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#include <math.h>\nint main(void) {\n int a,p,n,P;\n scanf(\"%d %d\",&a,&p);\n n=(a*3)+p;\n P=n/2;\n printf(\"%d\",P);\n \n return ... | 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\nint main(){\n\tint i,g,j,k;\n\tchar s[100001];\n\tscanf(\"%s\",s);\n\tfor(g=0;s[g]!=0;g++);\n\tfor(i=0;i<g-1;i++){\n\t\tif(s[i]==s[i+1]){... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"%d %d\\n\"\n.LC2:\n\t.string\t\"-1 -1\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n... | {
"answer": "```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 %d\\n\"\n.LC2:\n\t.string\t\"-1 -1\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_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>\n\n#define ll long long\n\nint main(int argc, char *argv[]) {\n\tint N;\n\tscanf(\"%d\", &N);\n\tint A[81];\n\tfor (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\"%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\tpushq\t%r13\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\"\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\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#include <math.h>\n\n#define PI 3.141592653589793\n\nint main(void)\n{\n int a, b, degC;\n double c;\n double S, L, h;\n doub... | 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.LC5:\n\t.string\t\"%lf\\n%lf\\n%lf\\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\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 %d\"\n.LC5:\n\t.string\t\"%lf\\n%lf\\n%lf\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendb... |
train | [
{
"content": "Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.\nC Code:\n\n```c\n#include<stdio.h>\nint main()\n{\n int a,b,sub,mul,add;\n scanf(\"%d %d\",&a,&b);\n add=a+b;mul=a*b;sub=a-b;\n if(add>mul&&add>sub)\n {\n ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d %d\"\n.LC1:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp\n\t... | {
"answer": "```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 <string.h>\n\nint main(void)\n{\n char day[4];\n char week[7][4] = {\"SAT\",\"FRI\",\"THU\",\"WED\",\"TUE\",\"MON\",\"SUN\",};\... | 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\"%s\"\n.LC3:\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.LC2:\n\t.string\t\"%s\"\n.LC3:\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\n#include <stdio.h>\n#include <stdlib.h>\n#include <math.h>\n\nint main(void)\n{\n int h1,h2,m1,m2,k;\n\n scanf(\"%d %d %d %d %d\",&h1,&m1,&h2,&m2,&k);\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 %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\tsubq\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 %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.LFB39:\n\t.cfi_startproc\n\tendbr64\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(){\n int H,i,j,k,l,A[250],left = 0,right = 0,parent = 0;\n \n scanf(\"%d\",&H);\n \n for(i = 1;i <= H ;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.LC1:\n\t.string\t\"node %d: key = %d, \"\n.LC2:\n\t.string\t\"parent key = %d, \"\n.LC3:\n\t.string\t\"left key = %d, \"\n.LC4:\n\t.string\t\"right key = %d, \"\n\t.section\t.text.startup,\"ax\"... | {
"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\"node %d: key = %d, \"\n.LC2:\n\t.string\t\"parent key = %d, \"\n.LC3:\n\t.string\t\"left key = %d, \"\n.LC4:\n\t.string\t\"right key = %d, \"\n\t.section\t.text.startup... |
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 BUF_SIZE 1500000\n#define min(a, b) ((a) < (b) ? (a) : (b))\n\nint main(void) {\n cha... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\" \"\n.LC2:\n\t.string\t\"%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.LFB53:\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\"%d\"\n.LC1:\n\t.string\t\" \"\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.LFB53:\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\nmain(f,w){for(;~scanf(\"%[^ ,.]%*[ ,.]\",w);)-~strlen(w)/4-1||(f=!printf(\" %s\"+f,w));exit(!puts(\"\"));}```\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\" %s\"\n.LC1:\n\t.string\t\"%[^ ,.]%*[ ,.]\"\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.LFB0:\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\" %s\"\n.LC1:\n\t.string\t\"%[^ ,.]%*[ ,.]\"\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.LFB0:\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\nint main(){\n int a,b;\n scanf(\"%d%d\",&a,&b);\n puts(a*b%2 ? \"Odd\" : \"Even\");\n return 0;\n}```\n\nUnoptimized Assembly Code:\n\n```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\"Odd\"\n.LC1:\n\t.string\t\"Even\"\n.LC2:\n\t.string\t\"%d%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tend... | {
"answer": "```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\"Odd\"\n.LC1:\n\t.string\t\"Even\"\n.LC2:\n\t.string\t\"%d%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc... |
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 int n, m;\n int p[1000];\n int i, j;\n int t;\n int sum;\n \n while (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.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.LFB37:\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%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.LFB37:\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>\n#include <stdlib.h>\n\nint main()\n{\n\tint i, N, p[100001];\n\tscanf(\"%d\", &N);\n\tfor (i = 1; i <= N; i++) scanf(\"%d\", &(p[i]));\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\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi... | {
"answer": "```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%r12\... |
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 c=700;\nchar a[3];\nscanf (\"%s\",a);\n for (int i=0;i<3;i++){\n if (a[i]=='o'){\n c=c+100;\n }\n }\n printf (\"%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\"%s\"\n.LC1:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp\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\"%s\"\n.LC1:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp... |
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 int i, sum=0, N;\n scanf(\"%ld\", &N);\n for(i=1; i<=N; i++){\n if(i%3!=0 && i%5!=0){\n s... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%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$24, %rsp\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\"%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$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\nint main(){\n int N,M;\n scanf(\"%d %d\", &N, &M);\n int a[100]={0},b[100]={0};\n int i,k;\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 %d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\n\t.... | {
"answer": "```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\nfloat a,b,c,d,p=57.296;main(){for(;~scanf(\"%f%f%f%f\",&a,&b,&c,&d);)a+1&&printf(\"%.f\\n\",6378.1*acos(sin(a/p)*sin(c/=p)+cos(a/p)*cos(c)*cos(b/p-d/p)));}```... | 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\"%.f\\n\"\n.LC4:\n\t.string\t\"%f%f%f%f\"\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... | {
"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\"%.f\\n\"\n.LC4:\n\t.string\t\"%f%f%f%f\"\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>\nint main(){\n\tint s=0,n,k,a,b,i,j,m[101],x,y;\n\tscanf(\"%d%d%d%d\",&n,&a,&b,&k);\n\tfor(i=0;i<n;i++)scanf(\"%d\",&m[i]);\n\tfor(i=0;i<n;i... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d%d%d%d\"\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n... | {
"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.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(void) {\n long long int n1, n2, i, gcd, lcm;\n //printf(\"Enter two positive integers: \");\n scanf(\"%lld %lld\", &n1, ... | 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\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... | {
"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\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>\n\nint main(){\n\tint a ,b,c;\n\tscanf(\"%d %d %d\",&a,&b,&c);\n\tif(a > b ){\n\t\tif(a < c){\n\t\tprintf(\"C\\n\");\n\t\t}\n\t\telse {\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 %d\"\n.LC1:\n\t.string\t\"C\"\n.LC2:\n\t.string\t\"A\"\n.LC3:\n\t.string\t\"B\"\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\"C\"\n.LC2:\n\t.string\t\"A\"\n.LC3:\n\t.string\t\"B\"\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 divide_ffb(int a[],int l,int key);\n\nint main()\n{\n int n,i,a,b[100000],l,pos;\n while(~scanf(\"%d\",&n))\n {\n if(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\"0\"\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr... | {
"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\"0\"\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n... |
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\nvoid doit(int n){\n\tif(n>0){\n\t\tint m;\n\t\tint i;\n\t\tint b;\n\t\tint bt;\n\t\tint up=0;\n\t\tint dw=0;\n\t\tscanf(\"%d\",&m);\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 %d\\n\"\n\t.text\n\t.p2align 4\n\t.type\tdoit.part.0, @function\ndoit.part.0:\n.LFB25:\n\t.cfi_startproc\n\tpushq\t%r15\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 15, -16\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.text\n\t.p2align 4\n\t.type\tdoit.part.0, @function\ndoit.part.0:\n.LFB25:\n\t.cfi_startproc\n\tpushq\t%r15\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 15, ... |
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 a, b;\n scanf(\"%d\", &a); scanf(\"%d\", &b);\n printf(\"%d %d\\n\", a * b, 2 * (a + b));\n return 0;\... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%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%rbx\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 top = 0, S[1000];\n\nvoid push(int x) {\n S[++top] = x;\n}\n\nint pop(void) {\n top--;\n... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tpush\n\t.type\tpush, @function\npush:\n.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tmovl\ttop(%rip), %eax\n\tleaq\tS(%rip), %rdx\n\taddl\t$1, %eax\n\tmovl\t%eax, top(%rip)\n\tcltq\n\tmovl\t%edi, (%rdx,%rax,4)\n\tret\n\t.cfi_endproc\n.LFE53:\n\t.size\... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tpush\n\t.type\tpush, @function\npush:\n.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tmovl\ttop(%rip), %eax\n\tleaq\tS(%rip), %rdx\n\taddl\t$1, %eax\n\tmovl\t%eax, top(%rip)\n\tcltq\n\tmovl\t%edi, (%rdx,%rax,4)\n\tret\n\t.cfi_endproc\n.LFE53:\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\nc(char*a,char*b){return *a-*b;}r(char*a,char*b){return *b-*a;}s[2][30];n;main(m){scanf(\"%s%s\",s,s[1]);n=strlen(s);m=strlen(s[1]);qsort(s,n,1,c);qsort(s[1],m... | 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\tmovsbl\t(%rdi), %eax\n\tmovsbl\t(%rsi), %edx\n\tsubl\t%edx, %eax\n\tret\n\t.cfi_endproc\n.LFE0:\n\t.size\tc, .-c\n\t.p2align 4\n\t.globl\tr\n\t.type\tr, @function\nr:\n.LFB1:\n... | {
"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\tmovsbl\t(%rdi), %eax\n\tmovsbl\t(%rsi), %edx\n\tsubl\t%edx, %eax\n\tret\n\t.cfi_endproc\n.LFE0:\n\t.size\tc, .-c\n\t.p2align 4\n\t.globl\tr\n\t.type\tr, @function\nr:\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 int time,sum=0,i;\n\n for(i = 0; i < 4; i++){\n \n scanf(\"%d\",&time);\n\n sum += time;\n\n }\n\n printf(\"%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%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\... | {
"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%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... |
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 TSUBO 3.305785\n\nint main(void){\n int a, b;\n double s;\n\n scanf(\"%d%d\", &a, &b);\n s = a * b / TSUBO;\n printf(\"%f\"... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d%d\"\n.LC2:\n\t.string\t\"%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\"%d%d\"\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, %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// AOJ 3065 How old are you\n// 2019.9.30 bal4u\n\n#include <stdio.h>\n\ntypedef long long ll;\n\nint main()\n{\n\tint N, q, x;\n\tll A, B;\n\n\tA = 0, B = 1;... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d%d\"\n.LC2:\n\t.string\t\"%lld %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_startpro... | {
"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\"%lld %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_s... |
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(void) {\n char data[100];\n int num;\n int i,len;\n num = 0;\n while(1... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%s\"\n.LC1:\n\t.string\t\"%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\"%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.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\nint solve() {\n int N, a[50], x[100], y[100], max_i=0;\n scanf(\"%d\", &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\"\n.LC1:\n\t.string\t\"%d\\n\"\n.LC2:\n\t.string\t\"%d %d\\n\"\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\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.LC2:\n\t.string\t\"%d %d\\n\"\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\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 <math.h>\n\nint main(void){\n\tint N,i,a;\n\ta=(int)pow(10,9)+7;\n\tscanf(\"%d\",&N);\n\tlong long int I=10,... | 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.LFB39:\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.LFB39:\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 \nmain(){\n int a;\n int i;\n int b = 0;\n int c = 1;\n int n;\n \n scanf(\"%d\",&n); \n for(i = 0;i <= n;i++){ \n 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\"%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\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.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 \nint max(int a,int b)\n\n{\n\tif(!b)\n\t{\n\t\treturn a;\n\t}\n\treturn max(b,a%b);\n}\nint main()\n{\n\tint m,n,temp;\n while ... | 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\tmovl\t%edi, %eax\n\ttestl\t%esi, %esi\n\tjne\t.L2\n\tjmp\t.L10\n\t.p2align 4,,10\n\t.p2align 3\n.L11:\n\tmovl\t%edx, %esi\n.L2:\n\tcltd\n\tidivl\t%esi\n\tmovl\t%esi, %ea... | {
"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\tmovl\t%edi, %eax\n\ttestl\t%esi, %esi\n\tjne\t.L2\n\tjmp\t.L10\n\t.p2align 4,,10\n\t.p2align 3\n.L11:\n\tmovl\t%edx, %esi\n.L2:\n\tcltd\n\tidivl\t%esi\n\tmovl\t%e... |
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\nint t[1112];\nmain(x,y,z,m){\n for(;x<1112;x++)t[x]=x*x*x;\n while(scanf(\"%d\",&z),z){\n for(m=x=1;x<z;x++){\n for(y=1;y<z;y++)\n if(t[x]+t[... | 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\"%d\\n\"\n.LC3:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\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.LC2:\n\t.string\t\"%d\\n\"\n.LC3:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r14\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 comp(const int *a,const int *b){\n\treturn *a - *b;\n}\n\nint main(){\n\tint N;\n\tscanf(\"%d\",&N);\n\tint A[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.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE39:\n\t.size\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.LFB39:\n\t.cfi_startproc\n\tendbr64\n\tmovl\t(%rdi), %eax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE39:\n\t.size\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\n// AOJ 1587: Plants\n// 2017.10.23 bal4u@uu\n\n#include <stdio.h>\n#include <string.h>\n\nint hi[51][51];\n\nint main() \n{\n\tint w, h, t, p, x, y, v, ans;\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\"%d%d%d\"\n.LC2:\n\t.string\t\"%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... | {
"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%d%d\"\n.LC2:\n\t.string\t\"%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, @functio... |
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>\nint acs(const void *a, const void *b) { \n return *(int*)a - *(int*)b;\n} /*... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tacs\n\t.type\tacs, @function\nacs:\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\tacs, .-acs\n\t.p2align 4\n\t.globl\tdes\n\t.type\tdes, @function\ndes:\n.LFB54:\n\t.cf... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tacs\n\t.type\tacs, @function\nacs:\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\tacs, .-acs\n\t.p2align 4\n\t.globl\tdes\n\t.type\tdes, @function\ndes:\n.LFB54:... |
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(void)\n{\n int i, result = 0;\n char s[200005], t[200005];\n \n scanf(\"%s\", s);\n scanf(\"%s\", t);\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%r12\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%r12\... |
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 n,a,b;\n\tchar s[100000];\n\tscanf(\"%d %d %d\",&n,&a,&b);\n\tscanf(\"%s\",s);\n\tint i,cnt=0,cntb=0;\n\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 %d %d\"\n.LC1:\n\t.string\t\"%s\"\n.LC2:\n\t.string\t\"No\"\n.LC3:\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.LF... | {
"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\"%s\"\n.LC2:\n\t.string\t\"No\"\n.LC3:\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\nmai... |
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>\nlong long p[1000],q[1000];\nmain()\n{\n\tlong long n,h,w,i,j,s=0,a,b;\n\tscanf(\"%lld %lld %lld\",&n,&h,&w);\n\tfor(i=0;i<n;i++)\n\t{\n\t\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\"%lld %lld %lld\"\n.LC1:\n\t.string\t\"%lld %lld\"\n.LC2:\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... | {
"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 %lld\"\n.LC1:\n\t.string\t\"%lld %lld\"\n.LC2:\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:\... |
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// abc053d: Card Eater\n#include <stdio.h>\n\n#define upto(i,s,e,d) for(int i=(s);i<=(e);i+=(d))\n#define in(n) scanf(\"%d\",n)\n#define out(d) printf(\"%d\\n... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%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 main(){\n\tint a,b;\n\tscanf(\"%d%d\",&a,&b);\n\tlong long x=0,y=0;\n\tfor(int i=0;i<a;i++){\n\t\tint t;\n\t\tscanf(\"%d\",&t);\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\"%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\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.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... |
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 W, H, C, w, h, r;\n scanf(\"%d %d %d\", &W, &H, &C);\n w = W; h = H;\n if ( H > W ) {\n r = W;\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\nmain(p,q,l){for(;~scanf(\"%d%d\",&p,&q);){int r[1000000]={l=1};for(;!r[p%=q];putchar(p/q+48))r[p]=l++,p*=10;puts(\"\");if(p)for(;l;)putchar(--l?--r[p]>0?32:94... | 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\"%d%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\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\"\"\n.LC1:\n\t.string\t\"%d%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r15\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(void)\n{\n double a, b, x;\n scanf(\"%lf %lf %lf\", &a, &b, &x);\n \tif (x/a/a > b/2){\n\t double... | 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\"%lf %lf %lf\"\n.LC4:\n\t.string\t\"%.12lf\"\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\"%lf %lf %lf\"\n.LC4:\n\t.string\t\"%.12lf\"\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\nh[8],j;float v;main(i){for(;~scanf(\"%f\",&v);j=1)i=v/5-30,h[i<2?2:i>7?7:i]+=j;for(;h[j]--||6/j&&printf(\"%d:\",j++);)putchar(h[j]?42:10);}```\n\nUnoptimized ... | 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\"%f\"\n.LC3:\n\t.string\t\"%d:\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\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.LC2:\n\t.string\t\"%f\"\n.LC3:\n\t.string\t\"%d:\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\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>\n\nint main(void){\n char c[100];\n scanf(\"%s\", c);\n scanf(\"%s\", c);\n printf(\"A%cC\\n\", c[0]);\n}```\n\nUnoptimized Ass... | 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\"A%cC\\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.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\"A%cC\\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%rb... |
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\nlong a=2,b=1,c=1;main(n){for(scanf(\"%d\",&n);--n;a=b,b=c)c=a+b;printf(\"%ld\",c);}```\n\nUnoptimized Assembly Code:\n\n```assembly\n\t.file\t\"temp.c\"\n\t.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\"%ld\"\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.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\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... |
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 H,W,N;\n \tint n=0,count=0; //nは塗った数,countは塗った回数\n \n \tscanf(\"%d\", &H);\n \tscanf(\"%d\", &W);\n \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\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 <stdlib.h>\n\nint main()\n{\n int *a, *c;\n int i, n, k, tail, minlen, nzero;\n scanf(\"%d %d\", &n, &k);\n a = (int*)malloc(... | 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\"%u\"\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\"%u\"\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#include <string.h>\nint main(void)\n{\n int w,a,b;\n int dist;\n scanf(\"%d %d %d\", &w,&a,&b);\n if(b-w>a){\n dist=b-a-w;\n } el... | 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.LFB37:\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.LFB37:\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>\nint main()\n{\n\tint n,i,x=0,m=0;\n\tchar s[1000];\n\tscanf(\"%d\",&n);\n\tscanf(\"%s\",s);\n\tfor(i=0;i<n;i++)\n\t{\n\t\tif(s[i]=='I')\n\t... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%s\"\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\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\"%d\"\n.LC1:\n\t.string\t\"%s\"\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\... |
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 AOJ #3017\n title:\n @kankichi573\n 2017/12/26 WA 22/26\n*/\n#include <stdio.h>\n#define max(x,y) (((x)>(y))?(x):(y))\nint n,x,p,r,c,f,max_;\n\nint m... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r12\n\t.cfi... | {
"answer": "```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%r12\... |
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#define FOR(n) for(int i=0;i<n;i++)\n#define FORJ(n) for(int j=0;j<n;j++)\n#defin... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tu\n\t.type\tu, @function\nu:\n.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tmovq\t(%rdi), %rax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE53:\n\t.size\tu, .-u\n\t.p2align 4\n\t.globl\td\n\t.type\td, @function\nd:\n.LFB54:\n\t.cfi_startproc\n\te... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tu\n\t.type\tu, @function\nu:\n.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tmovq\t(%rdi), %rax\n\tsubl\t(%rsi), %eax\n\tret\n\t.cfi_endproc\n.LFE53:\n\t.size\tu, .-u\n\t.p2align 4\n\t.globl\td\n\t.type\td, @function\nd:\n.LFB54:\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#include<stdlib.h>\n#include<string.h>\n#include<stdbool.h>\n#include<math.h>\n#include<limits.h>\nint main(){\n int X,N;\n (void)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 %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.LFB53:\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 %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.LFB53:\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\nint main(void){\n\n\tint word[26];\t\t\t\t/* ????????????26??§????????´??°?????????????????????????????¨?????? */\n\tchar x;\n\n\tfor(x=... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%c : %d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r13\n\t.cfi_def_cfa_offset 16\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\"%c : %d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r13\n\t.cfi_def_cfa_offse... |
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 s[9];main(c,n,x){for(scanf(\"%d\",&n),c=0;n--&&c>=0;)scanf(\"%s%d\",s,&x),c+=*s=='('?x:-x;puts(c?\"NO\":\"YES\");exit(0);}```\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\"NO\"\n.LC1:\n\t.string\t\"YES\"\n.LC2:\n\t.string\t\"%d\"\n.LC3:\n\t.string\t\"%s%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\... | {
"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\"NO\"\n.LC1:\n\t.string\t\"YES\"\n.LC2:\n\t.string\t\"%d\"\n.LC3:\n\t.string\t\"%s%d\"\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\n\n#include<stdio.h>\nint main()\n{\n int N;\n scanf(\"%d\", &N);\n float A[N];\n\tfloat B[N];\n float ans = 0;\n\n \n float sum = 0;\n int i= 0;\n ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC1:\n\t.string\t\"%d\"\n.LC2:\n\t.string\t\"%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\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.LC1:\n\t.string\t\"%d\"\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\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\nchar ch[][3]={\"RG\",\"BY\"};i,j,n,m;main(k){for(scanf(\"%d%d%d\",&n,&m,&k);n/++i;puts(\"\"))for(j=0;m/++j;)putchar(ch[(i+j+m)/k%2][(i-j+m)/k%2]);}```\n\nUnop... | 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\"\"\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%rbp\n\t.cfi_d... | {
"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\"\"\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%rbp\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 <string.h>\n#include <stdlib.h>\n#include <math.h>\n\nint main(void)\n{\n int n,i,sum=1;\n char s[200001][11];\n \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\"\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.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r14\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.LFB53:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%r14\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(){\n int N;\n long long A[110000];\n long long ans=0;\n\n scanf(\"%d\", &N);\n for(int i=0; i<N; i++){\n s... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\n.LC1:\n\t.string\t\"%lld\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\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\"%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%r13\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>\nint main()\n{\n long long int n, k;\n scanf(\"%lld %lld\", &n, &k);\n \n long long int mo, kk;\n mo = n%k;\n kk... | 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.LC2:\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.LFB39:\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\"%lld %lld\"\n.LC2:\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.LFB39:\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// AOJ 3127 Gag\n// 2020.1.14 bal4u\n\n#include <stdio.h>\n\ntypedef long long ll;\n\n#define gc() getchar_unlocked()\n\nint in() { // 非負整数の入力\n\tint n = 0,... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tin\n\t.type\tin, @function\nin:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tmovq\tstdin(%rip), %rdi\n\tpushq\t%rbx\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 3, -16\n\tmovq\t8(%rdi), %rax\n\tmovq\t16(%rdi), %rcx\n\tcmpq\t%rcx, %rax\n\tjnb\t.L11\n\tle... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tin\n\t.type\tin, @function\nin:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tmovq\tstdin(%rip), %rdi\n\tpushq\t%rbx\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 3, -16\n\tmovq\t8(%rdi), %rax\n\tmovq\t16(%rdi), %rcx\n\tcmpq\t%rcx, %rax\n\tjnb\t.L1... |
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\nm,e,j,s;main(n){for(;--n||scanf(\"%d\",&n)*n;puts(m>99|e>99|j>99|m+e>179|s>239?\"A\":s<210&&s<150|m<80&e<80?\"C\":\"B\"))scanf(\"%d%d%d\",&m,&e,&j),s=m+e+j;}`... | 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\"B\"\n.LC1:\n\t.string\t\"A\"\n.LC2:\n\t.string\t\"C\"\n.LC3:\n\t.string\t\"%d%d%d\"\n.LC4:\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, @... | {
"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\"B\"\n.LC1:\n\t.string\t\"A\"\n.LC2:\n\t.string\t\"C\"\n.LC3:\n\t.string\t\"%d%d%d\"\n.LC4:\n\t.string\t\"%d\"\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\tint i;\n\n\ti = 'A' - 'a';\n\t\n\tint N;\n\n\tscanf(\"%d\", &N);\n\n\tint K;\n\n\tscanf(\"%d\", &K);\n\n\tchar S[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\"%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%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.LFB23:\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 <stdio.h>\n\nint main(void) {\n\tint a,b,ab,o;\n\tint dummy;\n\tchar type[10];\n\ta=b=ab=o=0;\n\twhile(1) {\n\t\tif(scanf(\"%d,%s\",&dummy,type)==-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,%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%r15\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,%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%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 n;\n\twhile (scanf(\"%d\", &n), n){\n\t\tint magic[16][16] = {0};\n\t\tint hn = n / 2;\n\t\tint x, y;\n\t\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\"%4d\"\n.LC1:\n\t.string\t\"\"\n.LC2:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\... | {
"answer": "```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\"%4d\"\n.LC1:\n\t.string\t\"\"\n.LC2:\n\t.string\t\"%d\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\te... |
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 MIN(x,y) (((x) > (y)) ? (y) : (x))\n#define ABS(x) ((x) >= 0 ? (x) : (-(x)))\n\nlong long sum_f[200010];\nint P = 1000000007;\nint... | 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\"%lld\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24, %rsp\n... | {
"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\"%lld\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\tsubq\t$24,... |
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 2963 Is Greedy Optimal\n// 2019.8.10 bal4u\n\n#include <stdio.h>\n\ntypedef long long ll;\n\nint main()\n{\n\tint A, B, c;\n\tscanf(\"%d%d\", &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\"%d%d\"\n.LC1:\n\t.string\t\"-1\"\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_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\"-1\"\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... |
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(){int x;scanf(\"%d\", &x);int lim = (x / 100) * 105;\nif (x > lim)\n printf (\"0\\n\");\nelse\n printf(\"1\\n\");\nreturn (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\"\n.LC1:\n\t.string\t\"0\"\n.LC2:\n\t.string\t\"1\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n... | {
"answer": "```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.LC2:\n\t.string\t\"1\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\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>\n#include <stdlib.h>\nint main(void){\n int *ip;\n int *emp;\n int num,i;\n scanf(\"%d\",&num);\n ip = (int *)malloc(num * sizeof(int)... | 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%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.LFB39:\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>\nint main(){\n int i ,n ,m;\nlong long int total=0 ,ave;\n scanf( \"%d\" ,&m );\n for( i=0 ; i<m ; i++ ){\n scanf( \"%d\" ,&n );\n ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\"\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\tpushq\t%r13\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\"\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\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 a[100010],n;\nint bs(int k){\n\tif(a[0]>k)return 0;\n\tint l=0,r=n;\n\twhile(r-l>1){\n\t\tint m=(l+r)/2;\n\t\tif(a[m]<=k)l=m;\n\t\te... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tbs\n\t.type\tbs, @function\nbs:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\txorl\t%eax, %eax\n\tcmpl\t%edi, a(%rip)\n\tjg\t.L1\n\tmovl\tn(%rip), %ecx\n\txorl\t%edx, %edx\n\tleaq\ta(%rip), %r8\n\tjmp\t.L4\n\t.p2align 4,,10\n\t.p2align 3\n.L5:\n\tlea... | {
"answer": "```assembly\n\t.file\t\"temp.c\"\n\t.text\n\t.p2align 4\n\t.globl\tbs\n\t.type\tbs, @function\nbs:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\txorl\t%eax, %eax\n\tcmpl\t%edi, a(%rip)\n\tjg\t.L1\n\tmovl\tn(%rip), %ecx\n\txorl\t%edx, %edx\n\tleaq\ta(%rip), %r8\n\tjmp\t.L4\n\t.p2align 4,,10\n\t.p2align 3\n.L5:... |
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\tint i;\n\tint n;\n\tchar str[128];\n\tint num[128];\n\tint total;\n\t\n\twhile (scanf(\"%s\", ... | code | {
"ground_truth": "\t.file\t\"temp.c\"\n\t.text\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.LC0:\n\t.string\t\"%d\\n\"\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%r12\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\"\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%r12\... |
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, m,a[1002],i,j=1,temp;\n\tscanf(\"%d %d\",&n,&m);\n\tfor (i = 0; i < n; i++) {\n\t\tscanf(\"%d\",&a[i]);\n\t}\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.LC2:\n\t.string\t\"%d\\n\"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\te... | {
"answer": "```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.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#include <stdlib.h>\n#include <string.h>\n#include <ctype.h>\n#define max(a, b)\t(((a) > (b)) ? (a) : (b))\t\t/* 2個の値の最大値 */\n#define min(... | 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.LFB55:\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.LFB55:\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(){\n\tint N,X,x;\n\tdouble r=0,h;\n\tscanf(\"%d%d\",&N,&X);\n\tfor(int i=0;i<N;i++){\n\t\tscanf(\"%d%lf\",&x,&... | 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.LC2:\n\t.string\t\"%d%lf\"\n.LC3:\n\t.string\t\"%f\\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.LC1:\n\t.string\t\"%d%d\"\n.LC2:\n\t.string\t\"%d%lf\"\n.LC3:\n\t.string\t\"%f\\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_start... |
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,j,repeat,dataset[10];\n\t\n\tscanf(\"%d\",&repeat);\n\tfor(j=0;j<repeat;j++)\n\t{\n\t\tscanf(\"%d\",&dataset[... | 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\"Case %d:\\n\"\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_startpro... | {
"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\"Case %d:\\n\"\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_s... |
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{\n if(a>=b)\n {\n return a;\n }\n if(b>a)\n {\n return b;\n }\n}\nint main()\n{\nint... | 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(void){\n long int n,a[200000],b[200000],i,j;\n scanf(\"%ld\",&n);\n for(i=0;i<n;i++){\n scanf(\"%ld\",&a[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\"%ld\"\n.LC1:\n\t.string\t\"%ld \"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\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\"%ld\"\n.LC1:\n\t.string\t\"%ld \"\n\t.section\t.text.startup,\"ax\",@progbits\n\t.p2align 4\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB23:\n\t.cfi_startproc\n\tendbr64\n\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 main(){\n int N,n,i;\n char S[100],T1[50],T2[50];\n scanf(\"%d\\n\",&N);\n scanf(\"%s\\n\",S);\n n=N/2;\n \n if (N==0||N%2==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\"\n.LC1:\n\t.string\t\"%s\\n\"\n.LC2:\n\t.string\t\"No\"\n.LC3:\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.LF... | {
"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\"\n.LC1:\n\t.string\t\"%s\\n\"\n.LC2:\n\t.string\t\"No\"\n.LC3:\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\nmai... |
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 int n,m;\n scanf(\"%d %d\",&n,&m);\n\n printf(\"%d\",n-m+1);\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\"%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, %... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.