// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x830, %rsp            # imm = 0x830
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x430(%rbp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x10b0
leaq -0x830(%rbp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x10b0
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0x19a4
movb $0x0, -0x21(%rbp)
movl $0x0, -0x20(%rbp)
cmpl $0x3, -0x20(%rbp)
jge 0x1944
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x20(%rbp), %rax
leaq 0x97e0(%rip), %rsi      # 0xb100
imulq $0x14, %rax, %rax
addq %rax, %rsi
callq 0x10e0
cmpl $0x0, %eax
jne 0x1937
movb $0x1, -0x21(%rbp)
jmp 0x1944
jmp 0x1939
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x18ff
testb $0x1, -0x21(%rbp)
jne 0x1994
leaq -0x430(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x5b13(%rip), %rsi      # 0x747b
movb $0x0, %al
callq 0x1170
leaq -0x830(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x5af4(%rip), %rsi      # 0x7481
movb $0x0, %al
callq 0x1170
jmp 0x1996
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x18e4
movq -0x10(%rbp), %rdi
movq 0x9731(%rip), %rdx      # 0xb0e0
movq 0x9732(%rip), %rcx      # 0xb0e8
leaq 0x5aca(%rip), %rsi      # 0x7487
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x581f(%rip), %rsi      # 0x71ee
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x5ac7(%rip), %rsi      # 0x74ac
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5ac4(%rip), %rsi      # 0x74bb
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5abc(%rip), %rsi      # 0x74c5
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5ae2(%rip), %rsi      # 0x74fd
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x57c1(%rip), %rsi      # 0x71ee
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5adb(%rip), %rsi      # 0x751a
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5adc(%rip), %rsi      # 0x752d
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5ae1(%rip), %rsi      # 0x7544
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq -0x430(%rbp), %rdx
leaq 0x5ade(%rip), %rsi      # 0x755a
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq -0x830(%rbp), %rdx
leaq 0x5ada(%rip), %rsi      # 0x756f
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5ad7(%rip), %rsi      # 0x757e
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5735(%rip), %rsi      # 0x71ee
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5acb(%rip), %rsi      # 0x7596
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5711(%rip), %rsi      # 0x71ee
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5ac0(%rip), %rsi      # 0x75af
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5aba(%rip), %rsi      # 0x75bb
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x56db(%rip), %rsi      # 0x71ee
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5aa6(%rip), %rsi      # 0x75cb
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x56b7(%rip), %rsi      # 0x71ee
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5a91(%rip), %rsi      # 0x75da
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5a90(%rip), %rsi      # 0x75eb
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5681(%rip), %rsi      # 0x71ee
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5a73(%rip), %rsi      # 0x75f2
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5a81(%rip), %rsi      # 0x7612
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x564b(%rip), %rsi      # 0x71ee
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5aa5(%rip), %rsi      # 0x765a
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5a9c(%rip), %rsi      # 0x7663
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5615(%rip), %rsi      # 0x71ee
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5a98(%rip), %rsi      # 0x7683
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x5a9c(%rip), %rsi      # 0x7699
movb $0x0, %al
callq 0x1100
movq -0x10(%rbp), %rdi
leaq 0x55df(%rip), %rsi      # 0x71ee
movb $0x0, %al
callq 0x1100
addq $0x830, %rsp            # imm = 0x830
popq %rbp
retq
nop