#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_sequence(int, char *);
int /*<<< orphan*/ include_member(int, int, int);
int init_for(int);
int next_for(int);
int /*<<< orphan*/ sscanf(char *, char *, int *, char *);
int string_relation(char *, char *, char *);
void suffix_field(int from_set, int to_set, char *operator, char * value) {
  int o, t, rnumber;
  char suffix[8], sequence[8];
  for (o = init_for(from_set); o != 0; o = next_for(from_set)) {
    get_atom_sequence(o, sequence);
    sscanf(sequence, "%d%s", &rnumber, suffix);
    t = string_relation(operator, suffix, value);
    if (t)
      include_member(to_set, 6, o);
  }
}


x86 assembly (clang, -O0):
<suffix_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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     11f2 <suffix_field+0x92>
mov    -0x1c(%rbp),%edi
lea    -0x34(%rbp),%rsi
call   1070 <get_atom_sequence@plt>
lea    -0x34(%rbp),%rdi
lea    -0x2c(%rbp),%rcx
lea    0xe5a(%rip),%rsi
lea    -0x24(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <string_relation@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     11dd <suffix_field+0x7d>
mov    -0x8(%rbp),%edi
mov    -0x1c(%rbp),%edx
mov    $0x6,%esi
call   1060 <include_member@plt>
jmp    11e2 <suffix_field+0x82>
mov    -0x4(%rbp),%edi
call   1080 <next_for@plt>
mov    %eax,-0x1c(%rbp)
jmp    1181 <suffix_field+0x21>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suffix_field>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r14
mov    %rdx,%r12
mov    %esi,(%rsp)
mov    %edi,%ebp
call   1030 <init_for@plt>
test   %eax,%eax
je     11f4 <suffix_field+0x94>
mov    %eax,%r13d
lea    0x8(%rsp),%rbx
lea    0x10(%rsp),%r15
jmp    11ae <suffix_field+0x4e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1080 <next_for@plt>
mov    %eax,%r13d
test   %eax,%eax
je     11f4 <suffix_field+0x94>
mov    %r13d,%edi
mov    %rbx,%rsi
call   1070 <get_atom_sequence@plt>
mov    %rbx,%rdi
lea    0xe3d(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %r15,%rcx
call   1050 <sscanf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <string_relation@plt>
test   %eax,%eax
je     11a0 <suffix_field+0x40>
mov    (%rsp),%edi
mov    $0x6,%esi
mov    %r13d,%edx
call   1060 <include_member@plt>
jmp    11a0 <suffix_field+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%s\00"
define void @suffix_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 i32
%12 = alloca [8 x i8]
%13 = alloca [8 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%14 = load i32, i32* %5
%15 = call i32 @init_for(i32 %14)
store i32 %15, i32* %9
br label %16
16: ; preds = %37, %4
%17 = load i32, i32* %9
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %40
19: ; preds = %16
%20 = load i32, i32* %9
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %13, i64 0, i64 0
%22 = call i32 @get_atom_sequence(i32 %20, i8* %21)
%23 = getelementptr inbounds [8 x i8], [8 x i8]* %13, i64 0, i64 0
%24 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 0
%25 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %11, i8* %24)
%26 = load i8*, i8** %7
%27 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 0
%28 = load i8*, i8** %8
%29 = call i32 @string_relation(i8* %26, i8* %27, i8* %28)
store i32 %29, i32* %10
%30 = load i32, i32* %10
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %19
%33 = load i32, i32* %6
%34 = load i32, i32* %9
%35 = call i32 @include_member(i32 %33, i32 6, i32 %34)
br label %36
36: ; preds = %32, %19
br label %37
37: ; preds = %36
%38 = load i32, i32* %5
%39 = call i32 @next_for(i32 %38)
store i32 %39, i32* %9
br label %16
40: ; preds = %16
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%s\00"
define void @suffix_field(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca [8 x i8]
%7 = alloca [8 x i8]
%8 = bitcast i32* %5 to i8*
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%11 = tail call i32 @init_for(i32 %0)
%12 = icmp eq i32 %11, 0
br i1 %12, label %24, label %13
13: ; preds = %4, %21
%14 = phi i32 [ %22, %21 ], [ %11, %4 ]
%15 = call i32 @get_atom_sequence(i32 %14, i8* %10)
%16 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %5, i8* %9)
%17 = call i32 @string_relation(i8* %2, i8* %9, i8* %3)
%18 = icmp eq i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %13
%20 = call i32 @include_member(i32 %1, i32 6, i32 %14)
br label %21
21: ; preds = %13, %19
%22 = call i32 @next_for(i32 %0)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %13
24: ; preds = %21, %4
ret void
}