// File: /workspace/github_c_makefile_star2_O2/hansvanstaveren[P]BigDeal/output.c
// Function: output_createfiles
void
output_createfiles(char *fileprefix, progparams_p ppp)
/*
 * Create a file for every wanted output format
 * Set the formatset variable
 */
{
	char filename[100];
	of_p ofp;
	FILE *f;

	prparp = ppp;
	/* For all formats: */
	for (ofp=output_formats; ofp->of_name; ofp++) {
		/* If not in use forget it */
		if (!(ofp->of_flags&OFF_USEIT))
			continue;

		if (ofp->of_high_board &&
		    ppp->pp_highboard > ofp->of_high_board) {
			fprintf(stderr, "Format %s supports %d as high board, skipping\n", ofp->of_name, ofp->of_high_board);
			continue;
		}
		/* Make note of internal formats we have to make */
		formatset |= formatclosure[ofp->of_baseform];

		/* If no suffix use Standard Output */
		if (ofp->of_suffix) {
			if (strlen(fileprefix)+strlen(ofp->of_suffix)+1 >
					sizeof(filename)) {
				fprintf(stderr, "File name %s%s too long(cannot happen)\n", fileprefix, ofp->of_suffix);
				exit(-1);
			}
			strcpy(filename, fileprefix);
			strcat(filename, ofp->of_suffix);
			f = fopen(filename, ofp->of_flags&OFF_BINARY ? "wb" : "w");
			if (f == NULL) {
				fprintf(stderr, "Cannot create %s\n", filename);
				exit(-1);
			}
			ofp->of_file = f;
		} else {
			ofp->of_file = stdout;
		}
		/*
		 * If there is an init routine call it now
		 */
		if (ofp->of_init)
			(*ofp->of_init)(ofp->of_file);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
movq %rsi, 0x75a1(%rip)      # 0xbc80
leaq 0x4bfa(%rip), %r12      # 0x92e0
leaq 0x10(%rsp), %r15
movq -0x30(%r12), %rdx
testq %rdx, %rdx
je 0x47dd
movl -0x28(%r12), %r14d
testb $0x1, %r14b
je 0x47ba
movl -0xc(%r12), %ecx
testl %ecx, %ecx
je 0x471f
movq 0x8(%rsp), %rax
cmpl %ecx, 0x4(%rax)
jg 0x47c3
movslq -0x10(%r12), %rax
leaq 0x2195(%rip), %rcx      # 0x68c0
movl (%rcx,%rax,4), %eax
orl %eax, 0x7554(%rip)      # 0xbc88
movq -0x18(%r12), %r13
testq %r13, %r13
je 0x479d
movq %rbx, %rdi
callq 0x2090
movq %rax, %rbp
movq %r13, %rdi
callq 0x2090
addq %rbp, %rax
addq $-0x64, %rax
cmpq $-0x66, %rax
jbe 0x480b
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2050
movq %r15, %rdi
movq %r13, %rsi
callq 0x21c0
testb $0x2, %r14b
leaq 0x1d7b(%rip), %rsi      # 0x64fe
leaq 0x1f0e(%rip), %rax      # 0x6698
cmoveq %rax, %rsi
movq %r15, %rdi
callq 0x2190
testq %rax, %rax
jne 0x47a7
jmp 0x47ec
movq 0x481c(%rip), %rax      # 0x8fc0
movq (%rax), %rax
movq %rax, -0x20(%r12)
movq (%r12), %rcx
testq %rcx, %rcx
je 0x47ba
movq %rax, %rdi
callq *%rcx
addq $0x48, %r12
jmp 0x46eb
movq 0x4826(%rip), %rax      # 0x8ff0
movq (%rax), %rdi
leaq 0x1cd3(%rip), %rsi      # 0x64a7
xorl %eax, %eax
callq 0x2170
jmp 0x47ba
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x47fd(%rip), %rax      # 0x8ff0
movq (%rax), %rdi
leaq 0x1d04(%rip), %rsi      # 0x6501
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x2170
jmp 0x4829
movq 0x47de(%rip), %rax      # 0x8ff0
movq (%rax), %rdi
leaq 0x1cba(%rip), %rsi      # 0x64d6
movq %rbx, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x2170
pushq $-0x1
popq %rdi
callq 0x21d0