#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 atoi(char *);
scalar_t__ memcmp(char *, char *, int /*<<< orphan*/);
char *strchr(char *, char);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ *strstr(char *, char *);
int parsecorner(char *line, int *row, int *col) {
  int isokay = 0;
  char field[99], *delim;
  if (line == (char *)NULL)
    goto end_of_job;
  if (strstr(line, "character is entirely blank") != NULL)
    return (-999);
  if (memcmp(line, ".<--", strlen(".<--")) != 0)
    goto end_of_job;
  if ((delim = strchr(line, '(')) == NULL)
    goto end_of_job;
  strncpy(field, delim + 1, 10);
  field[10] = '\000';
  if ((delim = strchr(field, ')')) == NULL)
    goto end_of_job;
  *delim = '\000';
  if ((delim = strchr(field, ',')) == NULL)
    goto end_of_job;
  *delim = '\000';
  if (col != (int *)NULL)
    *col = atoi(field);
  if (row != (int *)NULL)
    *row = atoi(delim + 1);
  isokay = 1;
end_of_job:
  return (isokay);
}


x86 assembly (clang, -O0):
<parsecorner>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118e <parsecorner+0x2e>
jmp    12e1 <parsecorner+0x181>
mov    -0x10(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1080 <strstr@plt>
cmp    $0x0,%rax
je     11b4 <parsecorner+0x54>
movl   $0xfffffc19,-0x4(%rbp)
jmp    12e7 <parsecorner+0x187>
mov    -0x10(%rbp),%rax
mov    %rax,-0xa0(%rbp)
lea    0xe56(%rip),%rdi
call   1040 <strlen@plt>
mov    -0xa0(%rbp),%rdi
mov    %eax,%edx
lea    0xe41(%rip),%rsi
call   1060 <memcmp@plt>
cmp    $0x0,%rax
je     11ef <parsecorner+0x8f>
jmp    12e1 <parsecorner+0x181>
mov    -0x10(%rbp),%rdi
mov    $0x28,%esi
call   1050 <strchr@plt>
mov    %rax,-0x98(%rbp)
cmp    $0x0,%rax
jne    1213 <parsecorner+0xb3>
jmp    12e1 <parsecorner+0x181>
lea    -0x90(%rbp),%rdi
mov    -0x98(%rbp),%rsi
add    $0x1,%rsi
mov    $0xa,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x86(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x29,%esi
call   1050 <strchr@plt>
mov    %rax,-0x98(%rbp)
cmp    $0x0,%rax
jne    125d <parsecorner+0xfd>
jmp    12e1 <parsecorner+0x181>
mov    -0x98(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x90(%rbp),%rdi
mov    $0x2c,%esi
call   1050 <strchr@plt>
mov    %rax,-0x98(%rbp)
cmp    $0x0,%rax
jne    128e <parsecorner+0x12e>
jmp    12e1 <parsecorner+0x181>
mov    -0x98(%rbp),%rax
movb   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     12b7 <parsecorner+0x157>
lea    -0x90(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     12da <parsecorner+0x17a>
mov    -0x98(%rbp),%rdi
add    $0x1,%rdi
call   1070 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsecorner>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x68,%rsp
test   %rdi,%rdi
je     11af <parsecorner+0x4f>
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xe81(%rip),%rsi
call   1080 <strstr@plt>
mov    $0xfffffc19,%ebp
test   %rax,%rax
jne    11b1 <parsecorner+0x51>
lea    0xe87(%rip),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
call   1060 <memcmp@plt>
test   %rax,%rax
je     11be <parsecorner+0x5e>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,%rdi
mov    $0x28,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     11af <parsecorner+0x4f>
add    $0x1,%rax
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0xa,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xa(%rsp)
mov    %rbx,%rdi
mov    $0x29,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     11af <parsecorner+0x4f>
movb   $0x0,(%rax)
mov    %rsp,%rdi
mov    $0x2c,%esi
call   1050 <strchr@plt>
mov    $0x0,%ebp
test   %rax,%rax
je     11b1 <parsecorner+0x51>
mov    %rax,%rbx
movb   $0x0,(%rax)
test   %r15,%r15
je     122e <parsecorner+0xce>
mov    %rsp,%rdi
call   1070 <atoi@plt>
mov    %eax,(%r15)
mov    $0x1,%ebp
test   %r14,%r14
je     11b1 <parsecorner+0x51>
add    $0x1,%rbx
mov    %rbx,%rdi
call   1070 <atoi@plt>
mov    %eax,(%r14)
jmp    11b1 <parsecorner+0x51>

LLVM IR (-O0):
@.str = [28 x i8] c"character is entirely blank\00"
@.str.1 = [5 x i8] c".<--\00"
define i32 @parsecorner(i8* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [99 x i8]
%10 = alloca i8*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 0, i32* %8
%11 = load i8*, i8** %5
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %3
br label %63
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = call i32* @strstr(i8* %15, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%17 = icmp ne i32* %16, null
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 -999, i32* %4
br label %65
19: ; preds = %14
%20 = load i8*, i8** %5
%21 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%22 = call i64 @memcmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %19
br label %63
25: ; preds = %19
%26 = load i8*, i8** %5
%27 = call i8* @strchr(i8* %26, i8 signext 40)
store i8* %27, i8** %10
%28 = icmp eq i8* %27, null
br i1 %28, label %29, label %30
29: ; preds = %25
br label %63
30: ; preds = %25
%31 = getelementptr inbounds [99 x i8], [99 x i8]* %9, i64 0, i64 0
%32 = load i8*, i8** %10
%33 = getelementptr inbounds i8, i8* %32, i64 1
%34 = call i32 @strncpy(i8* %31, i8* %33, i32 10)
%35 = getelementptr inbounds [99 x i8], [99 x i8]* %9, i64 0, i64 10
store i8 0, i8* %35
%36 = getelementptr inbounds [99 x i8], [99 x i8]* %9, i64 0, i64 0
%37 = call i8* @strchr(i8* %36, i8 signext 41)
store i8* %37, i8** %10
%38 = icmp eq i8* %37, null
br i1 %38, label %39, label %40
39: ; preds = %30
br label %63
40: ; preds = %30
%41 = load i8*, i8** %10
store i8 0, i8* %41
%42 = getelementptr inbounds [99 x i8], [99 x i8]* %9, i64 0, i64 0
%43 = call i8* @strchr(i8* %42, i8 signext 44)
store i8* %43, i8** %10
%44 = icmp eq i8* %43, null
br i1 %44, label %45, label %46
45: ; preds = %40
br label %63
46: ; preds = %40
%47 = load i8*, i8** %10
store i8 0, i8* %47
%48 = load i32*, i32** %7
%49 = icmp ne i32* %48, null
br i1 %49, label %50, label %54
50: ; preds = %46
%51 = getelementptr inbounds [99 x i8], [99 x i8]* %9, i64 0, i64 0
%52 = call i32 @atoi(i8* %51)
%53 = load i32*, i32** %7
store i32 %52, i32* %53
br label %54
54: ; preds = %50, %46
%55 = load i32*, i32** %6
%56 = icmp ne i32* %55, null
br i1 %56, label %57, label %62
57: ; preds = %54
%58 = load i8*, i8** %10
%59 = getelementptr inbounds i8, i8* %58, i64 1
%60 = call i32 @atoi(i8* %59)
%61 = load i32*, i32** %6
store i32 %60, i32* %61
br label %62
62: ; preds = %57, %54
store i32 1, i32* %8
br label %63
63: ; preds = %62, %45, %39, %29, %24, %13
%64 = load i32, i32* %8
store i32 %64, i32* %4
br label %65
65: ; preds = %63, %18
%66 = load i32, i32* %4
ret i32 %66
}

LLVM IR (-O2):
@.str = [28 x i8] c"character is entirely blank\00"
@.str.1 = [5 x i8] c".<--\00"
define i32 @parsecorner(i8* %0, i32* writeonly %1, i32* writeonly %2) {
%4 = alloca [99 x i8]
%5 = getelementptr inbounds [99 x i8], [99 x i8]* %4, i64 0, i64 0
%6 = icmp eq i8* %0, null
br i1 %6, label %35, label %7
7: ; preds = %3
%8 = tail call i32* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %35
10: ; preds = %7
%11 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i64 @memcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %35
14: ; preds = %10
%15 = tail call i8* @strchr(i8* %0, i8 signext 40)
%16 = icmp eq i8* %15, null
br i1 %16, label %35, label %17
17: ; preds = %14
%18 = getelementptr inbounds i8, i8* %15, i64 1
%19 = call i32 @strncpy(i8* %5, i8* %18, i32 10)
%20 = getelementptr inbounds [99 x i8], [99 x i8]* %4, i64 0, i64 10
store i8 0, i8* %20
%21 = call i8* @strchr(i8* %5, i8 signext 41)
%22 = icmp eq i8* %21, null
br i1 %22, label %35, label %23
23: ; preds = %17
store i8 0, i8* %21
%24 = call i8* @strchr(i8* %5, i8 signext 44)
%25 = icmp eq i8* %24, null
br i1 %25, label %35, label %26
26: ; preds = %23
store i8 0, i8* %24
%27 = icmp eq i32* %2, null
br i1 %27, label %30, label %28
28: ; preds = %26
%29 = call i32 @atoi(i8* %5)
store i32 %29, i32* %2
br label %30
30: ; preds = %28, %26
%31 = icmp eq i32* %1, null
br i1 %31, label %35, label %32
32: ; preds = %30
%33 = getelementptr inbounds i8, i8* %24, i64 1
%34 = call i32 @atoi(i8* %33)
store i32 %34, i32* %1
br label %35
35: ; preds = %3, %10, %14, %17, %23, %32, %30, %7
%36 = phi i32 [ -999, %7 ], [ 0, %3 ], [ 0, %10 ], [ 0, %14 ], [ 0, %17 ], [ 0, %23 ], [ 1, %32 ], [ 1, %30 ]
ret i32 %36
}