#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__ isdigit(char);
scalar_t__ strcmp(char *, char *);
scalar_t__ strncmp(char *, char *, int);
int line_isnnrows(char *line) {
  int rc;
  rc = 0;
  if (strncmp(line, "--- ", 4) == 0) {
    char *next;
    for (next = line + 4; isdigit(*next); next++)
      ;
    if (next != line + 4) {
      if (strcmp(next, " row(s) selected.\n") == 0)
        rc = 1;
    }
  }
  return rc;
}


x86 assembly (clang, -O0):
<line_isnnrows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11da <line_isnnrows+0xaa>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     119a <line_isnnrows+0x6a>
jmp    1189 <line_isnnrows+0x59>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    116e <line_isnnrows+0x3e>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x4,%rcx
cmp    %rcx,%rax
je     11d5 <line_isnnrows+0xa5>
mov    -0x18(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11d0 <line_isnnrows+0xa0>
movl   $0x1,-0xc(%rbp)
jmp    11d5 <line_isnnrows+0xa5>
jmp    11da <line_isnnrows+0xaa>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_isnnrows>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xec2(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
jne    1194 <line_isnnrows+0x64>
add    $0x3,%rbx
mov    $0x1,%ebp
nopl   0x0(%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1040 <isdigit@plt>
add    $0xffffffffffffffff,%rbp
test   %rax,%rax
jne    1160 <line_isnnrows+0x30>
test   %rbp,%rbp
je     1194 <line_isnnrows+0x64>
lea    0xe83(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
sete   %r14b
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"--- \00"
@.str.1 = [19 x i8] c" row(s) selected.\0A\00"
define i32 @line_isnnrows(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %18
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 4, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i64 @isdigit(i8 signext %7)
%9 = icmp eq i64 %8, 0
%10 = add nuw nsw i64 %5, 1
br i1 %9, label %11, label %4
11: ; preds = %4
%12 = icmp eq i64 %5, 4
br i1 %12, label %18, label %13
13: ; preds = %11
%14 = getelementptr inbounds i8, i8* %0, i64 %5
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %13, %11, %1
%19 = phi i32 [ 0, %1 ], [ 0, %11 ], [ %17, %13 ]
ret i32 %19
}