#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 ssds_field {
  int dummy;
};
struct ssds_class {
  int dummy;
};

/* Variables and functions */
struct ssds_class *get_action_class(char *);
int get_sv_flen(char *, char *, int, int);
int get_sv_ftype(char *, char *, int);
scalar_t__ isdigit(char);
int sscanf(char *, char *, int *);
struct ssds_field *ssds_find_field(struct ssds_class *, char *, int, int);
struct ssds_field *ssds_get_field_id(struct ssds_class *, int);
struct ssds_field *ssds_get_field_num(struct ssds_class *, int);
int strlen(char *);
struct ssds_field *get_action_field(struct ssds_class *pclass, char *saction,
                                    int num) {
  int ret;
  int res;
  int id;
  struct ssds_field *pfield;
  char *sp;
  char *spn;
  char name[32];
  char f_type[32];
  int ftnum;
  int ftlen;
  pfield = NULL;
  if (!pclass) {
    pclass = get_action_class(saction);
  }
  if (pclass) {
    sp = saction;
    while (num--) {
      while (*sp && (*sp != '.') && (*sp != '=') && (*sp != '&'))
        sp++;
      if (*sp == '.')
        sp++;
    }
    spn = name;
    while (*sp && (*sp != '.') && (*sp != '=') && (*sp != '&')) {
      *spn++ = *sp++;
    }
    *spn = 0;
    sp = name;
    ret = -1;
    if ((*sp == '0') && (strlen(name) == 1)) {
      ret = 0;
      pfield = ssds_get_field_num(pclass, ret);
    } else if (*sp == '0' && (isdigit(*(sp + 1)))) {
      res = sscanf(sp, "0%d", &ret);
      if (res)
        pfield = ssds_get_field_num(pclass, ret);
    } else if (isdigit(*sp)) {
      res = sscanf(sp, "%d", &id);
      if (res)
        pfield = ssds_get_field_id(pclass, id);
    } else {
      ftnum = get_sv_ftype(f_type, saction, 32);
      ftlen = get_sv_flen(f_type, saction, 32, ftnum);
      if (strlen(name) > 0)
        pfield = ssds_find_field(pclass, name, ftnum, ftlen);
    }
  }
  return pfield;
}


x86 assembly (clang, -O0):
<get_action_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    11c6 <get_action_field+0x36>
mov    -0x10(%rbp),%rdi
call   1080 <get_action_class@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     14a5 <get_action_field+0x315>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1292 <get_action_field+0x102>
jmp    11f2 <get_action_field+0x62>
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x89(%rbp)
je     124d <get_action_field+0xbd>
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x89(%rbp)
je     124d <get_action_field+0xbd>
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x3d,%ecx
mov    %al,-0x89(%rbp)
je     124d <get_action_field+0xbd>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x26,%eax
setne  %al
mov    %al,-0x89(%rbp)
mov    -0x89(%rbp),%al
test   $0x1,%al
jne    1260 <get_action_field+0xd0>
jmp    1271 <get_action_field+0xe1>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    11f2 <get_action_field+0x62>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    128d <get_action_field+0xfd>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    11d9 <get_action_field+0x49>
lea    -0x60(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x8a(%rbp)
je     12f5 <get_action_field+0x165>
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x8a(%rbp)
je     12f5 <get_action_field+0x165>
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x3d,%ecx
mov    %al,-0x8a(%rbp)
je     12f5 <get_action_field+0x165>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x26,%eax
setne  %al
mov    %al,-0x8a(%rbp)
mov    -0x8a(%rbp),%al
test   $0x1,%al
jne    1308 <get_action_field+0x178>
jmp    132f <get_action_field+0x19f>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
mov    (%rax),%cl
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x38(%rbp)
mov    %cl,(%rax)
jmp    129a <get_action_field+0x10a>
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x60(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0xffffffff,-0x18(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1383 <get_action_field+0x1f3>
lea    -0x60(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x1,%eax
jne    1383 <get_action_field+0x1f3>
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1060 <ssds_get_field_num@plt>
mov    %rax,-0x28(%rbp)
jmp    14a0 <get_action_field+0x310>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    13e0 <get_action_field+0x250>
mov    -0x30(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     13e0 <get_action_field+0x250>
mov    -0x30(%rbp),%rdi
lea    0xc4b(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   10a0 <sscanf@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     13db <get_action_field+0x24b>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1060 <ssds_get_field_num@plt>
mov    %rax,-0x28(%rbp)
jmp    149b <get_action_field+0x30b>
mov    -0x30(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     142c <get_action_field+0x29c>
mov    -0x30(%rbp),%rdi
lea    0xc00(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   10a0 <sscanf@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1427 <get_action_field+0x297>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1090 <ssds_get_field_id@plt>
mov    %rax,-0x28(%rbp)
jmp    1496 <get_action_field+0x306>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x20,%edx
call   1070 <get_sv_ftype@plt>
mov    %eax,-0x84(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x84(%rbp),%ecx
mov    $0x20,%edx
call   10b0 <get_sv_flen@plt>
mov    %eax,-0x88(%rbp)
lea    -0x60(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%eax
jle    1491 <get_action_field+0x301>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x84(%rbp),%edx
mov    -0x88(%rbp),%ecx
call   1040 <ssds_find_field@plt>
mov    %rax,-0x28(%rbp)
jmp    1496 <get_action_field+0x306>
jmp    149b <get_action_field+0x30b>
jmp    14a0 <get_action_field+0x310>
jmp    14a5 <get_action_field+0x315>
mov    -0x28(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_action_field>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %edx,%ebx
mov    %rsi,%r15
mov    %rdi,%r14
test   %rdi,%rdi
jne    11bb <get_action_field+0x2b>
mov    %r15,%rdi
call   1080 <get_action_class@plt>
mov    %rax,%r14
test   %rax,%rax
je     13a7 <get_action_field+0x217>
movabs $0x2000404000000001,%rax
mov    %r15,%rcx
test   %ebx,%ebx
je     1282 <get_action_field+0xf2>
mov    %ebx,%edx
mov    %r15,%rcx
test   $0x1,%bl
je     1210 <get_action_field+0x80>
lea    -0x1(%rbx),%edx
mov    %r15,%rcx
jmp    11f4 <get_action_field+0x64>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rcx
movzbl (%rcx),%esi
cmp    $0x3d,%rsi
ja     11f0 <get_action_field+0x60>
bt     %rsi,%rax
jae    11f0 <get_action_field+0x60>
xor    %edi,%edi
cmp    $0x2e,%sil
sete   %dil
add    %rdi,%rcx
cmp    $0x1,%ebx
jne    1224 <get_action_field+0x94>
jmp    1282 <get_action_field+0xf2>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rcx
movzbl (%rcx),%esi
cmp    $0x3d,%rsi
ja     1220 <get_action_field+0x90>
bt     %rsi,%rax
jae    1220 <get_action_field+0x90>
xor    %edi,%edi
cmp    $0x2e,%sil
sete   %dil
add    %rdi,%rcx
add    $0xfffffffe,%edx
mov    %rcx,%rsi
jmp    1254 <get_action_field+0xc4>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rsi
movzbl (%rsi),%edi
cmp    $0x3d,%rdi
ja     1250 <get_action_field+0xc0>
bt     %rdi,%rax
jae    1250 <get_action_field+0xc0>
xor    %ecx,%ecx
cmp    $0x2e,%dil
sete   %cl
add    %rsi,%rcx
test   %edx,%edx
jne    1224 <get_action_field+0x94>
xor    %ecx,%ecx
cmp    $0x2e,%dil
sete   %cl
add    %rcx,%rsi
mov    %rsi,%rcx
xor    %edx,%edx
jmp    1299 <get_action_field+0x109>
cs nopw 0x0(%rax,%rax,1)
mov    %sil,0x10(%rsp,%rdx,1)
add    $0x1,%rdx
movzbl (%rcx,%rdx,1),%esi
cmp    $0x3d,%rsi
ja     1290 <get_action_field+0x100>
bt     %rsi,%rax
jae    1290 <get_action_field+0x100>
movb   $0x0,0x10(%rsp,%rdx,1)
movl   $0xffffffff,0xc(%rsp)
ff
mov    0x10(%rsp),%al
cmp    $0x30,%al
jne    1326 <get_action_field+0x196>
lea    0x10(%rsp),%rdi
call   1050 <strlen@plt>
cmp    $0x1,%eax
jne    12dc <get_action_field+0x14c>
mov    %r14,%rdi
xor    %esi,%esi
call   1060 <ssds_get_field_num@plt>
jmp    13a9 <get_action_field+0x219>
mov    0x10(%rsp),%al
cmp    $0x30,%al
jne    1326 <get_action_field+0x196>
movsbl 0x11(%rsp),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1322 <get_action_field+0x192>
lea    0xd06(%rip),%rsi
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
call   10a0 <sscanf@plt>
test   %eax,%eax
je     13a7 <get_action_field+0x217>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
call   1060 <ssds_get_field_num@plt>
jmp    13a9 <get_action_field+0x219>
mov    0x10(%rsp),%al
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     135b <get_action_field+0x1cb>
lea    0xcc7(%rip),%rsi
lea    0x10(%rsp),%rdi
lea    0x30(%rsp),%rdx
call   10a0 <sscanf@plt>
test   %eax,%eax
je     13a7 <get_action_field+0x217>
mov    0x30(%rsp),%esi
mov    %r14,%rdi
call   1090 <ssds_get_field_id@plt>
jmp    13a9 <get_action_field+0x219>
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x20,%edx
call   1070 <get_sv_ftype@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x20,%edx
mov    %eax,%ecx
call   10b0 <get_sv_flen@plt>
mov    %eax,%ebp
lea    0x10(%rsp),%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    13a7 <get_action_field+0x217>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1040 <ssds_find_field@plt>
jmp    13a9 <get_action_field+0x219>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ssds_field = type { i32 }
%struct.ssds_class = type { i32 }
@.str = [4 x i8] c"0%d\00"
@.str.1 = [3 x i8] c"%d\00"
define %struct.ssds_field* @get_action_field(%struct.ssds_class* %0, i8* %1, i32 %2) {
%4 = alloca %struct.ssds_class*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.ssds_field*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca [32 x i8]
%14 = alloca [32 x i8]
%15 = alloca i32
%16 = alloca i32
store %struct.ssds_class* %0, %struct.ssds_class** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store %struct.ssds_field* null, %struct.ssds_field** %10
%17 = load %struct.ssds_class*, %struct.ssds_class** %4
%18 = icmp ne %struct.ssds_class* %17, null
br i1 %18, label %22, label %19
19: ; preds = %3
%20 = load i8*, i8** %5
%21 = call %struct.ssds_class* @get_action_class(i8* %20)
store %struct.ssds_class* %21, %struct.ssds_class** %4
br label %22
22: ; preds = %19, %3
%23 = load %struct.ssds_class*, %struct.ssds_class** %4
%24 = icmp ne %struct.ssds_class* %23, null
br i1 %24, label %25, label %168
25: ; preds = %22
%26 = load i8*, i8** %5
store i8* %26, i8** %11
br label %27
27: ; preds = %65, %25
%28 = load i32, i32* %6
%29 = add nsw i32 %28, -1
store i32 %29, i32* %6
%30 = icmp ne i32 %28, 0
br i1 %30, label %31, label %66
31: ; preds = %27
br label %32
32: ; preds = %54, %31
%33 = load i8*, i8** %11
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %52
37: ; preds = %32
%38 = load i8*, i8** %11
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp ne i32 %40, 46
br i1 %41, label %42, label %52
42: ; preds = %37
%43 = load i8*, i8** %11
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = icmp ne i32 %45, 61
br i1 %46, label %47, label %52
47: ; preds = %42
%48 = load i8*, i8** %11
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp ne i32 %50, 38
br label %52
52: ; preds = %47, %42, %37, %32
%53 = phi i1 [ false, %42 ], [ false, %37 ], [ false, %32 ], [ %51, %47 ]
br i1 %53, label %54, label %57
54: ; preds = %52
%55 = load i8*, i8** %11
%56 = getelementptr inbounds i8, i8* %55, i32 1
store i8* %56, i8** %11
br label %32
57: ; preds = %52
%58 = load i8*, i8** %11
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %60, 46
br i1 %61, label %62, label %65
62: ; preds = %57
%63 = load i8*, i8** %11
%64 = getelementptr inbounds i8, i8* %63, i32 1
store i8* %64, i8** %11
br label %65
65: ; preds = %62, %57
br label %27
66: ; preds = %27
%67 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
store i8* %67, i8** %12
br label %68
68: ; preds = %90, %66
%69 = load i8*, i8** %11
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp ne i32 %71, 0
br i1 %72, label %73, label %88
73: ; preds = %68
%74 = load i8*, i8** %11
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp ne i32 %76, 46
br i1 %77, label %78, label %88
78: ; preds = %73
%79 = load i8*, i8** %11
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp ne i32 %81, 61
br i1 %82, label %83, label %88
83: ; preds = %78
%84 = load i8*, i8** %11
%85 = load i8, i8* %84
%86 = sext i8 %85 to i32
%87 = icmp ne i32 %86, 38
br label %88
88: ; preds = %83, %78, %73, %68
%89 = phi i1 [ false, %78 ], [ false, %73 ], [ false, %68 ], [ %87, %83 ]
br i1 %89, label %90, label %96
90: ; preds = %88
%91 = load i8*, i8** %11
%92 = getelementptr inbounds i8, i8* %91, i32 1
store i8* %92, i8** %11
%93 = load i8, i8* %91
%94 = load i8*, i8** %12
%95 = getelementptr inbounds i8, i8* %94, i32 1
store i8* %95, i8** %12
store i8 %93, i8* %94
br label %68
96: ; preds = %88
%97 = load i8*, i8** %12
store i8 0, i8* %97
%98 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
store i8* %98, i8** %11
store i32 -1, i32* %7
%99 = load i8*, i8** %11
%100 = load i8, i8* %99
%101 = sext i8 %100 to i32
%102 = icmp eq i32 %101, 48
br i1 %102, label %103, label %111
103: ; preds = %96
%104 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%105 = call i32 @strlen(i8* %104)
%106 = icmp eq i32 %105, 1
br i1 %106, label %107, label %111
107: ; preds = %103
store i32 0, i32* %7
%108 = load %struct.ssds_class*, %struct.ssds_class** %4
%109 = load i32, i32* %7
%110 = call %struct.ssds_field* @ssds_get_field_num(%struct.ssds_class* %108, i32 %109)
store %struct.ssds_field* %110, %struct.ssds_field** %10
br label %167
111: ; preds = %103, %96
%112 = load i8*, i8** %11
%113 = load i8, i8* %112
%114 = sext i8 %113 to i32
%115 = icmp eq i32 %114, 48
br i1 %115, label %116, label %132
116: ; preds = %111
%117 = load i8*, i8** %11
%118 = getelementptr inbounds i8, i8* %117, i64 1
%119 = load i8, i8* %118
%120 = call i64 @isdigit(i8 signext %119)
%121 = icmp ne i64 %120, 0
br i1 %121, label %122, label %132
122: ; preds = %116
%123 = load i8*, i8** %11
%124 = call i32 @sscanf(i8* %123, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %7)
store i32 %124, i32* %8
%125 = load i32, i32* %8
%126 = icmp ne i32 %125, 0
br i1 %126, label %127, label %131
127: ; preds = %122
%128 = load %struct.ssds_class*, %struct.ssds_class** %4
%129 = load i32, i32* %7
%130 = call %struct.ssds_field* @ssds_get_field_num(%struct.ssds_class* %128, i32 %129)
store %struct.ssds_field* %130, %struct.ssds_field** %10
br label %131
131: ; preds = %127, %122
br label %166
132: ; preds = %116, %111
%133 = load i8*, i8** %11
%134 = load i8, i8* %133
%135 = call i64 @isdigit(i8 signext %134)
%136 = icmp ne i64 %135, 0
br i1 %136, label %137, label %147
137: ; preds = %132
%138 = load i8*, i8** %11
%139 = call i32 @sscanf(i8* %138, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
store i32 %139, i32* %8
%140 = load i32, i32* %8
%141 = icmp ne i32 %140, 0
br i1 %141, label %142, label %146
142: ; preds = %137
%143 = load %struct.ssds_class*, %struct.ssds_class** %4
%144 = load i32, i32* %9
%145 = call %struct.ssds_field* @ssds_get_field_id(%struct.ssds_class* %143, i32 %144)
store %struct.ssds_field* %145, %struct.ssds_field** %10
br label %146
146: ; preds = %142, %137
br label %165
147: ; preds = %132
%148 = getelementptr inbounds [32 x i8], [32 x i8]* %14, i64 0, i64 0
%149 = load i8*, i8** %5
%150 = call i32 @get_sv_ftype(i8* %148, i8* %149, i32 32)
store i32 %150, i32* %15
%151 = getelementptr inbounds [32 x i8], [32 x i8]* %14, i64 0, i64 0
%152 = load i8*, i8** %5
%153 = load i32, i32* %15
%154 = call i32 @get_sv_flen(i8* %151, i8* %152, i32 32, i32 %153)
store i32 %154, i32* %16
%155 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%156 = call i32 @strlen(i8* %155)
%157 = icmp sgt i32 %156, 0
br i1 %157, label %158, label %164
158: ; preds = %147
%159 = load %struct.ssds_class*, %struct.ssds_class** %4
%160 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%161 = load i32, i32* %15
%162 = load i32, i32* %16
%163 = call %struct.ssds_field* @ssds_find_field(%struct.ssds_class* %159, i8* %160, i32 %161, i32 %162)
store %struct.ssds_field* %163, %struct.ssds_field** %10
br label %164
164: ; preds = %158, %147
br label %165
165: ; preds = %164, %146
br label %166
166: ; preds = %165, %131
br label %167
167: ; preds = %166, %107
br label %168
168: ; preds = %167, %22
%169 = load %struct.ssds_field*, %struct.ssds_field** %10
ret %struct.ssds_field* %169
}

LLVM IR (-O2):
%struct.ssds_field = type { i32 }
%struct.ssds_class = type { i32 }
@.str = [4 x i8] c"0%d\00"
@.str.1 = [3 x i8] c"%d\00"
define %struct.ssds_field* @get_action_field(%struct.ssds_class* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca [32 x i8]
%7 = alloca [32 x i8]
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%12 = icmp eq %struct.ssds_class* %0, null
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = tail call %struct.ssds_class* @get_action_class(i8* %1)
%15 = icmp eq %struct.ssds_class* %14, null
br i1 %15, label %111, label %16
16: ; preds = %3, %13
%17 = phi %struct.ssds_class* [ %14, %13 ], [ %0, %3 ]
%18 = icmp eq i32 %2, 0
br i1 %18, label %61, label %19
19: ; preds = %16
%20 = and i32 %2, 1
%21 = icmp eq i32 %20, 0
br i1 %21, label %33, label %22
22: ; preds = %19
%23 = add nsw i32 %2, -1
br label %24
24: ; preds = %31, %22
%25 = phi i8* [ %32, %31 ], [ %1, %22 ]
%26 = load i8, i8* %25
switch i8 %26, label %31 [
i8 0, label %27
i8 46, label %27
i8 61, label %27
i8 38, label %27
]
27: ; preds = %24, %24, %24, %24
%28 = icmp eq i8 %26, 46
%29 = zext i1 %28 to i64
%30 = getelementptr i8, i8* %25, i64 %29
br label %33
31: ; preds = %24
%32 = getelementptr inbounds i8, i8* %25, i64 1
br label %24
33: ; preds = %27, %19
%34 = phi i8* [ undef, %19 ], [ %30, %27 ]
%35 = phi i32 [ %2, %19 ], [ %23, %27 ]
%36 = phi i8* [ %1, %19 ], [ %30, %27 ]
%37 = icmp eq i32 %2, 1
br i1 %37, label %61, label %38
38: ; preds = %33, %54
%39 = phi i32 [ %50, %54 ], [ %35, %33 ]
%40 = phi i8* [ %57, %54 ], [ %36, %33 ]
br label %41
41: ; preds = %38, %44
%42 = phi i8* [ %45, %44 ], [ %40, %38 ]
%43 = load i8, i8* %42
switch i8 %43, label %44 [
i8 0, label %46
i8 46, label %46
i8 61, label %46
i8 38, label %46
]
44: ; preds = %41
%45 = getelementptr inbounds i8, i8* %42, i64 1
br label %41
46: ; preds = %41, %41, %41, %41
%47 = icmp eq i8 %43, 46
%48 = zext i1 %47 to i64
%49 = getelementptr i8, i8* %42, i64 %48
%50 = add nsw i32 %39, -2
br label %51
51: ; preds = %59, %46
%52 = phi i8* [ %60, %59 ], [ %49, %46 ]
%53 = load i8, i8* %52
switch i8 %53, label %59 [
i8 0, label %54
i8 46, label %54
i8 61, label %54
i8 38, label %54
]
54: ; preds = %51, %51, %51, %51
%55 = icmp eq i8 %53, 46
%56 = zext i1 %55 to i64
%57 = getelementptr i8, i8* %52, i64 %56
%58 = icmp eq i32 %50, 0
br i1 %58, label %61, label %38
59: ; preds = %51
%60 = getelementptr inbounds i8, i8* %52, i64 1
br label %51
61: ; preds = %33, %54, %16
%62 = phi i8* [ %1, %16 ], [ %34, %33 ], [ %57, %54 ]
br label %63
63: ; preds = %61, %67
%64 = phi i8* [ %68, %67 ], [ %62, %61 ]
%65 = phi i8* [ %69, %67 ], [ %10, %61 ]
%66 = load i8, i8* %64
switch i8 %66, label %67 [
i8 0, label %70
i8 46, label %70
i8 61, label %70
i8 38, label %70
]
67: ; preds = %63
%68 = getelementptr inbounds i8, i8* %64, i64 1
%69 = getelementptr inbounds i8, i8* %65, i64 1
store i8 %66, i8* %65
br label %63
70: ; preds = %63, %63, %63, %63
store i8 0, i8* %65
store i32 -1, i32* %4
%71 = load i8, i8* %10
%72 = icmp eq i8 %71, 48
br i1 %72, label %73, label %94
73: ; preds = %70
%74 = call i32 @strlen(i8* %10)
%75 = icmp eq i32 %74, 1
br i1 %75, label %76, label %78
76: ; preds = %73
%77 = call %struct.ssds_field* @ssds_get_field_num(%struct.ssds_class* %17, i32 0)
br label %111
78: ; preds = %73
%79 = load i8, i8* %10
%80 = icmp eq i8 %79, 48
br i1 %80, label %81, label %94
81: ; preds = %78
%82 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 1
%83 = load i8, i8* %82
%84 = call i64 @isdigit(i8 signext %83)
%85 = icmp eq i64 %84, 0
br i1 %85, label %86, label %88
86: ; preds = %81
%87 = load i8, i8* %10
br label %94
88: ; preds = %81
%89 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %4)
%90 = icmp eq i32 %89, 0
br i1 %90, label %111, label %91
91: ; preds = %88
%92 = load i32, i32* %4
%93 = call %struct.ssds_field* @ssds_get_field_num(%struct.ssds_class* %17, i32 %92)
br label %111
94: ; preds = %86, %70, %78
%95 = phi i8 [ %87, %86 ], [ %71, %70 ], [ %79, %78 ]
%96 = call i64 @isdigit(i8 signext %95)
%97 = icmp eq i64 %96, 0
br i1 %97, label %104, label %98
98: ; preds = %94
%99 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%100 = icmp eq i32 %99, 0
br i1 %100, label %111, label %101
101: ; preds = %98
%102 = load i32, i32* %5
%103 = call %struct.ssds_field* @ssds_get_field_id(%struct.ssds_class* %17, i32 %102)
br label %111
104: ; preds = %94
%105 = call i32 @get_sv_ftype(i8* %11, i8* %1, i32 32)
%106 = call i32 @get_sv_flen(i8* %11, i8* %1, i32 32, i32 %105)
%107 = call i32 @strlen(i8* %10)
%108 = icmp sgt i32 %107, 0
br i1 %108, label %109, label %111
109: ; preds = %104
%110 = call %struct.ssds_field* @ssds_find_field(%struct.ssds_class* %17, i8* %10, i32 %105, i32 %106)
br label %111
111: ; preds = %76, %101, %98, %109, %104, %88, %91, %13
%112 = phi %struct.ssds_field* [ %77, %76 ], [ %93, %91 ], [ null, %88 ], [ %103, %101 ], [ null, %98 ], [ %110, %109 ], [ null, %104 ], [ null, %13 ]
ret %struct.ssds_field* %112
}