#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*/ colorspace;
  int /*<<< orphan*/ field;
  int /*<<< orphan*/ height;
  int /*<<< orphan*/ width;
};
struct v4l2_mbus_framefmt {
  int code;
  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->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    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>:
movups (%rsi),%xmm0
movups %xmm0,0x4(%rdi)
mov    %edx,(%rdi)
ret

LLVM IR (-O0):
%struct.v4l2_mbus_framefmt = type { i32, i32, i32, i32, i32 }
%struct.v4l2_pix_format = type { 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 3
%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 4
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 2
%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 3
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 1
%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 2
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 0
%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 1
store i32 %24, i32* %26
%27 = load i32, i32* %6
%28 = load %struct.v4l2_mbus_framefmt*, %struct.v4l2_mbus_framefmt** %4
%29 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %28, i32 0, i32 0
store i32 %27, i32* %29
ret void
}

LLVM IR (-O2):
%struct.v4l2_mbus_framefmt = type { i32, i32, i32, i32, i32 }
%struct.v4l2_pix_format = type { 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 = bitcast %struct.v4l2_pix_format* %1 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %0, i64 0, i32 1
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %7
%8 = getelementptr inbounds %struct.v4l2_mbus_framefmt, %struct.v4l2_mbus_framefmt* %0, i64 0, i32 0
store i32 %2, i32* %8
ret void
}