void get_higher_spec_node(cc1, cc) int *cc1, cc;
{
  int loc, cc2, ext, st, anl;
  int found = 0;
  first_Construct(&loc, &cc2);
  while (loc > 0 && !found) {
    val_ext(&ext, cc2);
    if (ext == 1) {
      val_curMRIState(&st, cc2);
      val_anl(&anl, st);
      if (anl) {
        member_inc_ipt(&found, cc2, cc);
        if (found)
          *cc1 = cc2;
      }
    }
    if (!found) {
      next_Construct(&loc, &cc2, loc, cc2);
    }
  }
  if (!found)
    *cc1 = -1;
}


x86 assembly (clang, -O0):
<get_higher_spec_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x24(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1070 <first_Construct@plt>
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x25(%rbp)
jle    11a0 <get_higher_spec_node+0x40>
cmpl   $0x0,-0x24(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
test   $0x1,%al
jne    11b0 <get_higher_spec_node+0x50>
jmp    1240 <get_higher_spec_node+0xe0>
mov    -0x14(%rbp),%esi
lea    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1080 <val_ext@plt>
cmpl   $0x1,-0x18(%rbp)
jne    121c <get_higher_spec_node+0xbc>
mov    -0x14(%rbp),%esi
lea    -0x1c(%rbp),%rdi
mov    $0x0,%al
call   1040 <val_curMRIState@plt>
mov    -0x1c(%rbp),%esi
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1050 <val_anl@plt>
cmpl   $0x0,-0x20(%rbp)
je     1217 <get_higher_spec_node+0xb7>
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x24(%rbp),%rdi
mov    $0x0,%al
call   1060 <member_inc_ipt@plt>
cmpl   $0x0,-0x24(%rbp)
je     1212 <get_higher_spec_node+0xb2>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    1217 <get_higher_spec_node+0xb7>
jmp    121c <get_higher_spec_node+0xbc>
cmpl   $0x0,-0x24(%rbp)
jne    123b <get_higher_spec_node+0xdb>
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1030 <next_Construct@plt>
jmp    1185 <get_higher_spec_node+0x25>
cmpl   $0x0,-0x24(%rbp)
jne    1254 <get_higher_spec_node+0xf4>
mov    -0x8(%rbp),%rax
movl   $0xffffffff,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_higher_spec_node>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ebp
mov    %rdi,0x20(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1070 <first_Construct@plt>
movl   $0xffffffff,0x10(%rsp)
ff
cmpl   $0x0,0xc(%rsp)
jle    125d <get_higher_spec_node+0xfd>
lea    0x1c(%rsp),%rbx
lea    0x18(%rsp),%r15
lea    0x14(%rsp),%r12
lea    0xc(%rsp),%r14
lea    0x4(%rsp),%r13
nopw   0x0(%rax,%rax,1)
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <val_ext@plt>
cmpl   $0x1,0x1c(%rsp)
jne    1220 <get_higher_spec_node+0xc0>
mov    0x4(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <val_curMRIState@plt>
mov    0x18(%rsp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <val_anl@plt>
cmpl   $0x0,0x14(%rsp)
je     1220 <get_higher_spec_node+0xc0>
mov    0x4(%rsp),%esi
lea    0x8(%rsp),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <member_inc_ipt@plt>
cmpl   $0x0,0x8(%rsp)
je     1227 <get_higher_spec_node+0xc7>
jmp    1255 <get_higher_spec_node+0xf5>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpl   $0x0,0x8(%rsp)
jne    1268 <get_higher_spec_node+0x108>
mov    0xc(%rsp),%edx
mov    0x4(%rsp),%ecx
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <next_Construct@plt>
mov    0x8(%rsp),%eax
cmpl   $0x0,0xc(%rsp)
jle    124f <get_higher_spec_node+0xef>
test   %eax,%eax
je     11c0 <get_higher_spec_node+0x60>
test   %eax,%eax
jne    1268 <get_higher_spec_node+0x108>
jmp    125d <get_higher_spec_node+0xfd>
mov    0x4(%rsp),%eax
mov    %eax,0x10(%rsp)
mov    0x20(%rsp),%rax
mov    0x10(%rsp),%ecx
mov    %ecx,(%rax)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @get_higher_spec_node(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %10
%11 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @first_Construct to i32 (i32*, i32*, ...)*)(i32* %5, i32* %6)
br label %12
12: ; preds = %51, %2
%13 = load i32, i32* %5
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %10
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
br label %19
19: ; preds = %15, %12
%20 = phi i1 [ false, %12 ], [ %18, %15 ]
br i1 %20, label %21, label %52
21: ; preds = %19
%22 = load i32, i32* %6
%23 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_ext to i32 (i32*, i32, ...)*)(i32* %7, i32 %22)
%24 = load i32, i32* %7
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %44
26: ; preds = %21
%27 = load i32, i32* %6
%28 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_curMRIState to i32 (i32*, i32, ...)*)(i32* %8, i32 %27)
%29 = load i32, i32* %8
%30 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_anl to i32 (i32*, i32, ...)*)(i32* %9, i32 %29)
%31 = load i32, i32* %9
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %43
33: ; preds = %26
%34 = load i32, i32* %6
%35 = load i32, i32* %4
%36 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @member_inc_ipt to i32 (i32*, i32, i32, ...)*)(i32* %10, i32 %34, i32 %35)
%37 = load i32, i32* %10
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %33
%40 = load i32, i32* %6
%41 = load i32*, i32** %3
store i32 %40, i32* %41
br label %42
42: ; preds = %39, %33
br label %43
43: ; preds = %42, %26
br label %44
44: ; preds = %43, %21
%45 = load i32, i32* %10
%46 = icmp ne i32 %45, 0
br i1 %46, label %51, label %47
47: ; preds = %44
%48 = load i32, i32* %5
%49 = load i32, i32* %6
%50 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @next_Construct to i32 (i32*, i32*, i32, i32, ...)*)(i32* %5, i32* %6, i32 %48, i32 %49)
br label %51
51: ; preds = %47, %44
br label %12
52: ; preds = %19
%53 = load i32, i32* %10
%54 = icmp ne i32 %53, 0
br i1 %54, label %57, label %55
55: ; preds = %52
%56 = load i32*, i32** %3
store i32 -1, i32* %56
br label %57
57: ; preds = %55, %52
ret void
}

LLVM IR (-O2):
define void @get_higher_spec_node(i32* nocapture writeonly %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = bitcast i32* %8 to i8*
store i32 0, i32* %8
%15 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @first_Construct to i32 (i32*, i32*, ...)*)(i32* %3, i32* %4)
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %50
18: ; preds = %2, %40
%19 = load i32, i32* %4
%20 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_ext to i32 (i32*, i32, ...)*)(i32* %5, i32 %19)
%21 = load i32, i32* %5
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %37
23: ; preds = %18
%24 = load i32, i32* %4
%25 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_curMRIState to i32 (i32*, i32, ...)*)(i32* %6, i32 %24)
%26 = load i32, i32* %6
%27 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_anl to i32 (i32*, i32, ...)*)(i32* %7, i32 %26)
%28 = load i32, i32* %7
%29 = icmp eq i32 %28, 0
br i1 %29, label %37, label %30
30: ; preds = %23
%31 = load i32, i32* %4
%32 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @member_inc_ipt to i32 (i32*, i32, i32, ...)*)(i32* %8, i32 %31, i32 %1)
%33 = load i32, i32* %8
%34 = icmp eq i32 %33, 0
br i1 %34, label %40, label %35
35: ; preds = %30
%36 = load i32, i32* %4
br label %50
37: ; preds = %23, %18
%38 = load i32, i32* %8
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %52
40: ; preds = %37, %30
%41 = load i32, i32* %3
%42 = load i32, i32* %4
%43 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @next_Construct to i32 (i32*, i32*, i32, i32, ...)*)(i32* %3, i32* %4, i32 %41, i32 %42)
%44 = load i32, i32* %8
%45 = load i32, i32* %3
%46 = icmp sgt i32 %45, 0
%47 = icmp eq i32 %44, 0
%48 = select i1 %46, i1 %47, i1 false
br i1 %48, label %18, label %49
49: ; preds = %40
br i1 %47, label %50, label %52
50: ; preds = %49, %2, %35
%51 = phi i32 [ %36, %35 ], [ -1, %2 ], [ -1, %49 ]
store i32 %51, i32* %0
br label %52
52: ; preds = %37, %50, %49
ret void
}