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

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int sscanf(char *, char *, int *, int *);
int de_ascii_get_1070_sub_header(FILE *f, int *rec_id, int *count) {
  char buff[100 + 1];
  while (!feof(f)) {
    if (fgets(buff, sizeof(buff) - 1, f)) {
      int r, c;
      if (sscanf(buff, "%d %d\n", &r, &c) == 2) {
        *rec_id = r;
        *count = c;
        return 0;
      }
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<de_ascii_get_1070_sub_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1165 <de_ascii_get_1070_sub_header+0x35>
jmp    11dc <de_ascii_get_1070_sub_header+0xac>
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x64,%esi
call   1030 <fgets@plt>
cmp    $0x0,%rax
je     11d7 <de_ascii_get_1070_sub_header+0xa7>
lea    -0x90(%rbp),%rdi
lea    0xe6e(%rip),%rsi
lea    -0x94(%rbp),%rdx
lea    -0x98(%rbp),%rcx
call   1050 <sscanf@plt>
cmp    $0x2,%eax
jne    11d2 <de_ascii_get_1070_sub_header+0xa2>
mov    -0x94(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x98(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    11e3 <de_ascii_get_1070_sub_header+0xb3>
jmp    11d7 <de_ascii_get_1070_sub_header+0xa7>
jmp    1147 <de_ascii_get_1070_sub_header+0x17>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<de_ascii_get_1070_sub_header>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rdx,%r14
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1040 <feof@plt>
mov    $0xffffffff,%r12d
test   %eax,%eax
jne    11d0 <de_ascii_get_1070_sub_header+0xa0>
mov    %rbp,0x10(%rsp)
mov    %r14,0x18(%rsp)
lea    0x20(%rsp),%rbp
lea    0xe91(%rip),%r13
lea    0xc(%rsp),%r14
lea    0x8(%rsp),%r15
jmp    118c <de_ascii_get_1070_sub_header+0x5c>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <feof@plt>
test   %eax,%eax
jne    11d0 <de_ascii_get_1070_sub_header+0xa0>
mov    %rbp,%rdi
mov    $0x64,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
je     1180 <de_ascii_get_1070_sub_header+0x50>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1050 <sscanf@plt>
cmp    $0x2,%eax
jne    1180 <de_ascii_get_1070_sub_header+0x50>
mov    0xc(%rsp),%eax
mov    0x10(%rsp),%rcx
mov    %eax,(%rcx)
mov    0x8(%rsp),%eax
mov    0x18(%rsp),%rcx
mov    %eax,(%rcx)
xor    %r12d,%r12d
mov    %r12d,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @de_ascii_get_1070_sub_header(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [101 x i8]
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
br label %11
11: ; preds = %31, %3
%12 = load i32*, i32** %5
%13 = call i32 @feof(i32* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br i1 %15, label %16, label %32
16: ; preds = %11
%17 = getelementptr inbounds [101 x i8], [101 x i8]* %8, i64 0, i64 0
%18 = load i32*, i32** %5
%19 = call i64 @fgets(i8* %17, i32 100, i32* %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %31
21: ; preds = %16
%22 = getelementptr inbounds [101 x i8], [101 x i8]* %8, i64 0, i64 0
%23 = call i32 @sscanf(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %9, i32* %10)
%24 = icmp eq i32 %23, 2
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i32, i32* %9
%27 = load i32*, i32** %6
store i32 %26, i32* %27
%28 = load i32, i32* %10
%29 = load i32*, i32** %7
store i32 %28, i32* %29
store i32 0, i32* %4
br label %33
30: ; preds = %21
br label %31
31: ; preds = %30, %16
br label %11
32: ; preds = %11
store i32 -1, i32* %4
br label %33
33: ; preds = %32, %25
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @de_ascii_get_1070_sub_header(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = alloca [101 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%8 = call i32 @feof(i32* %0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %26
10: ; preds = %3
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
br label %13
13: ; preds = %10, %23
%14 = call i64 @fgets(i8* %7, i32 100, i32* %0)
%15 = icmp eq i64 %14, 0
br i1 %15, label %23, label %16
16: ; preds = %13
%17 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
%18 = icmp eq i32 %17, 2
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* %5
store i32 %20, i32* %1
%21 = load i32, i32* %6
store i32 %21, i32* %2
br label %26
22: ; preds = %16
br label %23
23: ; preds = %22, %13
%24 = call i32 @feof(i32* %0)
%25 = icmp eq i32 %24, 0
br i1 %25, label %13, label %26
26: ; preds = %23, %3, %19
%27 = phi i32 [ 0, %19 ], [ -1, %3 ], [ -1, %23 ]
ret i32 %27
}