#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct v4l2_pix_format {
  int /*<<< orphan*/ xfer_func;
  int /*<<< orphan*/ quantization;
  int /*<<< orphan*/ ycbcr_enc;
  int /*<<< orphan*/ colorspace;
  int /*<<< orphan*/ field;
  int /*<<< orphan*/ height;
  int /*<<< orphan*/ width;
};
struct v4l2_mbus_framefmt {
  int code;
  int /*<<< orphan*/ xfer_func;
  int /*<<< orphan*/ quantization;
  int /*<<< orphan*/ ycbcr_enc;
  int /*<<< orphan*/ colorspace;
  int /*<<< orphan*/ field;
  int /*<<< orphan*/ height;
  int /*<<< orphan*/ width;
};
typedef enum v4l2_mbus_pixelcode {
  ____Placeholder_v4l2_mbus_pixelcode
} v4l2_mbus_pixelcode;

/* Variables and functions */
void v4l2_fill_mbus_format(struct v4l2_mbus_framefmt *mbus_fmt,
                           const struct v4l2_pix_format *pix_fmt,
                           enum v4l2_mbus_pixelcode code) {
  mbus_fmt->width = pix_fmt->width;
  mbus_fmt->height = pix_fmt->height;
  mbus_fmt->field = pix_fmt->field;
  mbus_fmt->colorspace = pix_fmt->colorspace;
  mbus_fmt->ycbcr_enc = pix_fmt->ycbcr_enc;
  mbus_fmt->quantization = pix_fmt->quantization;
  mbus_fmt->xfer_func = pix_fmt->xfer_func;
  mbus_fmt->code = code;
}


x86 assembly (clang, -O0):
<v4l2_fill_mbus_format>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4l2_fill_mbus_format>:
mov    0x18(%rsi),%eax
mov    %eax,0x1c(%rdi)
mov    0x14(%rsi),%eax
mov    %eax,0x18(%rdi)
mov    0x10(%rsi),%eax
mov    %eax,0x14(%rdi)
movups (%rsi),%xmm0
movups %xmm0,0x4(%rdi)
mov    %edx,(%rdi)
ret

LLVM IR (-O0):
%struct.v4l2_mbus_framefmt = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.v4l2_pix_format = type { i32, i32, i32, i32, i32, i32, i32 }
define void @v4l2_fill_mbus_format(%struct.v4l2_mbus_framefmt* %0, %struct.v4l2_pix_format* %1, i32 %2) {
%4 = alloca %struct.v4l2_mbus_framefmt*
%5 = alloca %struct.v4l2_pix_format*
%6 = alloca i32
store %struct.v4l2_mbus_framefmt* %0, %struct.v4l2_mbus_framefmt** %4
store %struct.v4l2_pix_format* %1, %struct.v4l2_pix_format** %5
store i32 %2, i32* %6
%7 = load %struct.v4l2_pix_format*, %struct.v4l2_pix_format** %5
%8 = getelementptr inbounds %struct.v4l2_pix_format, %struct.v4l2_pix_format* %7, i32 0, i32 6
%9 = load i32, i32* %8
%10 = load %struct.v4l2_mbus_framefmt*, %struct.v4l2_mbus_framefmt** %4
%11 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %10, i32 0, i32 7
store i32 %9, i32* %11
%12 = load %struct.v4l2_pix_format*, %struct.v4l2_pix_format** %5
%13 = getelementptr inbounds %struct.v4l2_pix_format, %struct.v4l2_pix_format* %12, i32 0, i32 5
%14 = load i32, i32* %13
%15 = load %struct.v4l2_mbus_framefmt*, %struct.v4l2_mbus_framefmt** %4
%16 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %15, i32 0, i32 6
store i32 %14, i32* %16
%17 = load %struct.v4l2_pix_format*, %struct.v4l2_pix_format** %5
%18 = getelementptr inbounds %struct.v4l2_pix_format, %struct.v4l2_pix_format* %17, i32 0, i32 4
%19 = load i32, i32* %18
%20 = load %struct.v4l2_mbus_framefmt*, %struct.v4l2_mbus_framefmt** %4
%21 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %20, i32 0, i32 5
store i32 %19, i32* %21
%22 = load %struct.v4l2_pix_format*, %struct.v4l2_pix_format** %5
%23 = getelementptr inbounds %struct.v4l2_pix_format, %struct.v4l2_pix_format* %22, i32 0, i32 3
%24 = load i32, i32* %23
%25 = load %struct.v4l2_mbus_framefmt*, %struct.v4l2_mbus_framefmt** %4
%26 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %25, i32 0, i32 4
store i32 %24, i32* %26
%27 = load %struct.v4l2_pix_format*, %struct.v4l2_pix_format** %5
%28 = getelementptr inbounds %struct.v4l2_pix_format, %struct.v4l2_pix_format* %27, i32 0, i32 2
%29 = load i32, i32* %28
%30 = load %struct.v4l2_mbus_framefmt*, %struct.v4l2_mbus_framefmt** %4
%31 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %30, i32 0, i32 3
store i32 %29, i32* %31
%32 = load %struct.v4l2_pix_format*, %struct.v4l2_pix_format** %5
%33 = getelementptr inbounds %struct.v4l2_pix_format, %struct.v4l2_pix_format* %32, i32 0, i32 1
%34 = load i32, i32* %33
%35 = load %struct.v4l2_mbus_framefmt*, %struct.v4l2_mbus_framefmt** %4
%36 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %35, i32 0, i32 2
store i32 %34, i32* %36
%37 = load %struct.v4l2_pix_format*, %struct.v4l2_pix_format** %5
%38 = getelementptr inbounds %struct.v4l2_pix_format, %struct.v4l2_pix_format* %37, i32 0, i32 0
%39 = load i32, i32* %38
%40 = load %struct.v4l2_mbus_framefmt*, %struct.v4l2_mbus_framefmt** %4
%41 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %40, i32 0, i32 1
store i32 %39, i32* %41
%42 = load i32, i32* %6
%43 = load %struct.v4l2_mbus_framefmt*, %struct.v4l2_mbus_framefmt** %4
%44 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %43, i32 0, i32 0
store i32 %42, i32* %44
ret void
}

LLVM IR (-O2):
%struct.v4l2_mbus_framefmt = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.v4l2_pix_format = type { i32, i32, i32, i32, i32, i32, i32 }
define void @v4l2_fill_mbus_format(%struct.v4l2_mbus_framefmt* nocapture writeonly %0, %struct.v4l2_pix_format* nocapture %1, i32 %2) {
%4 = getelementptr inbounds %struct.v4l2_pix_format, %struct.v4l2_pix_format* %1, i64 0, i32 6
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %0, i64 0, i32 7
store i32 %5, i32* %6
%7 = getelementptr inbounds %struct.v4l2_pix_format, %struct.v4l2_pix_format* %1, i64 0, i32 5
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %0, i64 0, i32 6
store i32 %8, i32* %9
%10 = getelementptr inbounds %struct.v4l2_pix_format, %struct.v4l2_pix_format* %1, i64 0, i32 4
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %0, i64 0, i32 5
store i32 %11, i32* %12
%13 = bitcast %struct.v4l2_pix_format* %1 to <4 x i32>*
%14 = load <4 x i32>, <4 x i32>* %13
%15 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %0, i64 0, i32 1
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> %14, <4 x i32>* %16
%17 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %0, i64 0, i32 0
store i32 %2, i32* %17
ret void
}