#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 */
long strtol(char *, int /*<<< orphan*/ *, int);
void processLine(char *line, long *gridline) {
  for (char *tmp = line; *tmp != '\n'; tmp++) {
    if (*tmp == ' ') {
      *tmp = '\0';
    }
  }
  for (int i = 0; *line && *line != '\n'; i++) {
    gridline[i] = strtol(line, NULL, 10);
    line += 3;
  }
  return;
}


x86 assembly (clang, -O0):
<processLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1165 <processLine+0x55>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    114f <processLine+0x3f>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    1154 <processLine+0x44>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <processLine+0x18>
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1d(%rbp)
je     1191 <processLine+0x81>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    11a1 <processLine+0x91>
jmp    11dc <processLine+0xcc>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x8(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116c <processLine+0x5c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processLine>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdi,%rax
jmp    1127 <processLine+0x17>
nop
movb   $0x0,(%rax)
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1120 <processLine+0x10>
cmp    $0xa,%cl
jne    1123 <processLine+0x13>
jmp    115a <processLine+0x4a>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,(%r14)
add    $0x3,%rbx
add    $0x8,%r14
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1165 <processLine+0x55>
test   %al,%al
jne    1140 <processLine+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @processLine(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i64* %1, i64** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
br label %8
8: ; preds = %21, %2
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %24
13: ; preds = %8
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 32
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = load i8*, i8** %5
store i8 0, i8* %19
br label %20
20: ; preds = %18, %13
br label %21
21: ; preds = %20
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %5
br label %8
24: ; preds = %8
store i32 0, i32* %6
br label %25
25: ; preds = %46, %24
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %35
30: ; preds = %25
%31 = load i8*, i8** %3
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %33, 10
br label %35
35: ; preds = %30, %25
%36 = phi i1 [ false, %25 ], [ %34, %30 ]
br i1 %36, label %37, label %49
37: ; preds = %35
%38 = load i8*, i8** %3
%39 = call i64 @strtol(i8* %38, i32* null, i32 10)
%40 = load i64*, i64** %4
%41 = load i32, i32* %6
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i64, i64* %40, i64 %42
store i64 %39, i64* %43
%44 = load i8*, i8** %3
%45 = getelementptr inbounds i8, i8* %44, i64 3
store i8* %45, i8** %3
br label %46
46: ; preds = %37
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
br label %25
49: ; preds = %35
ret void
}

LLVM IR (-O2):
define void @processLine(i8* nocapture %0, i64* nocapture writeonly %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 10, label %9
i8 32, label %6
]
6: ; preds = %3
store i8 0, i8* %4
br label %7
7: ; preds = %3, %6
%8 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
9: ; preds = %3, %14
%10 = phi i64 [ %18, %14 ], [ 0, %3 ]
%11 = phi i8* [ %17, %14 ], [ %0, %3 ]
%12 = load i8, i8* %11
switch i8 %12, label %14 [
i8 0, label %13
i8 10, label %13
]
13: ; preds = %9, %9
ret void
14: ; preds = %9
%15 = tail call i64 @strtol(i8* nocapture %11, i32* null, i32 10)
%16 = getelementptr inbounds i64, i64* %1, i64 %10
store i64 %15, i64* %16
%17 = getelementptr inbounds i8, i8* %11, i64 3
%18 = add nuw i64 %10, 1
br label %9
}