// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/cpuid_main.c
// Function: cpuid_serialize_raw_data_internal
static int cpuid_serialize_raw_data_internal(struct cpu_raw_data_t* single_raw, struct cpu_raw_data_array_t* raw_array, const char* filename)
{
	int i;
	bool end_loop = false;
	const bool use_raw_array = (raw_array != NULL) && raw_array->num_raw > 0;
	logical_cpu_t logical_cpu = 0;
	struct cpu_raw_data_t* raw_ptr = use_raw_array ? &raw_array->raw[0] : single_raw;
	FILE *f;

	/* Open file descriptor */
	f = !strcmp(filename, "") ? stdout : fopen(filename, "wt");
	if (!f)
		return cpuid_set_error(ERR_OPEN);
	debugf(1, "Writing raw CPUID dump to '%s'\n", f == stdout ? "stdout" : filename);

	/* Write raw data to output file */
	fprintf(f, "version=%s\n", VERSION);
	while (!end_loop) {
		if (use_raw_array) {
			debugf(2, "Writing raw dump for logical CPU %i\n", logical_cpu);
			fprintf(f, "\n_________________ Logical CPU #%i _________________\n", logical_cpu);
			raw_ptr = &raw_array->raw[logical_cpu];
		}
		for (i = 0; i < MAX_CPUID_LEVEL; i++)
			fprintf(f, "basic_cpuid[%d]=%08x %08x %08x %08x\n", i,
				raw_ptr->basic_cpuid[i][EAX], raw_ptr->basic_cpuid[i][EBX],
				raw_ptr->basic_cpuid[i][ECX], raw_ptr->basic_cpuid[i][EDX]);
		for (i = 0; i < MAX_EXT_CPUID_LEVEL; i++)
			fprintf(f, "ext_cpuid[%d]=%08x %08x %08x %08x\n", i,
				raw_ptr->ext_cpuid[i][EAX], raw_ptr->ext_cpuid[i][EBX],
				raw_ptr->ext_cpuid[i][ECX], raw_ptr->ext_cpuid[i][EDX]);
		for (i = 0; i < MAX_INTELFN4_LEVEL; i++)
			fprintf(f, "intel_fn4[%d]=%08x %08x %08x %08x\n", i,
				raw_ptr->intel_fn4[i][EAX], raw_ptr->intel_fn4[i][EBX],
				raw_ptr->intel_fn4[i][ECX], raw_ptr->intel_fn4[i][EDX]);
		for (i = 0; i < MAX_INTELFN11_LEVEL; i++)
			fprintf(f, "intel_fn11[%d]=%08x %08x %08x %08x\n", i,
				raw_ptr->intel_fn11[i][EAX], raw_ptr->intel_fn11[i][EBX],
				raw_ptr->intel_fn11[i][ECX], raw_ptr->intel_fn11[i][EDX]);
		for (i = 0; i < MAX_INTELFN12H_LEVEL; i++)
			fprintf(f, "intel_fn12h[%d]=%08x %08x %08x %08x\n", i,
				raw_ptr->intel_fn12h[i][EAX], raw_ptr->intel_fn12h[i][EBX],
				raw_ptr->intel_fn12h[i][ECX], raw_ptr->intel_fn12h[i][EDX]);
		for (i = 0; i < MAX_INTELFN14H_LEVEL; i++)
			fprintf(f, "intel_fn14h[%d]=%08x %08x %08x %08x\n", i,
				raw_ptr->intel_fn14h[i][EAX], raw_ptr->intel_fn14h[i][EBX],
				raw_ptr->intel_fn14h[i][ECX], raw_ptr->intel_fn14h[i][EDX]);
		for (i = 0; i < MAX_AMDFN8000001DH_LEVEL; i++)
			fprintf(f, "amd_fn8000001dh[%d]=%08x %08x %08x %08x\n", i,
				raw_ptr->amd_fn8000001dh[i][EAX], raw_ptr->amd_fn8000001dh[i][EBX],
				raw_ptr->amd_fn8000001dh[i][ECX], raw_ptr->amd_fn8000001dh[i][EDX]);
		logical_cpu++;
		end_loop = ((use_raw_array && (logical_cpu >= raw_array->num_raw)) || !use_raw_array);
	}

	/* Close file descriptor */
	if (strcmp(filename, ""))
		fclose(f);
	return cpuid_set_error(ERR_OK);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movb $0x0, -0x25(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x39(%rbp)
je 0x131e85
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %eax
cmpl $0x0, %eax
setg %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
andb $0x1, %al
movb %al, -0x26(%rbp)
movw $0x0, -0x28(%rbp)
testb $0x1, -0x26(%rbp)
je 0x131ea7
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x131eaf
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x739c2(%rip), %rsi     # 0x1a5884
callq 0x5c440
cmpl $0x0, %eax
jne 0x131edc
movq 0xd6935(%rip), %rax     # 0x208808
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x131ef0
movq -0x20(%rbp), %rdi
leaq 0x75b3a(%rip), %rsi     # 0x1a7a21
callq 0x5db10
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x131f11
movl $0xfffffffc, %edi       # imm = 0xFFFFFFFC
callq 0x131660
movl %eax, -0x4(%rbp)
jmp 0x13242e
movq -0x38(%rbp), %rax
movq 0xd68ec(%rip), %rcx     # 0x208808
cmpq (%rcx), %rax
jne 0x131f2e
leaq 0x75b1c(%rip), %rax     # 0x1a7a44
movq %rax, -0x58(%rbp)
jmp 0x131f36
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdx
movl $0x1, %edi
leaq 0x75ade(%rip), %rsi     # 0x1a7a24
movb $0x0, %al
callq 0x135780
movq -0x38(%rbp), %rdi
leaq 0x75af3(%rip), %rsi     # 0x1a7a4b
leaq 0x759c7(%rip), %rdx     # 0x1a7926
movb $0x0, %al
callq 0x59a90
movb -0x25(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x131f74
jmp 0x132406
testb $0x1, -0x26(%rbp)
je 0x131fc1
movzwl -0x28(%rbp), %edx
movl $0x2, %edi
leaq 0x75acd(%rip), %rsi     # 0x1a7a57
movb $0x0, %al
callq 0x135780
movq -0x38(%rbp), %rdi
movzwl -0x28(%rbp), %edx
leaq 0x75adc(%rip), %rsi     # 0x1a7a7c
movb $0x0, %al
callq 0x59a90
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movzwl -0x28(%rbp), %ecx
imulq $0x580, %rcx, %rcx      # imm = 0x580
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x20, -0x24(%rbp)
jge 0x13203a
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rax
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x4(%rax), %r8d
movq -0x30(%rbp), %rax
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x8(%rax), %r9d
movq -0x30(%rbp), %rax
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0xc(%rax), %eax
leaq 0x75a8d(%rip), %rsi     # 0x1a7ab2
movl %eax, (%rsp)
movb $0x0, %al
callq 0x59a90
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x131fc8
movl $0x0, -0x24(%rbp)
cmpl $0x20, -0x24(%rbp)
jge 0x1320d2
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rax
addq $0x200, %rax            # imm = 0x200
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rax
addq $0x200, %rax            # imm = 0x200
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x4(%rax), %r8d
movq -0x30(%rbp), %rax
addq $0x200, %rax            # imm = 0x200
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x8(%rax), %r9d
movq -0x30(%rbp), %rax
addq $0x200, %rax            # imm = 0x200
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0xc(%rax), %eax
leaq 0x75a1d(%rip), %rsi     # 0x1a7ad7
movl %eax, (%rsp)
movb $0x0, %al
callq 0x59a90
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x132041
movl $0x0, -0x24(%rbp)
cmpl $0x8, -0x24(%rbp)
jge 0x13216a
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rax
addq $0x400, %rax            # imm = 0x400
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rax
addq $0x400, %rax            # imm = 0x400
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x4(%rax), %r8d
movq -0x30(%rbp), %rax
addq $0x400, %rax            # imm = 0x400
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x8(%rax), %r9d
movq -0x30(%rbp), %rax
addq $0x400, %rax            # imm = 0x400
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0xc(%rax), %eax
leaq 0x759a8(%rip), %rsi     # 0x1a7afa
movl %eax, (%rsp)
movb $0x0, %al
callq 0x59a90
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1320d9
movl $0x0, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0x132202
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rax
addq $0x480, %rax            # imm = 0x480
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rax
addq $0x480, %rax            # imm = 0x480
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x4(%rax), %r8d
movq -0x30(%rbp), %rax
addq $0x480, %rax            # imm = 0x480
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x8(%rax), %r9d
movq -0x30(%rbp), %rax
addq $0x480, %rax            # imm = 0x480
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0xc(%rax), %eax
leaq 0x75933(%rip), %rsi     # 0x1a7b1d
movl %eax, (%rsp)
movb $0x0, %al
callq 0x59a90
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x132171
movl $0x0, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0x13229a
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rax
addq $0x4c0, %rax            # imm = 0x4C0
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rax
addq $0x4c0, %rax            # imm = 0x4C0
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x4(%rax), %r8d
movq -0x30(%rbp), %rax
addq $0x4c0, %rax            # imm = 0x4C0
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x8(%rax), %r9d
movq -0x30(%rbp), %rax
addq $0x4c0, %rax            # imm = 0x4C0
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0xc(%rax), %eax
leaq 0x758bf(%rip), %rsi     # 0x1a7b41
movl %eax, (%rsp)
movb $0x0, %al
callq 0x59a90
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x132209
movl $0x0, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0x132332
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rax
addq $0x500, %rax            # imm = 0x500
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rax
addq $0x500, %rax            # imm = 0x500
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x4(%rax), %r8d
movq -0x30(%rbp), %rax
addq $0x500, %rax            # imm = 0x500
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x8(%rax), %r9d
movq -0x30(%rbp), %rax
addq $0x500, %rax            # imm = 0x500
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0xc(%rax), %eax
leaq 0x7584c(%rip), %rsi     # 0x1a7b66
movl %eax, (%rsp)
movb $0x0, %al
callq 0x59a90
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1322a1
movl $0x0, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0x1323ca
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rax
addq $0x540, %rax            # imm = 0x540
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rax
addq $0x540, %rax            # imm = 0x540
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x4(%rax), %r8d
movq -0x30(%rbp), %rax
addq $0x540, %rax            # imm = 0x540
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x8(%rax), %r9d
movq -0x30(%rbp), %rax
addq $0x540, %rax            # imm = 0x540
movslq -0x24(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0xc(%rax), %eax
leaq 0x757d9(%rip), %rsi     # 0x1a7b8b
movl %eax, (%rsp)
movb $0x0, %al
callq 0x59a90
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x132339
movw -0x28(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x28(%rbp)
testb $0x1, -0x26(%rbp)
je 0x1323f1
movzwl -0x28(%rbp), %ecx
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %edx
movb $0x1, %al
cmpl %edx, %ecx
movb %al, -0x59(%rbp)
jge 0x1323f9
movb -0x26(%rbp), %al
xorb $-0x1, %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
andb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x131f66
movq -0x20(%rbp), %rdi
leaq 0x73473(%rip), %rsi     # 0x1a5884
callq 0x5c440
cmpl $0x0, %eax
je 0x132424
movq -0x38(%rbp), %rdi
callq 0x5a8f0
xorl %edi, %edi
callq 0x131660
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)