#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 /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ pbm_getuint(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void pbm_readpbminitrest(FILE *file, int *colsP, int *rowsP) {
  *colsP = (int)pbm_getuint(file);
  *rowsP = (int)pbm_getuint(file);
  if (*colsP < 0) {
    fprintf(stderr, "Number of columns in header is too large.\n");
    exit(-1);
  }
  if (*rowsP < 0) {
    fprintf(stderr, "Number of columns in header is too large.\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<pbm_readpbminitrest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <pbm_getuint@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
call   1050 <pbm_getuint@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jge    1192 <pbm_readpbminitrest+0x62>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
lea    0xe7d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jge    11be <pbm_readpbminitrest+0x8e>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
lea    0xe51(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbm_readpbminitrest>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1050 <pbm_getuint@plt>
mov    %eax,(%r15)
mov    %rbx,%rdi
call   1050 <pbm_getuint@plt>
mov    %eax,(%r14)
cmpl   $0x0,(%r15)
js     1161 <pbm_readpbminitrest+0x31>
test   %eax,%eax
js     1161 <pbm_readpbminitrest+0x31>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Number of columns in header is too large.\0A\00"
define void @pbm_readpbminitrest(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = call i64 @pbm_getuint(i32* %7)
%9 = trunc i64 %8 to i32
%10 = load i32*, i32** %5
store i32 %9, i32* %10
%11 = load i32*, i32** %4
%12 = call i64 @pbm_getuint(i32* %11)
%13 = trunc i64 %12 to i32
%14 = load i32*, i32** %6
store i32 %13, i32* %14
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %3
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 -1)
unreachable
22: ; preds = %3
%23 = load i32*, i32** %6
%24 = load i32, i32* %23
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%29 = call i32 @exit(i32 -1)
unreachable
30: ; preds = %22
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Number of columns in header is too large.\0A\00"
define void @pbm_readpbminitrest(i32* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = tail call i64 @pbm_getuint(i32* %0)
%5 = trunc i64 %4 to i32
store i32 %5, i32* %1
%6 = tail call i64 @pbm_getuint(i32* %0)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @exit(i32 -1)
unreachable
14: ; preds = %3
%15 = icmp slt i32 %7, 0
br i1 %15, label %16, label %20
16: ; preds = %14
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @exit(i32 -1)
unreachable
20: ; preds = %14
ret void
}