#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long);
scalar_t__ parse_line(char **, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int parse_stdin(int (*cb)(char *parts[65536]), size_t parts_count) {
  char *parts[65536];
  unsigned long counter = 0UL;
  while (parse_line(parts, stdin, parts_count) == 0) {
    counter++;
    if (cb(parts) != 0) {
      fprintf(stderr, "Test vector #%lu didn't verify\n", counter);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80020,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x80018(%rbp)
lea    -0x80010(%rbp),%rdi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1040 <parse_line@plt>
cmp    $0x0,%rax
jne    11aa <parse_stdin+0x8a>
mov    -0x80018(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x80018(%rbp)
mov    -0x8(%rbp),%rax
lea    -0x80010(%rbp),%rdi
call   *%rax
cmp    $0x0,%eax
je     11a5 <parse_stdin+0x85>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
mov    -0x80018(%rbp),%rdx
lea    0xe60(%rip),%rsi
call   1030 <fprintf@plt>
jmp    113e <parse_stdin+0x1e>
xor    %eax,%eax
add    $0x80020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_stdin>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x80008,%rsp
mov    %rsi,%r15
mov    %rdi,%r14
mov    0x2eaa(%rip),%rbp
mov    0x0(%rbp),%esi
mov    %rsp,%rdi
mov    %r15,%rdx
call   1040 <parse_line@plt>
test   %rax,%rax
je     1165 <parse_stdin+0x45>
xor    %eax,%eax
add    $0x80008,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebx
mov    %rsp,%r12
lea    0xe8c(%rip),%r13
jmp    1197 <parse_stdin+0x77>
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%rbp),%esi
mov    %r12,%rdi
mov    %r15,%rdx
call   1040 <parse_line@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1151 <parse_stdin+0x31>
mov    %r12,%rdi
call   *%r14
test   %eax,%eax
je     1180 <parse_stdin+0x60>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
mov    %r13,%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
jmp    1180 <parse_stdin+0x60>

LLVM IR (-O0):
@stdin = global i32 0
@stderr = global i32 0
@.str = [32 x i8] c"Test vector #%lu didn't verify\0A\00"
define i32 @parse_stdin(i32 (i8**)* %0, i64 %1) {
%3 = alloca i32 (i8**)*
%4 = alloca i64
%5 = alloca [65536 x i8*]
%6 = alloca i64
store i32 (i8**)* %0, i32 (i8**)** %3
store i64 %1, i64* %4
store i64 0, i64* %6
br label %7
7: ; preds = %24, %2
%8 = getelementptr inbounds [65536 x i8*], [65536 x i8*]* %5, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = load i64, i64* %4
%11 = call i64 @parse_line(i8** %8, i32 %9, i64 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %25
13: ; preds = %7
%14 = load i64, i64* %6
%15 = add i64 %14, 1
store i64 %15, i64* %6
%16 = load i32 (i8**)*, i32 (i8**)** %3
%17 = getelementptr inbounds [65536 x i8*], [65536 x i8*]* %5, i64 0, i64 0
%18 = call i32 %16(i8** %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %13
%21 = load i32, i32* @stderr
%22 = load i64, i64* %6
%23 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %22)
br label %24
24: ; preds = %20, %13
br label %7
25: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@stderr = global i32 0
@.str = [32 x i8] c"Test vector #%lu didn't verify\0A\00"
define i32 @parse_stdin(i32 (i8**)* nocapture %0, i64 %1) {
%3 = alloca [65536 x i8*]
%4 = bitcast [65536 x i8*]* %3 to i8*
%5 = getelementptr inbounds [65536 x i8*], [65536 x i8*]* %3, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i64 @parse_line(i8** %5, i32 %6, i64 %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %2, %17
%10 = phi i64 [ %11, %17 ], [ 0, %2 ]
%11 = add i64 %10, 1
%12 = call i32 %0(i8** %5)
%13 = icmp eq i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %9
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %11)
br label %17
17: ; preds = %14, %9
%18 = load i32, i32* @stdin
%19 = call i64 @parse_line(i8** %5, i32 %18, i64 %1)
%20 = icmp eq i64 %19, 0
br i1 %20, label %9, label %21
21: ; preds = %17, %2
ret i32 0
}