void MRIState_NEXT_FNC_OBJ(cc, ss, oc, os) int *cc, *ss, oc, os;
{
  int c, i, b;
  c = oc - 1;
  if (c != 0) {
    i = os - 1;
    MRIState_XST_FNC_OBJ(&b, i);
    while (b != 1 && i != 0) {
      i = i - 1;
      MRIState_XST_FNC_OBJ(&b, i);
    }
    *ss = i;
    *cc = c;
  } else {
    *ss = 0;
    *cc = 0;
  }
}


x86 assembly (clang, -O0):
<MRIState_NEXT_FNC_OBJ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11ac <MRIState_NEXT_FNC_OBJ+0x9c>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    -0x24(%rbp),%rdi
mov    $0x0,%al
call   1030 <MRIState_XST_FNC_OBJ@plt>
xor    %eax,%eax
cmpl   $0x1,-0x24(%rbp)
mov    %al,-0x25(%rbp)
je     1169 <MRIState_NEXT_FNC_OBJ+0x59>
cmpl   $0x0,-0x20(%rbp)
setne  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
test   $0x1,%al
jne    1179 <MRIState_NEXT_FNC_OBJ+0x69>
jmp    1195 <MRIState_NEXT_FNC_OBJ+0x85>
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    -0x24(%rbp),%rdi
mov    $0x0,%al
call   1030 <MRIState_XST_FNC_OBJ@plt>
jmp    1150 <MRIState_NEXT_FNC_OBJ+0x40>
mov    -0x20(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    11c0 <MRIState_NEXT_FNC_OBJ+0xb0>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MRIState_NEXT_FNC_OBJ>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r12d
mov    %rsi,%r15
mov    %rdi,%r14
add    $0xffffffff,%r12d
je     117d <MRIState_NEXT_FNC_OBJ+0x6d>
mov    %ecx,%r13d
lea    -0x1(%r13),%esi
lea    0x4(%rsp),%rdi
xor    %eax,%eax
call   1030 <MRIState_XST_FNC_OBJ@plt>
mov    %r13d,%ebp
add    $0xffffffff,%ebp
je     117f <MRIState_NEXT_FNC_OBJ+0x6f>
cmpl   $0x1,0x4(%rsp)
je     117f <MRIState_NEXT_FNC_OBJ+0x6f>
add    $0xfffffffe,%r13d
lea    0x4(%rsp),%rbx
mov    %r13d,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <MRIState_XST_FNC_OBJ@plt>
add    $0xffffffff,%ebp
jae    1178 <MRIState_NEXT_FNC_OBJ+0x68>
cmpl   $0x1,0x4(%rsp)
jne    1160 <MRIState_NEXT_FNC_OBJ+0x50>
add    $0x1,%ebp
jmp    117f <MRIState_NEXT_FNC_OBJ+0x6f>
xor    %ebp,%ebp
mov    %ebp,(%r15)
mov    %r12d,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @MRIState_NEXT_FNC_OBJ(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i32, i32* %7
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %39
16: ; preds = %4
%17 = load i32, i32* %8
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %10
%19 = load i32, i32* %10
%20 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @MRIState_XST_FNC_OBJ to i32 (i32*, i32, ...)*)(i32* %11, i32 %19)
br label %21
21: ; preds = %29, %16
%22 = load i32, i32* %11
%23 = icmp ne i32 %22, 1
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %10
%26 = icmp ne i32 %25, 0
br label %27
27: ; preds = %24, %21
%28 = phi i1 [ false, %21 ], [ %26, %24 ]
br i1 %28, label %29, label %34
29: ; preds = %27
%30 = load i32, i32* %10
%31 = sub nsw i32 %30, 1
store i32 %31, i32* %10
%32 = load i32, i32* %10
%33 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @MRIState_XST_FNC_OBJ to i32 (i32*, i32, ...)*)(i32* %11, i32 %32)
br label %21
34: ; preds = %27
%35 = load i32, i32* %10
%36 = load i32*, i32** %6
store i32 %35, i32* %36
%37 = load i32, i32* %9
%38 = load i32*, i32** %5
store i32 %37, i32* %38
br label %42
39: ; preds = %4
%40 = load i32*, i32** %6
store i32 0, i32* %40
%41 = load i32*, i32** %5
store i32 0, i32* %41
br label %42
42: ; preds = %39, %34
ret void
}

LLVM IR (-O2):
define void @MRIState_NEXT_FNC_OBJ(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = add nsw i32 %2, -1
%8 = icmp eq i32 %7, 0
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = add nsw i32 %3, -1
%11 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @MRIState_XST_FNC_OBJ to i32 (i32*, i32, ...)*)(i32* %5, i32 %10)
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 1
%14 = icmp ne i32 %10, 0
%15 = and i1 %14, %13
br i1 %15, label %16, label %24
16: ; preds = %9, %16
%17 = phi i32 [ %18, %16 ], [ %10, %9 ]
%18 = add nsw i32 %17, -1
%19 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @MRIState_XST_FNC_OBJ to i32 (i32*, i32, ...)*)(i32* %5, i32 %18)
%20 = load i32, i32* %5
%21 = icmp ne i32 %20, 1
%22 = icmp ne i32 %18, 0
%23 = and i1 %22, %21
br i1 %23, label %16, label %24
24: ; preds = %16, %9, %4
%25 = phi i32 [ 0, %4 ], [ %10, %9 ], [ %18, %16 ]
store i32 %25, i32* %1
store i32 %7, i32* %0
ret void
}