// File: /workspace/github_c_makefile_star2_O1/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, 0x8(%rsp)
movq %rsi, %rbx
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
cmpl $0x0, 0x28(%r15)
jle 0x17ff
leaq 0x798d(%rip), %r13      # 0x9120
xorl %ebp, %ebp
movq 0x20(%r15), %rax
movq (%rax,%rbp,8), %r12
xorl %r14d, %r14d
leaq (%r14,%r13), %rsi
movq %r12, %rdi
callq 0x1110
testl %eax, %eax
je 0x17f3
addq $0x14, %r14
cmpq $0x3c, %r14
jne 0x17a0
movq 0x20(%r15), %rax
movq (%rax,%rbp,8), %rdx
leaq 0x410(%rsp), %rdi
leaq 0x39f1(%rip), %rsi      # 0x51c2
xorl %eax, %eax
callq 0x11a0
movq 0x20(%r15), %rax
movq (%rax,%rbp,8), %rdx
leaq 0x10(%rsp), %rdi
leaq 0x39dc(%rip), %rsi      # 0x51c8
xorl %eax, %eax
callq 0x11a0
incq %rbp
movslq 0x28(%r15), %rax
cmpq %rax, %rbp
jl 0x1795
movq 0x78fa(%rip), %rdx      # 0x9100
movq 0x78fb(%rip), %rcx      # 0x9108
leaq 0x39ba(%rip), %rsi      # 0x51ce
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1130
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x39c1(%rip), %rsi      # 0x51f3
movq %rbx, %rdi
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x1130
leaq 0x39ba(%rip), %rdi      # 0x5202
movl $0x9, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x39ab(%rip), %rdi      # 0x520c
movl $0x37, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x39ca(%rip), %rdi      # 0x5244
movl $0x1c, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x39c1(%rip), %rdi      # 0x5261
movl $0x12, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x39bb(%rip), %rdi      # 0x5274
movl $0x16, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x39b9(%rip), %rdi      # 0x528b
movl $0x15, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x39b6(%rip), %rsi      # 0x52a1
leaq 0x410(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1130
leaq 0x39b2(%rip), %rsi      # 0x52b6
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1130
leaq 0x39ab(%rip), %rdi      # 0x52c5
movl $0x17, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x399d(%rip), %rdi      # 0x52dd
movl $0x18, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x3990(%rip), %rdi      # 0x52f6
movl $0xb, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x3983(%rip), %rdi      # 0x5302
movl $0xf, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x396d(%rip), %rdi      # 0x5312
movl $0xe, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x3956(%rip), %rsi      # 0x5321
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1130
leaq 0x3956(%rip), %rdi      # 0x5332
movl $0x6, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x3937(%rip), %rdi      # 0x5339
movl $0x1f, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x393e(%rip), %rdi      # 0x5359
movl $0x47, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x3960(%rip), %rdi      # 0x53a1
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x3950(%rip), %rdi      # 0x53aa
movl $0x1f, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10f0
leaq 0x394a(%rip), %rdi      # 0x53ca
movl $0x15, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x3947(%rip), %rdi      # 0x53e0
movl $0x18, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10f0
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq