#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/ *);
void getnextcol(FILE *file, char *plate) {
  int pindex = 0;
  char c = fgetc(file);
  while (c != ',' && c != '\n' && c != EOF) {
    plate[pindex] = c;
    pindex++;
    c = fgetc(file);
  }
  plate[pindex] = '\0';
}


x86 assembly (clang, -O0):
<getnextcol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%ecx
xor    %eax,%eax
cmp    $0x2c,%ecx
mov    %al,-0x16(%rbp)
je     116d <getnextcol+0x5d>
movsbl -0x15(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x16(%rbp)
je     116d <getnextcol+0x5d>
movsbl -0x15(%rbp),%eax
mov    0x2e86(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
test   $0x1,%al
jne    117d <getnextcol+0x6d>
jmp    11a5 <getnextcol+0x95>
mov    -0x15(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x15(%rbp)
jmp    1133 <getnextcol+0x23>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnextcol>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
mov    0x2ec1(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%al
je     1150 <getnextcol+0x40>
cmp    $0x2c,%al
je     1150 <getnextcol+0x40>
cmp    (%r12),%al
je     1150 <getnextcol+0x40>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
jmp    1130 <getnextcol+0x20>
mov    %ebx,%eax
movb   $0x0,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EOF = global i8 0
define void @getnextcol(i32* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i64 [ %11, %9 ], [ 0, %2 ]
%5 = tail call signext i8 @fgetc(i32* %0)
switch i8 %5, label %6 [
i8 44, label %12
i8 10, label %12
]
6: ; preds = %3
%7 = load i8, i8* @EOF
%8 = icmp eq i8 %5, %7
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 %5, i8* %10
%11 = add nuw i64 %4, 1
br label %3
12: ; preds = %3, %3, %6
%13 = and i64 %4, 4294967295
%14 = getelementptr inbounds i8, i8* %1, i64 %13
store i8 0, i8* %14
ret void
}