#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 */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int is_forced(int /*<<< orphan*/, int, int);
int first_forced_variable(uint32_t rn, int rank, int start_p) {
  for (; start_p < rank; start_p++) {
    if (is_forced(rn, rank, start_p) != -1) {
      return start_p;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<first_forced_variable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1162 <first_forced_variable+0x52>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <is_forced@plt>
cmp    $0xffffffff,%eax
je     114f <first_forced_variable+0x3f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <first_forced_variable+0x59>
jmp    1154 <first_forced_variable+0x44>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1121 <first_forced_variable+0x11>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_forced_variable>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%r14d
cmp    %esi,%edx
jge    114d <first_forced_variable+0x3d>
mov    %edx,%ebp
mov    %esi,%ebx
mov    %edi,%r15d
nopl   0x0(%rax,%rax,1)
mov    %r15d,%edi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <is_forced@plt>
cmp    $0xffffffff,%eax
jne    114a <first_forced_variable+0x3a>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <first_forced_variable+0x20>
jmp    114d <first_forced_variable+0x3d>
mov    %ebp,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @first_forced_variable(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
br label %8
8: ; preds = %21, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = call i32 @is_forced(i32 %13, i32 %14, i32 %15)
%17 = icmp ne i32 %16, -1
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = load i32, i32* %7
store i32 %19, i32* %4
br label %25
20: ; preds = %12
br label %21
21: ; preds = %20
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %8
24: ; preds = %8
store i32 -1, i32* %4
br label %25
25: ; preds = %24, %18
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @first_forced_variable(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %5, label %12
5: ; preds = %3, %9
%6 = phi i32 [ %10, %9 ], [ %2, %3 ]
%7 = tail call i32 @is_forced(i32 %0, i32 %1, i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = add i32 %6, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %9, %3
%13 = phi i32 [ -1, %3 ], [ -1, %9 ], [ %6, %5 ]
ret i32 %13
}