#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*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ printf(char *, ...);
int input_assign_normal(FILE *finassign, char *inassignname, int nvtxs,
                        int *assignment) {
  extern FILE *Output_File;
  extern int CHECK_INPUT;
  extern int DEBUG_TRACE;
  int flag;
  int end_flag;
  int i, j;
  int read_int();
  if (DEBUG_TRACE > 0) {
    printf("<Entering input_assign>\n");
  }
  end_flag = 1;
  while (end_flag == 1) {
    assignment[0] = read_int(finassign, &end_flag);
  }
  if (assignment[0] < 0) {
    printf("ERROR: Entry %d in assignment file `%s' less than zero (%d)\n", 1,
           inassignname, assignment[0]);
    return (1);
  }
  if (end_flag == -1) {
    printf("ERROR: No values found in assignment file `%s'\n", inassignname);
    return (1);
  }
  flag = 0;
  if (assignment[0] > nvtxs) {
    flag = assignment[1];
  }
  for (i = 1; i < nvtxs; i++) {
    j = fscanf(finassign, "%d", &(assignment[i]));
    if (j != 1) {
      printf("ERROR: Too few values in assignment file `%s'.\n", inassignname);
      return (1);
    }
    if (assignment[i] < 0) {
      printf("ERROR: Entry %d in assignment file `%s' less than zero (%d)\n",
             i + 1, inassignname, assignment[i]);
      return (1);
    }
    if (assignment[i] > nvtxs) {
      if (assignment[i] > flag) {
        flag = assignment[i];
      }
    }
  }
  if (flag && CHECK_INPUT) {
    printf("WARNING: Possible error in assignment file `%s'\n", inassignname);
    printf("         More assignment sets (%d) than vertices (%d)\n", flag,
           nvtxs);
    if (Output_File != NULL) {
      fprintf(Output_File, "WARNING: Possible error in assignment file `%s'\n",
              inassignname);
      fprintf(Output_File,
              "         More assignment sets (%d) than vertices (%d)\n", flag,
              nvtxs);
    }
  }
  flag = 0;
  end_flag = 0;
  while (!flag && end_flag != -1) {
    read_int(finassign, &end_flag);
    if (!end_flag) {
      flag = 1;
    }
  }
  if (flag && CHECK_INPUT) {
    printf("WARNING: Possible error in assignment file `%s'\n", inassignname);
    printf("         Numerical data found after expected end of file\n");
    if (Output_File != NULL) {
      fprintf(Output_File, "WARNING: Possible error in assignment file `%s'\n",
              inassignname);
      fprintf(Output_File,
              "         Numerical data found after expected end of file\n");
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<input_assign_normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    0x2e6a(%rip),%rax
cmpl   $0x0,(%rax)
jle    1175 <input_assign_normal+0x35>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x30(%rbp)
cmpl   $0x1,-0x30(%rbp)
jne    11a2 <input_assign_normal+0x62>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1060 <read_int@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
jmp    117c <input_assign_normal+0x3c>
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
jge    11d8 <input_assign_normal+0x98>
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
lea    0xe59(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1483 <input_assign_normal+0x343>
cmpl   $0xffffffff,-0x30(%rbp)
jne    1200 <input_assign_normal+0xc0>
mov    -0x18(%rbp),%rsi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1483 <input_assign_normal+0x343>
movl   $0x0,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
cmp    -0x1c(%rbp),%eax
jle    1220 <input_assign_normal+0xe0>
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    130c <input_assign_normal+0x1cc>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rdx
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe39(%rip),%rsi
call   1040 <fscanf@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
je     127d <input_assign_normal+0x13d>
mov    -0x18(%rbp),%rsi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1483 <input_assign_normal+0x343>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    12be <input_assign_normal+0x17e>
mov    -0x34(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xd6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1483 <input_assign_normal+0x343>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x1c(%rbp),%eax
jle    12f9 <input_assign_normal+0x1b9>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x2c(%rbp),%eax
jle    12f4 <input_assign_normal+0x1b4>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
jmp    12f9 <input_assign_normal+0x1b9>
jmp    12fe <input_assign_normal+0x1be>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1227 <input_assign_normal+0xe7>
cmpl   $0x0,-0x2c(%rbp)
je     139c <input_assign_normal+0x25c>
mov    0x2cc3(%rip),%rax
cmpl   $0x0,(%rax)
je     139c <input_assign_normal+0x25c>
mov    -0x18(%rbp),%rsi
lea    0xd88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2c95(%rip),%rax
cmpq   $0x0,(%rax)
je     1397 <input_assign_normal+0x257>
mov    0x2c84(%rip),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rdx
lea    0xd47(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2c68(%rip),%rax
mov    (%rax),%rdi
mov    -0x2c(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xd5a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    139c <input_assign_normal+0x25c>
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x2c(%rbp)
mov    %al,-0x39(%rbp)
jne    13c3 <input_assign_normal+0x283>
cmpl   $0xffffffff,-0x30(%rbp)
setne  %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    13d3 <input_assign_normal+0x293>
jmp    13f8 <input_assign_normal+0x2b8>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1060 <read_int@plt>
cmpl   $0x0,-0x30(%rbp)
jne    13f3 <input_assign_normal+0x2b3>
movl   $0x1,-0x2c(%rbp)
jmp    13aa <input_assign_normal+0x26a>
cmpl   $0x0,-0x2c(%rbp)
je     147c <input_assign_normal+0x33c>
mov    0x2bd7(%rip),%rax
cmpl   $0x0,(%rax)
je     147c <input_assign_normal+0x33c>
mov    -0x18(%rbp),%rsi
lea    0xc9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcf6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2baf(%rip),%rax
cmpq   $0x0,(%rax)
je     1477 <input_assign_normal+0x337>
mov    0x2b9e(%rip),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rdx
lea    0xc61(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2b82(%rip),%rax
mov    (%rax),%rdi
lea    0xcb1(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    147c <input_assign_normal+0x33c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_assign_normal>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%rbp
mov    %rsi,%r13
mov    %rdi,%r14
mov    0x2e4a(%rip),%rax
cmpl   $0x0,(%rax)
mov    %edx,0xc(%rsp)
mov    %edx,%r15d
jle    1196 <input_assign_normal+0x36>
lea    0xfea(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,0x8(%rsp)
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <read_int@plt>
mov    %eax,0x0(%rbp)
mov    0x8(%rsp),%ecx
cmp    $0x1,%ecx
je     11b0 <input_assign_normal+0x50>
test   %eax,%eax
js     136f <input_assign_normal+0x20f>
cmp    $0xffffffff,%ecx
je     138e <input_assign_normal+0x22e>
xor    %r12d,%r12d
cmp    0xc(%rsp),%eax
jle    11e7 <input_assign_normal+0x87>
mov    0x4(%rbp),%r12d
mov    %r13,0x10(%rsp)
cmpl   $0x2,0xc(%rsp)
jl     1248 <input_assign_normal+0xe8>
add    $0x4,%rbp
xor    %ebx,%ebx
lea    0xe6d(%rip),%r13
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
jne    139a <input_assign_normal+0x23a>
mov    0x0(%rbp),%ecx
test   %ecx,%ecx
js     13c3 <input_assign_normal+0x263>
cmp    %r12d,%ecx
mov    %r12d,%eax
cmovg  %ecx,%eax
cmp    %r15d,%ecx
cmovg  %eax,%r12d
add    $0x4,%rbp
lea    (%r15,%rbx,1),%rax
add    $0xffffffffffffffff,%rax
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rax
jne    1200 <input_assign_normal+0xa0>
mov    0x2d91(%rip),%r15
test   %r12d,%r12d
mov    0x10(%rsp),%r13
je     12bd <input_assign_normal+0x15d>
cmpl   $0x0,(%r15)
je     12bd <input_assign_normal+0x15d>
lea    0xe3a(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe5a(%rip),%rdi
mov    %r12d,%esi
mov    0xc(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d5c(%rip),%rbx
mov    (%rbx),%rdi
test   %rdi,%rdi
je     12bd <input_assign_normal+0x15d>
lea    0xe05(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%rdi
lea    0xe22(%rip),%rsi
mov    %r12d,%edx
mov    0xc(%rsp),%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%r12
mov    $0x1,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <read_int@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
cmove  %ebp,%ebx
test   %ebx,%ebx
jne    12ff <input_assign_normal+0x19f>
cmp    $0xffffffff,%eax
jne    12e0 <input_assign_normal+0x180>
xor    %ebp,%ebp
test   %ebx,%ebx
je     13b2 <input_assign_normal+0x252>
cmpl   $0x0,(%r15)
je     13b2 <input_assign_normal+0x252>
lea    0xd86(%rip),%rdi
xor    %ebp,%ebp
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe15(%rip),%rdi
call   1030 <puts@plt>
mov    0x2caf(%rip),%rbx
mov    (%rbx),%rdi
test   %rdi,%rdi
je     13b2 <input_assign_normal+0x252>
lea    0xd58(%rip),%rsi
xor    %ebp,%ebp
mov    %r13,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%rcx
lea    0xdaa(%rip),%rdi
mov    $0x39,%esi
mov    $0x1,%edx
call   1080 <fwrite@plt>
jmp    13b2 <input_assign_normal+0x252>
lea    0xc8a(%rip),%rdi
mov    $0x1,%ebp
mov    $0x1,%esi
mov    %r13,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    13b2 <input_assign_normal+0x252>
lea    0xca8(%rip),%rdi
mov    %r13,%rsi
jmp    13a6 <input_assign_normal+0x246>
lea    0xccf(%rip),%rdi
mov    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x2,%esi
sub    %ebx,%esi
lea    0xc2f(%rip),%rdi
mov    0x10(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    13ad <input_assign_normal+0x24d>

LLVM IR (-O0):
@DEBUG_TRACE = external global i32
@.str = [25 x i8] c"<Entering input_assign>\0A\00"
@.str.1 = [61 x i8] c"ERROR: Entry %d in assignment file `%s' less than zero (%d)\0A\00"
@.str.2 = [48 x i8] c"ERROR: No values found in assignment file `%s'\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [48 x i8] c"ERROR: Too few values in assignment file `%s'.\0A\00"
@CHECK_INPUT = external global i32
@.str.5 = [49 x i8] c"WARNING: Possible error in assignment file `%s'\0A\00"
@.str.6 = [55 x i8] c" More assignment sets (%d) than vertices (%d)\0A\00"
@Output_File = external global i32*
@.str.7 = [58 x i8] c" Numerical data found after expected end of file\0A\00"
define i32 @input_assign_normal(i32* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32* %3, i32** %9
%14 = load i32, i32* @DEBUG_TRACE
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %4
store i32 1, i32* %11
br label %19
19: ; preds = %22, %18
%20 = load i32, i32* %11
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i32*, i32** %6
%24 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @read_int to i32 (i32*, i32*, ...)*)(i32* %23, i32* %11)
%25 = load i32*, i32** %9
%26 = getelementptr inbounds i32, i32* %25, i64 0
store i32 %24, i32* %26
br label %19
27: ; preds = %19
%28 = load i32*, i32** %9
%29 = getelementptr inbounds i32, i32* %28, i64 0
%30 = load i32, i32* %29
%31 = icmp slt i32 %30, 0
br i1 %31, label %32, label %38
32: ; preds = %27
%33 = load i8*, i8** %7
%34 = load i32*, i32** %9
%35 = getelementptr inbounds i32, i32* %34, i64 0
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i32 1, i8* %33, i32 %36)
store i32 1, i32* %5
br label %174
38: ; preds = %27
%39 = load i32, i32* %11
%40 = icmp eq i32 %39, -1
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = load i8*, i8** %7
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i8* %42)
store i32 1, i32* %5
br label %174
44: ; preds = %38
store i32 0, i32* %10
%45 = load i32*, i32** %9
%46 = getelementptr inbounds i32, i32* %45, i64 0
%47 = load i32, i32* %46
%48 = load i32, i32* %8
%49 = icmp sgt i32 %47, %48
br i1 %49, label %50, label %54
50: ; preds = %44
%51 = load i32*, i32** %9
%52 = getelementptr inbounds i32, i32* %51, i64 1
%53 = load i32, i32* %52
store i32 %53, i32* %10
br label %54
54: ; preds = %50, %44
store i32 1, i32* %12
br label %55
55: ; preds = %112, %54
%56 = load i32, i32* %12
%57 = load i32, i32* %8
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %115
59: ; preds = %55
%60 = load i32*, i32** %6
%61 = load i32*, i32** %9
%62 = load i32, i32* %12
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i32, i32* %61, i64 %63
%65 = call i32 @fscanf(i32* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %64)
store i32 %65, i32* %13
%66 = load i32, i32* %13
%67 = icmp ne i32 %66, 1
br i1 %67, label %68, label %71
68: ; preds = %59
%69 = load i8*, i8** %7
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), i8* %69)
store i32 1, i32* %5
br label %174
71: ; preds = %59
%72 = load i32*, i32** %9
%73 = load i32, i32* %12
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i32, i32* %72, i64 %74
%76 = load i32, i32* %75
%77 = icmp slt i32 %76, 0
br i1 %77, label %78, label %88
78: ; preds = %71
%79 = load i32, i32* %12
%80 = add nsw i32 %79, 1
%81 = load i8*, i8** %7
%82 = load i32*, i32** %9
%83 = load i32, i32* %12
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i32, i32* %82, i64 %84
%86 = load i32, i32* %85
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i32 %80, i8* %81, i32 %86)
store i32 1, i32* %5
br label %174
88: ; preds = %71
%89 = load i32*, i32** %9
%90 = load i32, i32* %12
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i32, i32* %89, i64 %91
%93 = load i32, i32* %92
%94 = load i32, i32* %8
%95 = icmp sgt i32 %93, %94
br i1 %95, label %96, label %111
96: ; preds = %88
%97 = load i32*, i32** %9
%98 = load i32, i32* %12
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i32, i32* %97, i64 %99
%101 = load i32, i32* %100
%102 = load i32, i32* %10
%103 = icmp sgt i32 %101, %102
br i1 %103, label %104, label %110
104: ; preds = %96
%105 = load i32*, i32** %9
%106 = load i32, i32* %12
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i32, i32* %105, i64 %107
%109 = load i32, i32* %108
store i32 %109, i32* %10
br label %110
110: ; preds = %104, %96
br label %111
111: ; preds = %110, %88
br label %112
112: ; preds = %111
%113 = load i32, i32* %12
%114 = add nsw i32 %113, 1
store i32 %114, i32* %12
br label %55
115: ; preds = %55
%116 = load i32, i32* %10
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %138
118: ; preds = %115
%119 = load i32, i32* @CHECK_INPUT
%120 = icmp ne i32 %119, 0
br i1 %120, label %121, label %138
121: ; preds = %118
%122 = load i8*, i8** %7
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i8* %122)
%124 = load i32, i32* %10
%125 = load i32, i32* %8
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0), i32 %124, i32 %125)
%127 = load i32*, i32** @Output_File
%128 = icmp ne i32* %127, null
br i1 %128, label %129, label %137
129: ; preds = %121
%130 = load i32*, i32** @Output_File
%131 = load i8*, i8** %7
%132 = call i32 (i32*, i8*, ...) @fprintf(i32* %130, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i8* %131)
%133 = load i32*, i32** @Output_File
%134 = load i32, i32* %10
%135 = load i32, i32* %8
%136 = call i32 (i32*, i8*, ...) @fprintf(i32* %133, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0), i32 %134, i32 %135)
br label %137
137: ; preds = %129, %121
br label %138
138: ; preds = %137, %118, %115
store i32 0, i32* %10
store i32 0, i32* %11
br label %139
139: ; preds = %153, %138
%140 = load i32, i32* %10
%141 = icmp ne i32 %140, 0
br i1 %141, label %145, label %142
142: ; preds = %139
%143 = load i32, i32* %11
%144 = icmp ne i32 %143, -1
br label %145
145: ; preds = %142, %139
%146 = phi i1 [ false, %139 ], [ %144, %142 ]
br i1 %146, label %147, label %154
147: ; preds = %145
%148 = load i32*, i32** %6
%149 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @read_int to i32 (i32*, i32*, ...)*)(i32* %148, i32* %11)
%150 = load i32, i32* %11
%151 = icmp ne i32 %150, 0
br i1 %151, label %153, label %152
152: ; preds = %147
store i32 1, i32* %10
br label %153
153: ; preds = %152, %147
br label %139
154: ; preds = %145
%155 = load i32, i32* %10
%156 = icmp ne i32 %155, 0
br i1 %156, label %157, label %173
157: ; preds = %154
%158 = load i32, i32* @CHECK_INPUT
%159 = icmp ne i32 %158, 0
br i1 %159, label %160, label %173
160: ; preds = %157
%161 = load i8*, i8** %7
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i8* %161)
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0))
%164 = load i32*, i32** @Output_File
%165 = icmp ne i32* %164, null
br i1 %165, label %166, label %172
166: ; preds = %160
%167 = load i32*, i32** @Output_File
%168 = load i8*, i8** %7
%169 = call i32 (i32*, i8*, ...) @fprintf(i32* %167, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i8* %168)
%170 = load i32*, i32** @Output_File
%171 = call i32 (i32*, i8*, ...) @fprintf(i32* %170, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0))
br label %172
172: ; preds = %166, %160
br label %173
173: ; preds = %172, %157, %154
store i32 0, i32* %5
br label %174
174: ; preds = %173, %78, %68, %41, %32
%175 = load i32, i32* %5
ret i32 %175
}

LLVM IR (-O2):
@DEBUG_TRACE = external global i32
@.str.1 = [61 x i8] c"ERROR: Entry %d in assignment file `%s' less than zero (%d)\0A\00"
@.str.2 = [48 x i8] c"ERROR: No values found in assignment file `%s'\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [48 x i8] c"ERROR: Too few values in assignment file `%s'.\0A\00"
@CHECK_INPUT = external global i32
@.str.5 = [49 x i8] c"WARNING: Possible error in assignment file `%s'\0A\00"
@.str.6 = [55 x i8] c" More assignment sets (%d) than vertices (%d)\0A\00"
@Output_File = external global i32*
@.str.7 = [58 x i8] c" Numerical data found after expected end of file\0A\00"
@str = [57 x i8] c" Numerical data found after expected end of file\00"
@str.8 = [24 x i8] c"<Entering input_assign>\00"
define i32 @input_assign_normal(i32* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = load i32, i32* @DEBUG_TRACE
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.8, i64 0, i64 0))
br label %11
11: ; preds = %9, %4
store i32 1, i32* %5
br label %12
12: ; preds = %11, %12
%13 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @read_int to i32 (i32*, i32*, ...)*)(i32* %0, i32* %5)
store i32 %13, i32* %3
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 1
br i1 %15, label %12, label %16
16: ; preds = %12
%17 = icmp slt i32 %13, 0
br i1 %17, label %18, label %20
18: ; preds = %16
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i32 1, i8* %1, i32 %13)
br label %95
20: ; preds = %16
%21 = icmp eq i32 %14, -1
br i1 %21, label %22, label %24
22: ; preds = %20
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i8* %1)
br label %95
24: ; preds = %20
%25 = icmp sgt i32 %13, %2
br i1 %25, label %26, label %29
26: ; preds = %24
%27 = getelementptr inbounds i32, i32* %3, i64 1
%28 = load i32, i32* %27
br label %29
29: ; preds = %26, %24
%30 = phi i32 [ %28, %26 ], [ 0, %24 ]
%31 = icmp sgt i32 %2, 1
br i1 %31, label %32, label %56
32: ; preds = %29
%33 = zext i32 %2 to i64
br label %34
34: ; preds = %32, %49
%35 = phi i64 [ 1, %32 ], [ %54, %49 ]
%36 = phi i32 [ %30, %32 ], [ %53, %49 ]
%37 = getelementptr inbounds i32, i32* %3, i64 %35
%38 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %37)
%39 = icmp eq i32 %38, 1
br i1 %39, label %42, label %40
40: ; preds = %34
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), i8* %1)
br label %95
42: ; preds = %34
%43 = load i32, i32* %37
%44 = icmp slt i32 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %42
%46 = trunc i64 %35 to i32
%47 = add nuw nsw i32 %46, 1
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i32 %47, i8* %1, i32 %43)
br label %95
49: ; preds = %42
%50 = icmp sgt i32 %43, %2
%51 = icmp sgt i32 %43, %36
%52 = select i1 %50, i1 %51, i1 false
%53 = select i1 %52, i32 %43, i32 %36
%54 = add nuw nsw i64 %35, 1
%55 = icmp eq i64 %54, %33
br i1 %55, label %56, label %34
56: ; preds = %49, %29
%57 = phi i32 [ %30, %29 ], [ %53, %49 ]
%58 = icmp ne i32 %57, 0
%59 = load i32, i32* @CHECK_INPUT
%60 = icmp ne i32 %59, 0
%61 = select i1 %58, i1 %60, i1 false
br i1 %61, label %62, label %71
62: ; preds = %56
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i8* %1)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0), i32 %57, i32 %2)
%65 = load i32*, i32** @Output_File
%66 = icmp eq i32* %65, null
br i1 %66, label %71, label %67
67: ; preds = %62
%68 = call i32 (i32*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i8* %1)
%69 = load i32*, i32** @Output_File
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0), i32 %57, i32 %2)
br label %71
71: ; preds = %56, %67, %62
store i32 0, i32* %5
br label %72
72: ; preds = %71, %72
%73 = phi i32 [ %77, %72 ], [ 0, %71 ]
%74 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @read_int to i32 (i32*, i32*, ...)*)(i32* %0, i32* %5)
%75 = load i32, i32* %5
%76 = icmp eq i32 %75, 0
%77 = select i1 %76, i32 1, i32 %73
%78 = icmp ne i32 %77, 0
%79 = icmp ne i32 %75, -1
%80 = xor i1 %78, true
%81 = select i1 %80, i1 %79, i1 false
br i1 %81, label %72, label %82
82: ; preds = %72
%83 = load i32, i32* @CHECK_INPUT
%84 = icmp ne i32 %83, 0
%85 = select i1 %78, i1 %84, i1 false
br i1 %85, label %86, label %95
86: ; preds = %82
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i8* %1)
%88 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%89 = load i32*, i32** @Output_File
%90 = icmp eq i32* %89, null
br i1 %90, label %95, label %91
91: ; preds = %86
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %89, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i8* %1)
%93 = load i32*, i32** @Output_File
%94 = call i64 @fwrite(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0), i64 57, i64 1, i32* %93)
br label %95
95: ; preds = %82, %91, %86, %45, %40, %22, %18
%96 = phi i32 [ 1, %18 ], [ 1, %22 ], [ 1, %40 ], [ 1, %45 ], [ 0, %86 ], [ 0, %91 ], [ 0, %82 ]
ret i32 %96
}