#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void check_vertex_count(int vertex_count, int graph_num) {
  if (vertex_count < 0) {
    printf("Improper graph format, negative vertex count\n");
    printf("Graph   %5d: BAD GRAPH\n", graph_num);
    exit(EXIT_FAILURE);
  }
  if (vertex_count > 512) {
    printf("vertex count is %d max is %d. Increase NMAX and recompile.\n",
           vertex_count, 512);
    printf("Graph   %5d: BAD GRAPH\n", graph_num);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<check_vertex_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1165 <check_vertex_count+0x45>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
cmpl   $0x200,-0x4(%rbp)
jle    11a7 <check_vertex_count+0x87>
mov    -0x4(%rbp),%esi
lea    0xeca(%rip),%rdi
mov    $0x200,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_vertex_count>:
push   %rbx
mov    %esi,%ebx
test   %edi,%edi
js     1143 <check_vertex_count+0x13>
mov    %edi,%esi
cmp    $0x201,%edi
jae    1151 <check_vertex_count+0x21>
pop    %rbx
ret
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
jmp    1164 <check_vertex_count+0x34>
lea    0xec0(%rip),%rdi
mov    $0x200,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Improper graph format, negative vertex count\0A\00"
@.str.1 = [24 x i8] c"Graph %5d: BAD GRAPH\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [60 x i8] c"vertex count is %d max is %d. Increase NMAX and recompile.\0A\00"
define void @check_vertex_count(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, 512
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 512)
%19 = load i32, i32* %4
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
23: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"Graph %5d: BAD GRAPH\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [60 x i8] c"vertex count is %d max is %d. Increase NMAX and recompile.\0A\00"
@str = [45 x i8] c"Improper graph format, negative vertex count\00"
define void @check_vertex_count(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = icmp ugt i32 %0, 512
br i1 %10, label %11, label %16
11: ; preds = %9
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i32 %0, i32 512)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%14 = load i32, i32* @EXIT_FAILURE
%15 = tail call i32 @exit(i32 %14)
unreachable
16: ; preds = %9
ret void
}