#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_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned short count_styles;
  int *supported_styles;
};
typedef TYPE_1__ XIMStyles;
typedef int XIMStyle;

/* Variables and functions */
bool supports_style(XIMStyles *styles, XIMStyle desiredStyle) {
  unsigned short i;
  XIMStyle style;
  for (i = 0; i < styles->count_styles; i++) {
    style = styles->supported_styles[i];
    if ((style & desiredStyle) == style) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<supports_style>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movw   $0x0,-0x16(%rbp)
movzwl -0x16(%rbp),%eax
mov    -0x10(%rbp),%rcx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jge    1167 <supports_style+0x67>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movzwl -0x16(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
and    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1151 <supports_style+0x51>
movl   $0x1,-0x4(%rbp)
jmp    116e <supports_style+0x6e>
jmp    1156 <supports_style+0x56>
mov    -0x16(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x16(%rbp)
jmp    1111 <supports_style+0x11>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<supports_style>:
movzwl (%rdi),%eax
test   %rax,%rax
je     111e <supports_style+0x1e>
mov    0x8(%rdi),%rcx
xor    %edx,%edx
not    %esi
test   %esi,(%rcx,%rdx,4)
je     1121 <supports_style+0x21>
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1110 <supports_style+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i16, i32* }
define i32 @supports_style(%struct.TYPE_3__* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_3__*
%5 = alloca i32
%6 = alloca i16
%7 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %4
store i32 %1, i32* %5
store i16 0, i16* %6
br label %8
8: ; preds = %31, %2
%9 = load i16, i16* %6
%10 = zext i16 %9 to i32
%11 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i32 0, i32 0
%13 = load i16, i16* %12
%14 = zext i16 %13 to i32
%15 = icmp slt i32 %10, %14
br i1 %15, label %16, label %34
16: ; preds = %8
%17 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %17, i32 0, i32 1
%19 = load i32*, i32** %18
%20 = load i16, i16* %6
%21 = zext i16 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = load i32, i32* %5
%26 = and i32 %24, %25
%27 = load i32, i32* %7
%28 = icmp eq i32 %26, %27
br i1 %28, label %29, label %30
29: ; preds = %16
store i32 1, i32* %3
br label %35
30: ; preds = %16
br label %31
31: ; preds = %30
%32 = load i16, i16* %6
%33 = add i16 %32, 1
store i16 %33, i16* %6
br label %8
34: ; preds = %8
store i32 0, i32* %3
br label %35
35: ; preds = %34, %29
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i16, i32* }
define i32 @supports_style(%struct.TYPE_3__* nocapture %0, i32 %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%4 = load i16, i16* %3
%5 = icmp eq i16 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %2
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%8 = load i32*, i32** %7
%9 = zext i16 %4 to i64
br label %12
10: ; preds = %12
%11 = icmp eq i64 %18, %9
br i1 %11, label %19, label %12
12: ; preds = %6, %10
%13 = phi i64 [ 0, %6 ], [ %18, %10 ]
%14 = getelementptr inbounds i32, i32* %8, i64 %13
%15 = load i32, i32* %14
%16 = and i32 %15, %1
%17 = icmp eq i32 %16, %15
%18 = add nuw nsw i64 %13, 1
br i1 %17, label %19, label %10
19: ; preds = %12, %10, %2
%20 = phi i32 [ 0, %2 ], [ 0, %10 ], [ 1, %12 ]
ret i32 %20
}