#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(char *, char *);
int /*<<< orphan*/ non_fatal(char *, char *);
char *skip_nonwhite(char *);
char *skip_white(char *);
scalar_t__ strchr(char *, char);
scalar_t__ strlen(char *);
scalar_t__ strncmp(char *, char *, scalar_t__);
char *jump_etc(char *op) {
  char *p = op;
  p = skip_white(p);
  if (strncmp(p, "enum", strlen("enum")) == 0) {
    p += strlen("enum") + 1;
    p = skip_white(p);
  }
  p = skip_nonwhite(p);
  p = skip_white(p);
  while (*p == '*')
    p++;
  p = skip_white(p);
  if (*p == '\0')
    fatal("c_state format (%s)", op);
  if (strchr(p, '[') && !strchr(p, '{')) {
    non_fatal("array initialization error, c_state (%s)", p);
    return (char *)0;
  }
  return p;
}


x86 assembly (clang, -O0):
<jump_etc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <skip_white@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xe60(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rdx
lea    0xe4d(%rip),%rsi
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11e7 <jump_etc+0x77>
lea    0xe37(%rip),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <skip_white@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <skip_nonwhite@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <skip_white@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    1222 <jump_etc+0xb2>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1201 <jump_etc+0x91>
mov    -0x18(%rbp),%rdi
call   1090 <skip_white@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    124f <jump_etc+0xdf>
mov    -0x10(%rbp),%rsi
lea    0xdbb(%rip),%rdi
call   1080 <fatal@plt>
mov    -0x18(%rbp),%rdi
mov    $0x5b,%esi
call   1050 <strchr@plt>
cmp    $0x0,%rax
je     129c <jump_etc+0x12c>
mov    -0x18(%rbp),%rdi
mov    $0x7b,%esi
call   1050 <strchr@plt>
cmp    $0x0,%rax
jne    129c <jump_etc+0x12c>
mov    -0x18(%rbp),%rsi
lea    0xd8f(%rip),%rdi
call   1060 <non_fatal@plt>
movq   $0x0,-0x8(%rbp)
jmp    12a4 <jump_etc+0x134>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump_etc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1080 <skip_white@plt>
mov    %rax,%rbx
lea    0xe8a(%rip),%rsi
mov    $0x4,%edx
mov    %rax,%rdi
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1197 <jump_etc+0x37>
add    $0x5,%rbx
mov    %rbx,%rdi
call   1080 <skip_white@plt>
mov    %rax,%rbx
mov    %rbx,%rdi
call   1060 <skip_nonwhite@plt>
mov    %rax,%rdi
call   1080 <skip_white@plt>
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax,%rax,1)
cmpb   $0x2a,0x1(%rax)
lea    0x1(%rax),%rax
je     11b0 <jump_etc+0x50>
mov    %rax,%rdi
call   1080 <skip_white@plt>
mov    %rax,%rbx
cmpb   $0x0,(%rax)
jne    11d9 <jump_etc+0x79>
lea    0xe34(%rip),%rdi
mov    %r14,%rsi
call   1070 <fatal@plt>
mov    %rbx,%rdi
mov    $0x5b,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     120e <jump_etc+0xae>
mov    %rbx,%rdi
mov    $0x7b,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    120e <jump_etc+0xae>
lea    0xe15(%rip),%rdi
mov    %rbx,%rsi
call   1050 <non_fatal@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"enum\00"
@.str.1 = [20 x i8] c"c_state format (%s)\00"
@.str.2 = [41 x i8] c"array initialization error, c_state (%s)\00"
define i8* @jump_etc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = call i8* @skip_white(i8* %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = call i64 @strncmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %1
%13 = call i64 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%14 = add nsw i64 %13, 1
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 %14
store i8* %16, i8** %4
%17 = load i8*, i8** %4
%18 = call i8* @skip_white(i8* %17)
store i8* %18, i8** %4
br label %19
19: ; preds = %12, %1
%20 = load i8*, i8** %4
%21 = call i8* @skip_nonwhite(i8* %20)
store i8* %21, i8** %4
%22 = load i8*, i8** %4
%23 = call i8* @skip_white(i8* %22)
store i8* %23, i8** %4
br label %24
24: ; preds = %29, %19
%25 = load i8*, i8** %4
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 42
br i1 %28, label %29, label %32
29: ; preds = %24
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %4
br label %24
32: ; preds = %24
%33 = load i8*, i8** %4
%34 = call i8* @skip_white(i8* %33)
store i8* %34, i8** %4
%35 = load i8*, i8** %4
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %32
%40 = load i8*, i8** %3
%41 = call i32 @fatal(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %40)
br label %42
42: ; preds = %39, %32
%43 = load i8*, i8** %4
%44 = call i64 @strchr(i8* %43, i8 signext 91)
%45 = icmp ne i64 %44, 0
br i1 %45, label %46, label %53
46: ; preds = %42
%47 = load i8*, i8** %4
%48 = call i64 @strchr(i8* %47, i8 signext 123)
%49 = icmp ne i64 %48, 0
br i1 %49, label %53, label %50
50: ; preds = %46
%51 = load i8*, i8** %4
%52 = call i32 @non_fatal(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %51)
store i8* null, i8** %2
br label %55
53: ; preds = %46, %42
%54 = load i8*, i8** %4
store i8* %54, i8** %2
br label %55
55: ; preds = %53, %50
%56 = load i8*, i8** %2
ret i8* %56
}

LLVM IR (-O2):
@.str = [5 x i8] c"enum\00"
@.str.1 = [20 x i8] c"c_state format (%s)\00"
@.str.2 = [41 x i8] c"array initialization error, c_state (%s)\00"
define i8* @jump_etc(i8* %0) {
%2 = tail call i8* @skip_white(i8* %0)
%3 = tail call i64 @strncmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %2, i64 5
%7 = tail call i8* @skip_white(i8* %6)
br label %8
8: ; preds = %5, %1
%9 = phi i8* [ %7, %5 ], [ %2, %1 ]
%10 = tail call i8* @skip_nonwhite(i8* %9)
%11 = tail call i8* @skip_white(i8* %10)
br label %12
12: ; preds = %12, %8
%13 = phi i8* [ %11, %8 ], [ %16, %12 ]
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 42
%16 = getelementptr inbounds i8, i8* %13, i64 1
br i1 %15, label %12, label %17
17: ; preds = %12
%18 = tail call i8* @skip_white(i8* %13)
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = tail call i32 @fatal(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %23
23: ; preds = %21, %17
%24 = tail call i64 @strchr(i8* %18, i8 signext 91)
%25 = icmp eq i64 %24, 0
br i1 %25, label %31, label %26
26: ; preds = %23
%27 = tail call i64 @strchr(i8* %18, i8 signext 123)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = tail call i32 @non_fatal(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %18)
br label %31
31: ; preds = %23, %26, %29
%32 = phi i8* [ null, %29 ], [ %18, %26 ], [ %18, %23 ]
ret i8* %32
}