#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 */
scalar_t__ isspace(unsigned char);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int v3_check_critical(char **value) {
  char *p = *value;
  if ((strlen(p) < 9) || strncmp(p, "critical,", 9))
    return 0;
  p += 9;
  while (isspace((unsigned char)*p))
    p++;
  *value = p;
  return 1;
}


x86 assembly (clang, -O0):
<v3_check_critical>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x9,%eax
jl     1178 <v3_check_critical+0x48>
mov    -0x18(%rbp),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1184 <v3_check_critical+0x54>
movl   $0x0,-0x4(%rbp)
jmp    11c9 <v3_check_critical+0x99>
mov    -0x18(%rbp),%rax
add    $0x9,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%edi
call   1050 <isspace@plt>
cmp    $0x0,%rax
je     11b7 <v3_check_critical+0x87>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1190 <v3_check_critical+0x60>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v3_check_critical>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
xor    %ebp,%ebp
cmp    $0x9,%eax
jl     118a <v3_check_critical+0x5a>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
mov    $0x9,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    118a <v3_check_critical+0x5a>
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1050 <isspace@plt>
test   %rax,%rax
jne    1170 <v3_check_critical+0x40>
mov    %rbx,(%r14)
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"critical,\00"
define i32 @v3_check_critical(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = icmp slt i32 %8, 9
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = call i64 @strncmp(i8* %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10, %1
store i32 0, i32* %2
br label %29
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 9
store i8* %17, i8** %4
br label %18
18: ; preds = %23, %15
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = call i64 @isspace(i8 zeroext %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
br label %18
26: ; preds = %18
%27 = load i8*, i8** %4
%28 = load i8**, i8*** %3
store i8* %27, i8** %28
store i32 1, i32* %2
br label %29
29: ; preds = %26, %14
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
@.str = [10 x i8] c"critical,\00"
define i32 @v3_check_critical(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @strlen(i8* %2)
%4 = icmp slt i32 %3, 9
br i1 %4, label %17, label %5
5: ; preds = %1
%6 = tail call i64 @strncmp(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %2, i64 9
br label %10
10: ; preds = %10, %8
%11 = phi i8* [ %9, %8 ], [ %15, %10 ]
%12 = load i8, i8* %11
%13 = tail call i64 @isspace(i8 zeroext %12)
%14 = icmp eq i64 %13, 0
%15 = getelementptr inbounds i8, i8* %11, i64 1
br i1 %14, label %16, label %10
16: ; preds = %10
store i8* %11, i8** %0
br label %17
17: ; preds = %1, %5, %16
%18 = phi i32 [ 1, %16 ], [ 0, %5 ], [ 0, %1 ]
ret i32 %18
}