// File: OtherCrashOverride[P]xu4enc/./M2M.h
// Function: M2M::EnumFormats(unsigned int)
void EnumFormats(uint32_t v4l2BufType)
	{
		int io;

		v4l2_fmtdesc formatDesc = { 0 };
		formatDesc.type = v4l2BufType; //V4L2_BUF_TYPE_VIDEO_CAPTURE;

		fprintf(stderr, "Supported formats:\n");
		while (true)
		{
			io = ioctl(mfc_fd, VIDIOC_ENUM_FMT, &formatDesc);
			if (io < 0)
			{
				//printf("VIDIOC_ENUM_FMT failed.\n");
				break;
			}

			fprintf(stderr, "\tdescription = %s, pixelformat=0x%x\n", formatDesc.description, formatDesc.pixelformat);


			v4l2_frmsizeenum formatSize = { 0 };
			formatSize.pixel_format = formatDesc.pixelformat;

			while (true)
			{
				io = ioctl(mfc_fd, VIDIOC_ENUM_FRAMESIZES, &formatSize);
				if (io < 0)
				{
					//printf("VIDIOC_ENUM_FRAMESIZES failed.\n");
					break;
				}

				fprintf(stderr, "\t\twidth = %d, height = %d\n", formatSize.discrete.width, formatSize.discrete.height);


				v4l2_frmivalenum frameInterval = { 0 };
				frameInterval.pixel_format = formatSize.pixel_format;
				frameInterval.width = formatSize.discrete.width;
				frameInterval.height = formatSize.discrete.height;

				while (true)
				{
					io = ioctl(mfc_fd, VIDIOC_ENUM_FRAMEINTERVALS, &frameInterval);
					if (io < 0)
					{
						//printf("VIDIOC_ENUM_FRAMEINTERVALS failed.\n");
						break;
					}

					fprintf(stderr, "\t\t\tnumerator = %d, denominator = %d\n", frameInterval.discrete.numerator, frameInterval.discrete.denominator);
					++frameInterval.index;
				}


				++formatSize.index;
			}

			++formatDesc.index;
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x20b0
movl -0xc(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq 0x7a86(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq 0x3d4b(%rip), %rsi      # 0x72af
movb $0x0, %al
callq 0x2130
movq -0xb8(%rbp), %rax
movl 0x8(%rax), %edi
movl $0xc0405602, %esi       # imm = 0xC0405602
leaq -0x50(%rbp), %rdx
movb $0x0, %al
callq 0x2120
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0x3593
jmp 0x36b9
movq 0x7a46(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq -0x50(%rbp), %rdx
addq $0xc, %rdx
movl -0x24(%rbp), %ecx
leaq 0x3d14(%rip), %rsi      # 0x72c3
movb $0x0, %al
callq 0x2130
leaq -0x7c(%rbp), %rdi
xorl %esi, %esi
movl $0x2c, %edx
callq 0x20b0
movl -0x24(%rbp), %eax
movl %eax, -0x78(%rbp)
movq -0xb8(%rbp), %rax
movl 0x8(%rax), %edi
movl $0xc02c564a, %esi       # imm = 0xC02C564A
leaq -0x7c(%rbp), %rdx
movb $0x0, %al
callq 0x2120
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0x35f4
jmp 0x36ab
movq 0x79e5(%rip), %rax      # 0xafe0
movq (%rax), %rdi
movl -0x70(%rbp), %edx
movl -0x6c(%rbp), %ecx
leaq 0x3cdd(%rip), %rsi      # 0x72e8
movb $0x0, %al
callq 0x2130
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
movl $0x34, %edx
callq 0x20b0
movl -0x78(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0xa8(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0xa4(%rbp)
movq -0xb8(%rbp), %rax
movl 0x8(%rax), %edi
movl $0xc034564b, %esi       # imm = 0xC034564B
leaq -0xb0(%rbp), %rdx
movb $0x0, %al
callq 0x2120
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0x3668
jmp 0x369d
movq 0x7971(%rip), %rax      # 0xafe0
movq (%rax), %rdi
movl -0x9c(%rbp), %edx
movl -0x98(%rbp), %ecx
leaq 0x3c7e(%rip), %rsi      # 0x7303
movb $0x0, %al
callq 0x2130
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb0(%rbp)
jmp 0x3640
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x35cc
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x356b
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)