#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 */
int fgetc(int /*<<< orphan*/ *);
int isogetLine(FILE *fp, int v[], int *zs) {
  int i, ch;
  int z = 0;
  i = 0;
  ch = fgetc(fp);
  v[i] = ch - 65;
  while (ch != 10) {
    i++;
    ch = fgetc(fp);
    v[i] = ch - 65;
    if (v[i] == 25)
      z++;
  }
  (*zs) = z;
  return i;
}


x86 assembly (clang, -O0):
<isogetLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edx
sub    $0x41,%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
cmpl   $0xa,-0x20(%rbp)
je     119f <isogetLine+0x8f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edx
sub    $0x41,%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0x19,(%rax,%rcx,4)
jne    119a <isogetLine+0x8a>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114f <isogetLine+0x3f>
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isogetLine>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
call   1030 <fgetc@plt>
lea    -0x41(%rax),%ecx
mov    %ecx,(%r15)
xor    %r13d,%r13d
mov    $0x0,%ebp
cmp    $0xa,%eax
je     1176 <isogetLine+0x66>
xor    %r13d,%r13d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13,%rbx
add    $0x1,%r13
mov    %r12,%rdi
call   1030 <fgetc@plt>
lea    -0x41(%rax),%ecx
mov    %ecx,0x4(%r15,%rbx,4)
xor    %edx,%edx
cmp    $0x19,%ecx
sete   %dl
add    %edx,%ebp
cmp    $0xa,%eax
jne    1150 <isogetLine+0x40>
mov    %ebp,(%r14)
mov    %r13d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isogetLine(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @fgetc(i32* %0)
%5 = add nsw i32 %4, -65
store i32 %5, i32* %1
%6 = icmp eq i32 %4, 10
br i1 %6, label %20, label %7
7: ; preds = %3, %7
%8 = phi i64 [ %10, %7 ], [ 0, %3 ]
%9 = phi i32 [ %16, %7 ], [ 0, %3 ]
%10 = add nuw i64 %8, 1
%11 = tail call i32 @fgetc(i32* %0)
%12 = add nsw i32 %11, -65
%13 = getelementptr inbounds i32, i32* %1, i64 %10
store i32 %12, i32* %13
%14 = icmp eq i32 %12, 25
%15 = zext i1 %14 to i32
%16 = add nuw nsw i32 %9, %15
%17 = icmp eq i32 %11, 10
br i1 %17, label %18, label %7
18: ; preds = %7
%19 = trunc i64 %10 to i32
br label %20
20: ; preds = %18, %3
%21 = phi i32 [ 0, %3 ], [ %19, %18 ]
%22 = phi i32 [ 0, %3 ], [ %16, %18 ]
store i32 %22, i32* %2
ret i32 %21
}