#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 */
int /*<<< orphan*/ Fatal_Error(char *);
const char *Skip_Past_Right_Paren(const char *string) {
  char c;
  int nesting = 0;
  while (c = string++[0], c != ')' || nesting)
    switch (c) {
    case '\0':
      Fatal_Error("Missing ')'.");
    case '(':
      nesting++;
      break;
    case ')':
      nesting--;
      break;
    case '\\':
      string++;
      break;
    }
  return string;
}


x86 assembly (clang, -O0):
<Skip_Past_Right_Paren>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x29,%ecx
mov    %al,-0x11(%rbp)
jne    1153 <Skip_Past_Right_Paren+0x43>
cmpl   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1163 <Skip_Past_Right_Paren+0x53>
jmp    11e3 <Skip_Past_Right_Paren+0xd3>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     11aa <Skip_Past_Right_Paren+0x9a>
jmp    1177 <Skip_Past_Right_Paren+0x67>
mov    -0x18(%rbp),%eax
sub    $0x28,%eax
je     11b6 <Skip_Past_Right_Paren+0xa6>
jmp    1188 <Skip_Past_Right_Paren+0x78>
mov    -0x18(%rbp),%eax
sub    $0x29,%eax
je     11c4 <Skip_Past_Right_Paren+0xb4>
jmp    1199 <Skip_Past_Right_Paren+0x89>
mov    -0x18(%rbp),%eax
sub    $0x5c,%eax
je     11d2 <Skip_Past_Right_Paren+0xc2>
jmp    11de <Skip_Past_Right_Paren+0xce>
lea    0xe4f(%rip),%rdi
call   1030 <Fatal_Error@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11de <Skip_Past_Right_Paren+0xce>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    11de <Skip_Past_Right_Paren+0xce>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <Skip_Past_Right_Paren+0x13>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Skip_Past_Right_Paren>:
push   %rbp
push   %r14
push   %rbx
lea    0x1(%rdi),%rbx
mov    (%rdi),%al
cmp    $0x29,%al
je     1185 <Skip_Past_Right_Paren+0x75>
xor    %ebp,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
movsbl %al,%eax
cmp    $0x28,%eax
jg     1150 <Skip_Past_Right_Paren+0x40>
test   %eax,%eax
je     1160 <Skip_Past_Right_Paren+0x50>
cmp    $0x28,%eax
je     1168 <Skip_Past_Right_Paren+0x58>
jmp    1173 <Skip_Past_Right_Paren+0x63>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x29,%eax
je     1170 <Skip_Past_Right_Paren+0x60>
cmp    $0x5c,%eax
jne    1173 <Skip_Past_Right_Paren+0x63>
add    $0x2,%rdi
jmp    1176 <Skip_Past_Right_Paren+0x66>
mov    %r14,%rdi
call   1030 <Fatal_Error@plt>
add    $0x1,%ebp
jmp    1173 <Skip_Past_Right_Paren+0x63>
nopl   (%rax)
add    $0xffffffff,%ebp
mov    %rbx,%rdi
lea    0x1(%rdi),%rbx
movzbl (%rdi),%eax
cmp    $0x29,%al
jne    1130 <Skip_Past_Right_Paren+0x20>
test   %ebp,%ebp
jne    1130 <Skip_Past_Right_Paren+0x20>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Missing ')'.\00"
define i8* @Skip_Past_Right_Paren(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
br label %5
5: ; preds = %32, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = getelementptr inbounds i8, i8* %6, i64 0
%9 = load i8, i8* %8
store i8 %9, i8* %3
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 41
br i1 %12, label %16, label %13
13: ; preds = %5
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %13, %5
%17 = phi i1 [ true, %5 ], [ %15, %13 ]
br i1 %17, label %18, label %33
18: ; preds = %16
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
switch i32 %20, label %32 [
i32 0, label %21
i32 40, label %23
i32 41, label %26
i32 92, label %29
]
21: ; preds = %18
%22 = call i32 @Fatal_Error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %18, %21
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %32
26: ; preds = %18
%27 = load i32, i32* %4
%28 = add nsw i32 %27, -1
store i32 %28, i32* %4
br label %32
29: ; preds = %18
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %2
br label %32
32: ; preds = %18, %29, %26, %23
br label %5
33: ; preds = %16
%34 = load i8*, i8** %2
ret i8* %34
}

LLVM IR (-O2):
@.str = [13 x i8] c"Missing ')'.\00"
define i8* @Skip_Past_Right_Paren(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 41
br i1 %4, label %27, label %5
5: ; preds = %1, %19
%6 = phi i8 [ %23, %19 ], [ %3, %1 ]
%7 = phi i8* [ %22, %19 ], [ %2, %1 ]
%8 = phi i32 [ %21, %19 ], [ 0, %1 ]
%9 = phi i8* [ %20, %19 ], [ %0, %1 ]
%10 = sext i8 %6 to i32
switch i32 %10, label %19 [
i32 0, label %11
i32 40, label %13
i32 41, label %15
i32 92, label %17
]
11: ; preds = %5
%12 = tail call i32 @Fatal_Error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %5, %11
%14 = add nsw i32 %8, 1
br label %19
15: ; preds = %5
%16 = add nsw i32 %8, -1
br label %19
17: ; preds = %5
%18 = getelementptr inbounds i8, i8* %9, i64 2
br label %19
19: ; preds = %5, %17, %15, %13
%20 = phi i8* [ %7, %5 ], [ %18, %17 ], [ %7, %15 ], [ %7, %13 ]
%21 = phi i32 [ %8, %5 ], [ %8, %17 ], [ %16, %15 ], [ %14, %13 ]
%22 = getelementptr inbounds i8, i8* %20, i64 1
%23 = load i8, i8* %20
%24 = icmp ne i8 %23, 41
%25 = icmp ne i32 %21, 0
%26 = select i1 %24, i1 true, i1 %25
br i1 %26, label %5, label %27
27: ; preds = %19, %1
%28 = phi i8* [ %2, %1 ], [ %22, %19 ]
ret i8* %28
}