#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 */
char *check_round_bracket_before_above_word(char *search, char *edge) {
  while (1) {
    if (search < edge)
      return NULL;
    if (*search == '=')
      return NULL;
    if (*search == '(')
      return search;
    search--;
  }
}


x86 assembly (clang, -O0):
<check_round_bracket_before_above_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1127 <check_round_bracket_before_above_word+0x27>
movq   $0x0,-0x8(%rbp)
jmp    1172 <check_round_bracket_before_above_word+0x72>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    1144 <check_round_bracket_before_above_word+0x44>
movq   $0x0,-0x8(%rbp)
jmp    1172 <check_round_bracket_before_above_word+0x72>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x28,%eax
jne    1161 <check_round_bracket_before_above_word+0x61>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <check_round_bracket_before_above_word+0x72>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <check_round_bracket_before_above_word+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_round_bracket_before_above_word>:
cmp    %rsi,%rdi
jb     1126 <check_round_bracket_before_above_word+0x26>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
cmp    $0x28,%cl
je     1128 <check_round_bracket_before_above_word+0x28>
cmp    $0x3d,%cl
je     1126 <check_round_bracket_before_above_word+0x26>
add    $0xffffffffffffffff,%rax
cmp    %rsi,%rax
jae    1110 <check_round_bracket_before_above_word+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @check_round_bracket_before_above_word(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %2, %24
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = icmp ult i8* %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6
store i8* null, i8** %3
br label %27
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 61
br i1 %15, label %16, label %17
16: ; preds = %11
store i8* null, i8** %3
br label %27
17: ; preds = %11
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 40
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = load i8*, i8** %4
store i8* %23, i8** %3
br label %27
24: ; preds = %17
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i32 -1
store i8* %26, i8** %4
br label %6
27: ; preds = %22, %16, %10
%28 = load i8*, i8** %3
ret i8* %28
}

LLVM IR (-O2):
define i8* @check_round_bracket_before_above_word(i8* %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %11, label %4
4: ; preds = %2, %7
%5 = phi i8* [ %8, %7 ], [ %0, %2 ]
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 61, label %10
i8 40, label %11
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 -1
%9 = icmp ult i8* %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %7
br label %11
11: ; preds = %4, %10, %2
%12 = phi i8* [ null, %2 ], [ null, %10 ], [ %5, %4 ]
ret i8* %12
}