#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 */
typedef struct TYPE_10__ TYPE_5__;
typedef struct TYPE_9__ TYPE_4__;
typedef struct TYPE_8__ TYPE_3__;
typedef struct TYPE_7__ TYPE_2__;
typedef struct TYPE_6__ TYPE_1__;

/* Type definitions */
struct TYPE_8__ {
  void *height;
};
struct TYPE_9__ {
  TYPE_3__ w;
};
struct TYPE_7__ {
  void *height;
};
struct TYPE_6__ {
  void *height;
};
struct TYPE_10__ {
  TYPE_4__ win;
  TYPE_2__ pix_mp;
  TYPE_1__ pix;
};
struct v4l2_format {
  int type;
  TYPE_5__ fmt;
};
typedef void *__u32;

/* Variables and functions */
#define V4L2_BUF_TYPE_VIDEO_CAPTURE 133
#define V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE 132
#define V4L2_BUF_TYPE_VIDEO_OUTPUT 131
#define V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE 130
#define V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY 129
#define V4L2_BUF_TYPE_VIDEO_OVERLAY 128
void v4l_format_s_height(struct v4l2_format *fmt, __u32 height) {
  switch (fmt->type) {
  case V4L2_BUF_TYPE_VIDEO_CAPTURE:
  case V4L2_BUF_TYPE_VIDEO_OUTPUT:
    fmt->fmt.pix.height = height;
    break;
  case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
  case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
    fmt->fmt.pix_mp.height = height;
    break;
  case V4L2_BUF_TYPE_VIDEO_OVERLAY:
  case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
    fmt->fmt.win.w.height = height;
    break;
  }
}


x86 assembly (clang, -O0):
<v4l_format_s_height>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
add    $0xffffff80,%eax
sub    $0x2,%eax
jb     1194 <v4l_format_s_height+0x94>
jmp    1126 <v4l_format_s_height+0x26>
mov    -0x14(%rbp),%eax
sub    $0x82,%eax
je     1183 <v4l_format_s_height+0x83>
jmp    1139 <v4l_format_s_height+0x39>
mov    -0x14(%rbp),%eax
sub    $0x83,%eax
je     1172 <v4l_format_s_height+0x72>
jmp    114c <v4l_format_s_height+0x4c>
mov    -0x14(%rbp),%eax
sub    $0x84,%eax
je     1183 <v4l_format_s_height+0x83>
jmp    115f <v4l_format_s_height+0x5f>
mov    -0x14(%rbp),%eax
sub    $0x85,%eax
jne    11a0 <v4l_format_s_height+0xa0>
jmp    1172 <v4l_format_s_height+0x72>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
jmp    11a0 <v4l_format_s_height+0xa0>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
jmp    11a0 <v4l_format_s_height+0xa0>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4l_format_s_height>:
mov    (%rdi),%eax
add    $0xffffff80,%eax
cmp    $0x5,%eax
ja     1131 <v4l_format_s_height+0x31>
mov    $0x3,%ecx
bt     %eax,%ecx
jb     1124 <v4l_format_s_height+0x24>
mov    $0x14,%ecx
bt     %eax,%ecx
jae    112a <v4l_format_s_height+0x2a>
add    $0x10,%rdi
jmp    112e <v4l_format_s_height+0x2e>
add    $0x8,%rdi
jmp    112e <v4l_format_s_height+0x2e>
add    $0x18,%rdi
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.v4l2_format = type { i32, %struct.TYPE_10__ }
%struct.TYPE_10__ = type { %struct.TYPE_9__, %struct.TYPE_7__, %struct.TYPE_6__ }
%struct.TYPE_9__ = type { %struct.TYPE_8__ }
%struct.TYPE_8__ = type { i8* }
%struct.TYPE_7__ = type { i8* }
%struct.TYPE_6__ = type { i8* }
define void @v4l_format_s_height(%struct.v4l2_format* %0, i8* %1) {
%3 = alloca %struct.v4l2_format*
%4 = alloca i8*
store %struct.v4l2_format* %0, %struct.v4l2_format** %3
store i8* %1, i8** %4
%5 = load %struct.v4l2_format*, %struct.v4l2_format** %3
%6 = getelementptr inbounds %struct.v4l2_format, %struct.v4l2_format* %5, i32 0, i32 0
%7 = load i32, i32* %6
switch i32 %7, label %27 [
i32 133, label %8
i32 131, label %8
i32 132, label %14
i32 130, label %14
i32 128, label %20
i32 129, label %20
]
8: ; preds = %2, %2
%9 = load i8*, i8** %4
%10 = load %struct.v4l2_format*, %struct.v4l2_format** %3
%11 = getelementptr inbounds %struct.v4l2_format, %struct.v4l2_format* %10, i32 0, i32 1
%12 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %11, i32 0, i32 2
%13 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %12, i32 0, i32 0
store i8* %9, i8** %13
br label %27
14: ; preds = %2, %2
%15 = load i8*, i8** %4
%16 = load %struct.v4l2_format*, %struct.v4l2_format** %3
%17 = getelementptr inbounds %struct.v4l2_format, %struct.v4l2_format* %16, i32 0, i32 1
%18 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %17, i32 0, i32 1
%19 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %18, i32 0, i32 0
store i8* %15, i8** %19
br label %27
20: ; preds = %2, %2
%21 = load i8*, i8** %4
%22 = load %struct.v4l2_format*, %struct.v4l2_format** %3
%23 = getelementptr inbounds %struct.v4l2_format, %struct.v4l2_format* %22, i32 0, i32 1
%24 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %23, i32 0, i32 0
%25 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %24, i32 0, i32 0
%26 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %25, i32 0, i32 0
store i8* %21, i8** %26
br label %27
27: ; preds = %2, %20, %14, %8
ret void
}

LLVM IR (-O2):
%struct.v4l2_format = type { i32, %struct.TYPE_10__ }
%struct.TYPE_10__ = type { %struct.TYPE_9__, %struct.TYPE_7__, %struct.TYPE_6__ }
%struct.TYPE_9__ = type { %struct.TYPE_8__ }
%struct.TYPE_8__ = type { i8* }
%struct.TYPE_7__ = type { i8* }
%struct.TYPE_6__ = type { i8* }
define void @v4l_format_s_height(%struct.v4l2_format* nocapture %0, i8* %1) {
%3 = getelementptr inbounds %struct.v4l2_format, %struct.v4l2_format* %0, i64 0, i32 0
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 133, label %5
i32 131, label %5
i32 132, label %7
i32 130, label %7
i32 128, label %9
i32 129, label %9
]
5: ; preds = %2, %2
%6 = getelementptr inbounds %struct.v4l2_format, %struct.v4l2_format* %0, i64 0, i32 1, i32 2, i32 0
br label %11
7: ; preds = %2, %2
%8 = getelementptr inbounds %struct.v4l2_format, %struct.v4l2_format* %0, i64 0, i32 1, i32 1, i32 0
br label %11
9: ; preds = %2, %2
%10 = getelementptr inbounds %struct.v4l2_format, %struct.v4l2_format* %0, i64 0, i32 1, i32 0, i32 0, i32 0
br label %11
11: ; preds = %5, %7, %9
%12 = phi i8** [ %10, %9 ], [ %8, %7 ], [ %6, %5 ]
store i8* %1, i8** %12
br label %13
13: ; preds = %11, %2
ret void
}