#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 */

/* Variables and functions */
int /*<<< orphan*/ get_atom_kind(int, char *);
int /*<<< orphan*/ include_member(int, int, int);
int init_for(int);
int next_for(int);
int string_relation(char *, char *, char *);
void kind_field(int from_set, int to_set, char *operator, char * value) {
  int o, t;
  char kind[8];
  for (o = init_for(from_set); o != 0; o = next_for(from_set)) {
    get_atom_kind(o, kind);
    t = string_relation(operator, kind, value);
    if (t)
      include_member(to_set, 6, o);
  }
}


x86 assembly (clang, -O0):
<kind_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <init_for@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11ca <kind_field+0x7a>
mov    -0x1c(%rbp),%edi
lea    -0x28(%rbp),%rsi
call   1040 <get_atom_kind@plt>
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <string_relation@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     11b5 <kind_field+0x65>
mov    -0x8(%rbp),%edi
mov    -0x1c(%rbp),%edx
mov    $0x6,%esi
call   1060 <include_member@plt>
jmp    11ba <kind_field+0x6a>
mov    -0x4(%rbp),%edi
call   1070 <next_for@plt>
mov    %eax,-0x1c(%rbp)
jmp    1171 <kind_field+0x21>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kind_field>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r12
mov    %esi,%r15d
mov    %edi,%r13d
call   1030 <init_for@plt>
test   %eax,%eax
je     11bb <kind_field+0x6b>
mov    %eax,%ebp
mov    %rsp,%rbx
jmp    118e <kind_field+0x3e>
nopw   0x0(%rax,%rax,1)
mov    %r13d,%edi
call   1070 <next_for@plt>
mov    %eax,%ebp
test   %eax,%eax
je     11bb <kind_field+0x6b>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <get_atom_kind@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <string_relation@plt>
test   %eax,%eax
je     1180 <kind_field+0x30>
mov    %r15d,%edi
mov    $0x6,%esi
mov    %ebp,%edx
call   1060 <include_member@plt>
jmp    1180 <kind_field+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @kind_field(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca [8 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%12 = load i32, i32* %5
%13 = call i32 @init_for(i32 %12)
store i32 %13, i32* %9
br label %14
14: ; preds = %32, %4
%15 = load i32, i32* %9
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %35
17: ; preds = %14
%18 = load i32, i32* %9
%19 = getelementptr inbounds [8 x i8], [8 x i8]* %11, i64 0, i64 0
%20 = call i32 @get_atom_kind(i32 %18, i8* %19)
%21 = load i8*, i8** %7
%22 = getelementptr inbounds [8 x i8], [8 x i8]* %11, i64 0, i64 0
%23 = load i8*, i8** %8
%24 = call i32 @string_relation(i8* %21, i8* %22, i8* %23)
store i32 %24, i32* %10
%25 = load i32, i32* %10
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %17
%28 = load i32, i32* %6
%29 = load i32, i32* %9
%30 = call i32 @include_member(i32 %28, i32 6, i32 %29)
br label %31
31: ; preds = %27, %17
br label %32
32: ; preds = %31
%33 = load i32, i32* %5
%34 = call i32 @next_for(i32 %33)
store i32 %34, i32* %9
br label %14
35: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @kind_field(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca [8 x i8]
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%7 = tail call i32 @init_for(i32 %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %4, %16
%10 = phi i32 [ %17, %16 ], [ %7, %4 ]
%11 = call i32 @get_atom_kind(i32 %10, i8* %6)
%12 = call i32 @string_relation(i8* %2, i8* %6, i8* %3)
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %9
%15 = call i32 @include_member(i32 %1, i32 6, i32 %10)
br label %16
16: ; preds = %9, %14
%17 = call i32 @next_for(i32 %0)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %9
19: ; preds = %16, %4
ret void
}