// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/utils/processtab/processtab.c
// Function: outputMakefile
static void 
outputMakefile(Composition *c, FILE *out, char *baseName)
	{
	int i, j;
    bool usedStdAttribute;
	char cfiles[MAX_LENGTH_ATTRIBUTE_INCLUDES] = "";
	char includes[MAX_LENGTH_ATTRIBUTE_INCLUDES] = "";	
    
    /* determine attribute processors to add to makefile */
    for (i = 0; i < c->attributeNameCount; i++)
        {
        usedStdAttribute = false;
        for (j = 0; j < STD_ATTRIBUTE_COUNT; j++)
        	{
        	if (strcmp(c->attributeNames[i], stdAttributes[j]) == 0)
        		{
        		usedStdAttribute = true;
        		break;
        		}
	        }
        if (!usedStdAttribute)
        	{
        	sprintf(cfiles, "%s.c ", c->attributeNames[i]);
        	sprintf(includes, "%s.h ", c->attributeNames[i]);
        	}
        }
        
    fprintf(out, "# This file was generated by %s %s.\n", PROGRAM_NAME, PROGRAM_VERSION);
    fprintf(out, "\n");
    fprintf(out, "BASENAME = %s\n", baseName);
    fprintf(out, "CC = gcc\n");
    fprintf(out, "DEBUG = -DMIN_DEBUG_LEVEL=3 -DMAX_DEBUG_LEVEL=6 -g #-p\n");
    fprintf(out, "CFLAGS = -Wall -pg $(DEBUG)\n");
    fprintf(out, "\n");
    fprintf(out, "BIN = $(BASENAME)\n");
    fprintf(out, "TAB = $(BASENAME).tab\n");
    fprintf(out, "MAIN = $(BASENAME).c\n");
    fprintf(out, "CFILES = $(MAIN) %s\n", cfiles);
    fprintf(out, "INCLUDES = %s\n", includes);
    fprintf(out, "RRAS = $(BASENAME).rra\n");
    fprintf(out, "\n");
    fprintf(out, ".PHONY : mix play clean\n");
    fprintf(out, "\n");
    fprintf(out, "play : mix\n");
    fprintf(out, "\trplay $(RRAS)\n");
    fprintf(out, "\n");
    fprintf(out, "mix : $(RRAS)\n");
    fprintf(out, "\n");
    fprintf(out, "%%.rra : $(BIN)\n");
    fprintf(out, "\t./$<\n");
    fprintf(out, "\n");
    fprintf(out, "$(BIN) : $(CFILES) $(INCLUDES)\n");
    fprintf(out, "\t$(CC) $(CFILES) -o $(BIN) -L/usr/local/lib -lsong -ltab -lm $(CFLAGS)\n");
    fprintf(out, "\n");
    fprintf(out, "clean :\n");
    fprintf(out, "\trm -f $(RRAS) $(BIN) gmon.out\n");
    fprintf(out, "\n");
    fprintf(out, "really-clean : clean\n");
    fprintf(out, "\trm -f $(MAIN) makefile\n");
    fprintf(out, "\n");
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x818, %rsp            # imm = 0x818
movq %rdx, (%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %r15
leaq 0x410(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x10d0
leaq 0x10(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x10d0
leaq 0x3aee(%rip), %r14      # 0x51c8
leaq 0x7a3f(%rip), %rbx      # 0x9120
xorl %r13d, %r13d
movslq 0x28(%r15), %rax
cmpq %rax, %r13
jge 0x174a
movq 0x20(%r15), %rax
movq (%rax,%r13,8), %r12
xorl %esi, %esi
leaq 0x14(%rsi), %rbp
cmpq $0x50, %rbp
je 0x1715
addq %rbx, %rsi
movq %r12, %rdi
callq 0x1110
movq %rbp, %rsi
testl %eax, %eax
jne 0x16f7
jmp 0x1745
leaq 0x410(%rsp), %rdi
leaq 0x3a9e(%rip), %rsi      # 0x51c2
movq %r12, %rdx
xorl %eax, %eax
callq 0x11a0
movq 0x20(%r15), %rax
movq (%rax,%r13,8), %rdx
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x11a0
incq %r13
jmp 0x16e4
movq 0x79af(%rip), %rdx      # 0x9100
movq 0x79b0(%rip), %rcx      # 0x9108
leaq 0x3a6f(%rip), %rsi      # 0x51ce
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1130
pushq $0xa
popq %rbp
movl %ebp, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x3a71(%rip), %rsi      # 0x51f3
movq %rbx, %rdi
movq (%rsp), %rdx
xorl %eax, %eax
callq 0x1130
leaq 0x3a6b(%rip), %rdi      # 0x5202
pushq $0x9
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x3a5c(%rip), %rdi      # 0x520c
pushq $0x37
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x3a7f(%rip), %rdi      # 0x5244
pushq $0x1c
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
movl %ebp, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x3a7d(%rip), %rdi      # 0x5261
pushq $0x12
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x3a7b(%rip), %rdi      # 0x5274
pushq $0x16
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x3a7d(%rip), %rdi      # 0x528b
pushq $0x15
popq %r15
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x3a7a(%rip), %rsi      # 0x52a1
leaq 0x410(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1130
leaq 0x3a76(%rip), %rsi      # 0x52b6
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1130
leaq 0x3a6f(%rip), %rdi      # 0x52c5
pushq $0x17
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
movl %ebp, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x3a68(%rip), %rdi      # 0x52dd
pushq $0x18
popq %r12
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
movl %ebp, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x3a5e(%rip), %rdi      # 0x52f6
pushq $0xb
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x3a55(%rip), %rdi      # 0x5302
pushq $0xf
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
movl %ebp, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x3a46(%rip), %rdi      # 0x5312
pushq $0xe
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
movl %ebp, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x3a36(%rip), %rsi      # 0x5321
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1130
leaq 0x3a36(%rip), %rdi      # 0x5332
pushq $0x6
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
movl %ebp, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x3a1e(%rip), %rdi      # 0x5339
pushq $0x1f
popq %r13
movq %r13, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x3a25(%rip), %rdi      # 0x5359
pushq $0x47
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
movl %ebp, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x3a4e(%rip), %rdi      # 0x53a1
pushq $0x8
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x3a42(%rip), %rdi      # 0x53aa
movq %r13, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
movl %ebp, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x3a43(%rip), %rdi      # 0x53ca
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x3a44(%rip), %rdi      # 0x53e0
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
movl %ebp, %edi
movq %rbx, %rsi
callq 0x10f0
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq