// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_info_audio
char smk_info_audio(const smk object, unsigned char * track_mask, unsigned char channels[7], unsigned char bitdepth[7], unsigned long audio_rate[7])
{
	unsigned char i;

	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_info_audio() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	if (!track_mask && !channels && !bitdepth && !audio_rate) {
		fputs("libsmacker::smk_info_audio(object,track_mask,channels,bitdepth,audio_rate) - ERROR: Request for info with all-NULL return references\n", stderr);
		return -1;
	}

	if (track_mask) {
		*track_mask = ((object->audio[0].exists) |
				((object->audio[1].exists) << 1) |
				((object->audio[2].exists) << 2) |
				((object->audio[3].exists) << 3) |
				((object->audio[4].exists) << 4) |
				((object->audio[5].exists) << 5) |
				((object->audio[6].exists) << 6));
	}

	if (channels) {
		for (i = 0; i < 7; i ++)
			channels[i] = object->audio[i].channels;
	}

	if (bitdepth) {
		for (i = 0; i < 7; i ++)
			bitdepth[i] = object->audio[i].bitdepth;
	}

	if (audio_rate) {
		for (i = 0; i < 7; i ++)
			audio_rate[i] = object->audio[i].rate;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x46992
movq 0xd265e(%rip), %rax     # 0x118fd8
movq (%rax), %rsi
leaq 0xa6b2f(%rip), %rdi     # 0xed4b3
callq 0x8430
movb $-0x1, -0x1(%rbp)
jmp 0x46b15
cmpq $0x0, -0x18(%rbp)
jne 0x469cd
cmpq $0x0, -0x20(%rbp)
jne 0x469cd
cmpq $0x0, -0x28(%rbp)
jne 0x469cd
cmpq $0x0, -0x30(%rbp)
jne 0x469cd
movq 0xd2623(%rip), %rax     # 0x118fd8
movq (%rax), %rsi
leaq 0xa6b27(%rip), %rdi     # 0xed4e6
callq 0x8430
movb $-0x1, -0x1(%rbp)
jmp 0x46b15
cmpq $0x0, -0x18(%rbp)
je 0x46a46
movq -0x10(%rbp), %rax
movzbl 0x3f8(%rax), %eax
movq -0x10(%rbp), %rcx
movzbl 0x428(%rcx), %ecx
shll %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x458(%rcx), %ecx
shll $0x2, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x488(%rcx), %ecx
shll $0x3, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x4b8(%rcx), %ecx
shll $0x4, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x4e8(%rcx), %ecx
shll $0x5, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x518(%rcx), %ecx
shll $0x6, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x46a89
movb $0x0, -0x31(%rbp)
movzbl -0x31(%rbp), %eax
cmpl $0x7, %eax
jge 0x46a87
movq -0x10(%rbp), %rax
addq $0x3f8, %rax            # imm = 0x3F8
movzbl -0x31(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x2(%rax), %dl
movq -0x20(%rbp), %rax
movzbl -0x31(%rbp), %ecx
movb %dl, (%rax,%rcx)
movb -0x31(%rbp), %al
addb $0x1, %al
movb %al, -0x31(%rbp)
jmp 0x46a51
jmp 0x46a89
cmpq $0x0, -0x28(%rbp)
je 0x46acc
movb $0x0, -0x31(%rbp)
movzbl -0x31(%rbp), %eax
cmpl $0x7, %eax
jge 0x46aca
movq -0x10(%rbp), %rax
addq $0x3f8, %rax            # imm = 0x3F8
movzbl -0x31(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x3(%rax), %dl
movq -0x28(%rbp), %rax
movzbl -0x31(%rbp), %ecx
movb %dl, (%rax,%rcx)
movb -0x31(%rbp), %al
addb $0x1, %al
movb %al, -0x31(%rbp)
jmp 0x46a94
jmp 0x46acc
cmpq $0x0, -0x30(%rbp)
je 0x46b11
movb $0x0, -0x31(%rbp)
movzbl -0x31(%rbp), %eax
cmpl $0x7, %eax
jge 0x46b0f
movq -0x10(%rbp), %rax
addq $0x3f8, %rax            # imm = 0x3F8
movzbl -0x31(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
movq -0x30(%rbp), %rax
movzbl -0x31(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movb -0x31(%rbp), %al
addb $0x1, %al
movb %al, -0x31(%rbp)
jmp 0x46ad7
jmp 0x46b11
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x40, %rsp
popq %rbp
retq
nop