// File: /workspace/github_c_makefile_star2_O0/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_SoundStreamHead
int swf_reader_read_SoundStreamHead(swf_reader *swf,swf_SoundStreamHead *h) {
	unsigned int Reserved;

	swf_reader_read_bytealign(swf);
	h->StreamSoundCompression_str = NULL;
	Reserved = swf_reader_read_UB(swf,4);
	if (Reserved != 0) fprintf(stderr,"SWF SoundStreamHead reserved field nonzero\n");
	h->PlaybackSoundRate = swf_reader_read_UB(swf,2);
	h->PlaybackSoundRate_value = swf_SoundRatesUB2[h->PlaybackSoundRate];
	h->PlaybackSoundSize = swf_reader_read_UB(swf,1);
	h->PlaybackSoundSize_value = h->PlaybackSoundSize ? 16 : 8;
	h->PlaybackSoundType = swf_reader_read_UB(swf,1);
	h->PlaybackSoundType_value = h->PlaybackSoundType ? 2 : 1;
	h->StreamSoundCompression = swf_reader_read_UB(swf,4);
	h->StreamSoundCompression_str = swf_SoundCompressionUB4[h->StreamSoundCompression];
	h->StreamSoundRate = swf_reader_read_UB(swf,2);
	h->StreamSoundRate_value = swf_SoundRatesUB2[h->StreamSoundRate];
	h->StreamSoundSize = swf_reader_read_UB(swf,1);
	h->StreamSoundSize_value = h->StreamSoundSize ? 16 : 8;
	h->StreamSoundType = swf_reader_read_UB(swf,1);
	h->StreamSoundType_value = h->StreamSoundType ? 2 : 1;
	h->StreamSoundSampleCount = swf_reader_read_UI16(swf);
	if (h->StreamSoundCompression == 2) {
		h->LatencySeek_present = 1;
		h->LatencySeek = swf_reader_read_UI16(swf);
	}
	else {
		h->LatencySeek_present = 0;
		h->LatencySeek = 0;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3260
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x33d0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x4234
movq 0x7dd5(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x543f(%rip), %rsi      # 0x966c
movb $0x0, %al
callq 0x10c0
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x33d0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movw %cx, %dx
movw (%rax), %cx
andw $0x3, %dx
andw $-0x4, %cx
orw %dx, %cx
movw %cx, (%rax)
movq -0x10(%rbp), %rax
movw (%rax), %ax
andw $0x3, %ax
movzwl %ax, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x4f47(%rip), %rax      # 0x91bc
movw (%rax,%rcx,2), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x33d0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movw %cx, %dx
movw (%rax), %cx
andw $0x1, %dx
shlw $0x2, %dx
andw $-0x5, %cx
orw %dx, %cx
movw %cx, (%rax)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x2, %ax
andw $0x1, %ax
movzwl %ax, %edx
movl $0x8, %eax
movl $0x10, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x4(%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x33d0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movw %cx, %dx
movw (%rax), %cx
andw $0x1, %dx
shlw $0x3, %dx
andw $-0x9, %cx
orw %dx, %cx
movw %cx, (%rax)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x3, %ax
andw $0x1, %ax
movzwl %ax, %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x5(%rax)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x33d0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movw %cx, %dx
movw (%rax), %cx
andw $0xf, %dx
shlw $0x8, %dx
andw $0xf0ff, %cx            # imm = 0xF0FF
orw %dx, %cx
movw %cx, (%rax)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x8, %ax
andw $0xf, %ax
movzwl %ax, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x7d57(%rip), %rax      # 0xc0d0
movq (%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x33d0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movw %cx, %dx
movw (%rax), %cx
andw $0x3, %dx
shlw $0x5, %dx
andw $-0x61, %cx
orw %dx, %cx
movw %cx, (%rax)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x5, %ax
andw $0x3, %ax
movzwl %ax, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x4dee(%rip), %rax      # 0x91bc
movw (%rax,%rcx,2), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x6(%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x33d0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movw %cx, %dx
movw (%rax), %cx
andw $0x1, %dx
shlw $0x7, %dx
andw $0xff7f, %cx            # imm = 0xFF7F
orw %dx, %cx
movw %cx, (%rax)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x7, %ax
andw $0x1, %ax
movzwl %ax, %edx
movl $0x8, %eax
movl $0x10, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x33d0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movw %cx, %dx
movw (%rax), %cx
andw $0x1, %dx
shlw $0xc, %dx
andw $0xefff, %cx            # imm = 0xEFFF
orw %dx, %cx
movw %cx, (%rax)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0xc, %ax
andw $0x1, %ax
movzwl %ax, %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x9(%rax)
movq -0x8(%rbp), %rdi
callq 0x35d0
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0xa(%rax)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x8, %ax
andw $0xf, %ax
movzwl %ax, %eax
cmpl $0x2, %eax
jne 0x44dd
movq -0x10(%rbp), %rax
movw (%rax), %cx
andw $-0x11, %cx
orw $0x10, %cx
movw %cx, (%rax)
movq -0x8(%rbp), %rdi
callq 0x35d0
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0xc(%rax)
jmp 0x44f9
movq -0x10(%rbp), %rax
movw (%rax), %cx
andw $-0x11, %cx
orw $0x0, %cx
movw %cx, (%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0xc(%rax)
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)