#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 */
struct obj_data {
  int dummy;
};
struct extra_descr_data {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assume(int, int, int, char *);
char *fread_string(int /*<<< orphan*/ *);
int fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int sscanf(char *, char *, int *);
void check_objects(FILE *fl) {
  int virtual_nr, old_virtual, antal, flag;
  char *temp;
  struct obj_data *obj;
  int tmp, i;
  char chk[256];
  struct extra_descr_data *new_descr;
  old_virtual = -1;
  rewind(fl);
  antal = fscanf(fl, " %s \n", chk);
  assume(antal, 1, virtual_nr, "First #xxx number");
  do {
    antal = sscanf(chk, " #%d\n", &virtual_nr);
    assume(antal, 1, virtual_nr, "Reading #xxx");
    if (old_virtual > virtual_nr)
      assume(0, 1, virtual_nr, "Error - #'s not in order.");
    old_virtual = virtual_nr;
    temp = fread_string(fl);
    if (flag = (*temp != '$')) {
      temp = fread_string(fl);
      temp = fread_string(fl);
      temp = fread_string(fl);
      antal = fscanf(fl, " %d ", &tmp);
      assume(antal, 1, virtual_nr, "Error reading type flag");
      antal = fscanf(fl, " %d ", &tmp);
      assume(antal, 1, virtual_nr, "Extra Flag");
      antal = fscanf(fl, " %d ", &tmp);
      assume(antal, 1, virtual_nr, "wear_flags");
      antal = fscanf(fl, " %d ", &tmp);
      assume(antal, 1, virtual_nr, "value[0]");
      antal = fscanf(fl, " %d ", &tmp);
      assume(antal, 1, virtual_nr, "value[1]");
      antal = fscanf(fl, " %d ", &tmp);
      assume(antal, 1, virtual_nr, "value[2]");
      antal = fscanf(fl, " %d ", &tmp);
      assume(antal, 1, virtual_nr, "value[3]");
      antal = fscanf(fl, " %d ", &tmp);
      assume(antal, 1, virtual_nr, "Weight");
      antal = fscanf(fl, " %d \n", &tmp);
      assume(antal, 1, virtual_nr, "Cost");
      antal = fscanf(fl, " %d \n", &tmp);
      assume(antal, 1, virtual_nr, "Cost Per Day");
      while (fscanf(fl, " %s \n", chk), *chk == 'E') {
        temp = fread_string(fl);
        temp = fread_string(fl);
      }
      for (i = 0; (i < 2) && (*chk == 'A'); i++) {
        antal = fscanf(fl, " %d ", &tmp);
        assume(antal, 1, virtual_nr, "affected location");
        antal = fscanf(fl, " %d \n", &tmp);
        assume(antal, 1, virtual_nr, "Modifier");
        antal = fscanf(fl, " %s \n", chk);
        assume(antal, 1, virtual_nr, "Next string with E/A/$");
      }
    }
  } while (flag);
}


x86 assembly (clang, -O0):
<check_objects>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x8(%rbp),%rdi
lea    -0x130(%rbp),%rdx
lea    0xe7f(%rip),%rsi
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xe69(%rip),%rcx
call   1070 <assume@plt>
lea    -0x130(%rbp),%rdi
lea    0xe68(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xe50(%rip),%rcx
call   1070 <assume@plt>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11f5 <check_objects+0xa5>
mov    -0xc(%rbp),%edx
xor    %edi,%edi
mov    $0x1,%esi
lea    0xe3b(%rip),%rcx
call   1070 <assume@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <fread_string@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x24,%eax
setne  %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x18(%rbp)
test   $0x1,%al
jne    122d <check_objects+0xdd>
jmp    1561 <check_objects+0x411>
mov    -0x8(%rbp),%rdi
call   1060 <fread_string@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <fread_string@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <fread_string@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xde6(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xdcb(%rip),%rcx
call   1070 <assume@plt>
mov    -0x8(%rbp),%rdi
lea    0xdb6(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xdb3(%rip),%rcx
call   1070 <assume@plt>
mov    -0x8(%rbp),%rdi
lea    0xd86(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xd8e(%rip),%rcx
call   1070 <assume@plt>
mov    -0x8(%rbp),%rdi
lea    0xd56(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xd69(%rip),%rcx
call   1070 <assume@plt>
mov    -0x8(%rbp),%rdi
lea    0xd26(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xd42(%rip),%rcx
call   1070 <assume@plt>
mov    -0x8(%rbp),%rdi
lea    0xcf6(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xd1b(%rip),%rcx
call   1070 <assume@plt>
mov    -0x8(%rbp),%rdi
lea    0xcc6(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xcf4(%rip),%rcx
call   1070 <assume@plt>
mov    -0x8(%rbp),%rdi
lea    0xc96(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xccd(%rip),%rcx
call   1070 <assume@plt>
mov    -0x8(%rbp),%rdi
lea    0xcc4(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xcaa(%rip),%rcx
call   1070 <assume@plt>
mov    -0x8(%rbp),%rdi
lea    0xc94(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xc7f(%rip),%rcx
call   1070 <assume@plt>
mov    -0x8(%rbp),%rdi
lea    -0x130(%rbp),%rdx
lea    0xbba(%rip),%rsi
mov    $0x0,%al
call   1040 <fscanf@plt>
movsbl -0x130(%rbp),%eax
cmp    $0x45,%eax
jne    147c <check_objects+0x32c>
mov    -0x8(%rbp),%rdi
call   1060 <fread_string@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <fread_string@plt>
mov    %rax,-0x20(%rbp)
jmp    1434 <check_objects+0x2e4>
movl   $0x0,-0x30(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0x30(%rbp)
mov    %al,-0x139(%rbp)
jge    14a8 <check_objects+0x358>
movsbl -0x130(%rbp),%eax
cmp    $0x41,%eax
sete   %al
mov    %al,-0x139(%rbp)
mov    -0x139(%rbp),%al
test   $0x1,%al
jne    14bb <check_objects+0x36b>
jmp    155c <check_objects+0x40c>
mov    -0x8(%rbp),%rdi
lea    0xb7f(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xbd5(%rip),%rcx
call   1070 <assume@plt>
mov    -0x8(%rbp),%rdi
lea    0xbad(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xbb7(%rip),%rcx
call   1070 <assume@plt>
mov    -0x8(%rbp),%rdi
lea    -0x130(%rbp),%rdx
lea    0xad3(%rip),%rsi
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
lea    0xb8d(%rip),%rcx
call   1070 <assume@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1483 <check_objects+0x333>
jmp    1561 <check_objects+0x411>
jmp    1566 <check_objects+0x416>
cmpl   $0x0,-0x18(%rbp)
jne    11a2 <check_objects+0x52>
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_objects>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %rdi,%rbx
call   1030 <rewind@plt>
lea    0xe90(%rip),%r14
lea    0x10(%rsp),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
lea    0xe7a(%rip),%rcx
mov    %eax,%edi
mov    $0x1,%esi
call   1070 <assume@plt>
movl   $0xffffffff,0x8(%rsp)
ff
lea    0xe9e(%rip),%r12
lea    0xc(%rsp),%r13
nopl   0x0(%rax)
mov    0x8(%rsp),%ebp
mov    %r15,%rdi
lea    0xe5a(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1050 <sscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xe44(%rip),%rcx
call   1070 <assume@plt>
mov    0x4(%rsp),%edx
cmp    %edx,%ebp
jle    1210 <check_objects+0xc0>
xor    %edi,%edi
mov    $0x1,%esi
lea    0xe36(%rip),%rcx
call   1070 <assume@plt>
mov    0x4(%rsp),%eax
mov    %eax,0x8(%rsp)
jmp    1214 <check_objects+0xc4>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,0x8(%rsp)
mov    %rbx,%rdi
call   1060 <fread_string@plt>
cmpb   $0x24,(%rax)
je     150a <check_objects+0x3ba>
mov    %rbx,%rdi
call   1060 <fread_string@plt>
mov    %rbx,%rdi
call   1060 <fread_string@plt>
mov    %rbx,%rdi
call   1060 <fread_string@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xdeb(%rip),%rcx
call   1070 <assume@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xddc(%rip),%rcx
call   1070 <assume@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xdc0(%rip),%rcx
call   1070 <assume@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xda4(%rip),%rcx
call   1070 <assume@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xd86(%rip),%rcx
call   1070 <assume@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xd68(%rip),%rcx
call   1070 <assume@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xd4a(%rip),%rcx
call   1070 <assume@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xd2c(%rip),%rcx
call   1070 <assume@plt>
mov    %rbx,%rdi
lea    0xd24(%rip),%rbp
mov    %rbp,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xd0b(%rip),%rcx
call   1070 <assume@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xce9(%rip),%rcx
call   1070 <assume@plt>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
movzbl 0x10(%rsp),%eax
cmp    $0x45,%al
jne    1400 <check_objects+0x2b0>
mov    %rbx,%rdi
call   1060 <fread_string@plt>
mov    %rbx,%rdi
call   1060 <fread_string@plt>
jmp    13d0 <check_objects+0x280>
nopl   0x0(%rax,%rax,1)
cmp    $0x41,%al
jne    11b0 <check_objects+0x60>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xc91(%rip),%rcx
call   1070 <assume@plt>
mov    %rbx,%rdi
lea    0xc6a(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xc78(%rip),%rcx
call   1070 <assume@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xc5a(%rip),%rcx
call   1070 <assume@plt>
cmpb   $0x41,0x10(%rsp)
jne    11b0 <check_objects+0x60>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xc0d(%rip),%rcx
call   1070 <assume@plt>
mov    %rbx,%rdi
lea    0xbe6(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xbf4(%rip),%rcx
call   1070 <assume@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
mov    %eax,%edi
mov    $0x1,%esi
lea    0xbd6(%rip),%rcx
call   1070 <assume@plt>
jmp    11b0 <check_objects+0x60>
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.obj_data = type { i32 }
%struct.extra_descr_data = type { i32 }
@.str = [6 x i8] c" %s \0A\00"
@.str.1 = [18 x i8] c"First #xxx number\00"
@.str.2 = [6 x i8] c" #%d\0A\00"
@.str.3 = [13 x i8] c"Reading #xxx\00"
@.str.4 = [26 x i8] c"Error - #'s not in order.\00"
@.str.5 = [5 x i8] c" %d \00"
@.str.6 = [24 x i8] c"Error reading type flag\00"
@.str.7 = [11 x i8] c"Extra Flag\00"
@.str.8 = [11 x i8] c"wear_flags\00"
@.str.9 = [9 x i8] c"value[0]\00"
@.str.10 = [9 x i8] c"value[1]\00"
@.str.11 = [9 x i8] c"value[2]\00"
@.str.12 = [9 x i8] c"value[3]\00"
@.str.13 = [7 x i8] c"Weight\00"
@.str.14 = [6 x i8] c" %d \0A\00"
@.str.15 = [5 x i8] c"Cost\00"
@.str.16 = [13 x i8] c"Cost Per Day\00"
@.str.17 = [18 x i8] c"affected location\00"
@.str.18 = [9 x i8] c"Modifier\00"
@.str.19 = [23 x i8] c"Next string with E/A/$\00"
define void @check_objects(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca %struct.obj_data*
%9 = alloca i32
%10 = alloca i32
%11 = alloca [256 x i8]
%12 = alloca %struct.extra_descr_data*
store i32* %0, i32** %2
store i32 -1, i32* %4
%13 = load i32*, i32** %2
%14 = call i32 @rewind(i32* %13)
%15 = load i32*, i32** %2
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%17 = call i32 (i32*, i8*, ...) @fscanf(i32* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %16)
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = load i32, i32* %3
%20 = call i32 @assume(i32 %18, i32 1, i32 %19, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %145, %1
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%23 = call i32 @sscanf(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %3)
store i32 %23, i32* %5
%24 = load i32, i32* %5
%25 = load i32, i32* %3
%26 = call i32 @assume(i32 %24, i32 1, i32 %25, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%27 = load i32, i32* %4
%28 = load i32, i32* %3
%29 = icmp sgt i32 %27, %28
br i1 %29, label %30, label %33
30: ; preds = %21
%31 = load i32, i32* %3
%32 = call i32 @assume(i32 0, i32 1, i32 %31, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
br label %33
33: ; preds = %30, %21
%34 = load i32, i32* %3
store i32 %34, i32* %4
%35 = load i32*, i32** %2
%36 = call i8* @fread_string(i32* %35)
store i8* %36, i8** %7
%37 = load i8*, i8** %7
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp ne i32 %39, 36
%41 = zext i1 %40 to i32
store i32 %41, i32* %6
br i1 %40, label %42, label %144
42: ; preds = %33
%43 = load i32*, i32** %2
%44 = call i8* @fread_string(i32* %43)
store i8* %44, i8** %7
%45 = load i32*, i32** %2
%46 = call i8* @fread_string(i32* %45)
store i8* %46, i8** %7
%47 = load i32*, i32** %2
%48 = call i8* @fread_string(i32* %47)
store i8* %48, i8** %7
%49 = load i32*, i32** %2
%50 = call i32 (i32*, i8*, ...) @fscanf(i32* %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %9)
store i32 %50, i32* %5
%51 = load i32, i32* %5
%52 = load i32, i32* %3
%53 = call i32 @assume(i32 %51, i32 1, i32 %52, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%54 = load i32*, i32** %2
%55 = call i32 (i32*, i8*, ...) @fscanf(i32* %54, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %9)
store i32 %55, i32* %5
%56 = load i32, i32* %5
%57 = load i32, i32* %3
%58 = call i32 @assume(i32 %56, i32 1, i32 %57, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%59 = load i32*, i32** %2
%60 = call i32 (i32*, i8*, ...) @fscanf(i32* %59, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %9)
store i32 %60, i32* %5
%61 = load i32, i32* %5
%62 = load i32, i32* %3
%63 = call i32 @assume(i32 %61, i32 1, i32 %62, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%64 = load i32*, i32** %2
%65 = call i32 (i32*, i8*, ...) @fscanf(i32* %64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %9)
store i32 %65, i32* %5
%66 = load i32, i32* %5
%67 = load i32, i32* %3
%68 = call i32 @assume(i32 %66, i32 1, i32 %67, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%69 = load i32*, i32** %2
%70 = call i32 (i32*, i8*, ...) @fscanf(i32* %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %9)
store i32 %70, i32* %5
%71 = load i32, i32* %5
%72 = load i32, i32* %3
%73 = call i32 @assume(i32 %71, i32 1, i32 %72, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%74 = load i32*, i32** %2
%75 = call i32 (i32*, i8*, ...) @fscanf(i32* %74, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %9)
store i32 %75, i32* %5
%76 = load i32, i32* %5
%77 = load i32, i32* %3
%78 = call i32 @assume(i32 %76, i32 1, i32 %77, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%79 = load i32*, i32** %2
%80 = call i32 (i32*, i8*, ...) @fscanf(i32* %79, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %9)
store i32 %80, i32* %5
%81 = load i32, i32* %5
%82 = load i32, i32* %3
%83 = call i32 @assume(i32 %81, i32 1, i32 %82, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%84 = load i32*, i32** %2
%85 = call i32 (i32*, i8*, ...) @fscanf(i32* %84, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %9)
store i32 %85, i32* %5
%86 = load i32, i32* %5
%87 = load i32, i32* %3
%88 = call i32 @assume(i32 %86, i32 1, i32 %87, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%89 = load i32*, i32** %2
%90 = call i32 (i32*, i8*, ...) @fscanf(i32* %89, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32* %9)
store i32 %90, i32* %5
%91 = load i32, i32* %5
%92 = load i32, i32* %3
%93 = call i32 @assume(i32 %91, i32 1, i32 %92, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%94 = load i32*, i32** %2
%95 = call i32 (i32*, i8*, ...) @fscanf(i32* %94, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32* %9)
store i32 %95, i32* %5
%96 = load i32, i32* %5
%97 = load i32, i32* %3
%98 = call i32 @assume(i32 %96, i32 1, i32 %97, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0))
br label %99
99: ; preds = %107, %42
%100 = load i32*, i32** %2
%101 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%102 = call i32 (i32*, i8*, ...) @fscanf(i32* %100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %101)
%103 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
%106 = icmp eq i32 %105, 69
br i1 %106, label %107, label %112
107: ; preds = %99
%108 = load i32*, i32** %2
%109 = call i8* @fread_string(i32* %108)
store i8* %109, i8** %7
%110 = load i32*, i32** %2
%111 = call i8* @fread_string(i32* %110)
store i8* %111, i8** %7
br label %99
112: ; preds = %99
store i32 0, i32* %10
br label %113
113: ; preds = %140, %112
%114 = load i32, i32* %10
%115 = icmp slt i32 %114, 2
br i1 %115, label %116, label %121
116: ; preds = %113
%117 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%118 = load i8, i8* %117
%119 = sext i8 %118 to i32
%120 = icmp eq i32 %119, 65
br label %121
121: ; preds = %116, %113
%122 = phi i1 [ false, %113 ], [ %120, %116 ]
br i1 %122, label %123, label %143
123: ; preds = %121
%124 = load i32*, i32** %2
%125 = call i32 (i32*, i8*, ...) @fscanf(i32* %124, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %9)
store i32 %125, i32* %5
%126 = load i32, i32* %5
%127 = load i32, i32* %3
%128 = call i32 @assume(i32 %126, i32 1, i32 %127, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
%129 = load i32*, i32** %2
%130 = call i32 (i32*, i8*, ...) @fscanf(i32* %129, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32* %9)
store i32 %130, i32* %5
%131 = load i32, i32* %5
%132 = load i32, i32* %3
%133 = call i32 @assume(i32 %131, i32 1, i32 %132, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0))
%134 = load i32*, i32** %2
%135 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%136 = call i32 (i32*, i8*, ...) @fscanf(i32* %134, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %135)
store i32 %136, i32* %5
%137 = load i32, i32* %5
%138 = load i32, i32* %3
%139 = call i32 @assume(i32 %137, i32 1, i32 %138, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0))
br label %140
140: ; preds = %123
%141 = load i32, i32* %10
%142 = add nsw i32 %141, 1
store i32 %142, i32* %10
br label %113
143: ; preds = %121
br label %144
144: ; preds = %143, %33
br label %145
145: ; preds = %144
%146 = load i32, i32* %6
%147 = icmp ne i32 %146, 0
br i1 %147, label %21, label %148
148: ; preds = %145
ret void
}

LLVM IR (-O2):
%struct.obj_data = type { i32 }
%struct.extra_descr_data = type { i32 }
@.str = [6 x i8] c" %s \0A\00"
@.str.1 = [18 x i8] c"First #xxx number\00"
@.str.2 = [6 x i8] c" #%d\0A\00"
@.str.3 = [13 x i8] c"Reading #xxx\00"
@.str.4 = [26 x i8] c"Error - #'s not in order.\00"
@.str.5 = [5 x i8] c" %d \00"
@.str.6 = [24 x i8] c"Error reading type flag\00"
@.str.7 = [11 x i8] c"Extra Flag\00"
@.str.8 = [11 x i8] c"wear_flags\00"
@.str.9 = [9 x i8] c"value[0]\00"
@.str.10 = [9 x i8] c"value[1]\00"
@.str.11 = [9 x i8] c"value[2]\00"
@.str.12 = [9 x i8] c"value[3]\00"
@.str.13 = [7 x i8] c"Weight\00"
@.str.14 = [6 x i8] c" %d \0A\00"
@.str.15 = [5 x i8] c"Cost\00"
@.str.16 = [13 x i8] c"Cost Per Day\00"
@.str.17 = [18 x i8] c"affected location\00"
@.str.18 = [9 x i8] c"Modifier\00"
@.str.19 = [23 x i8] c"Next string with E/A/$\00"
define void @check_objects(i32* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [256 x i8]
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%8 = tail call i32 @rewind(i32* %0)
%9 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
%10 = call i32 @assume(i32 %9, i32 1, i32 undef, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %66, %1
%12 = phi i32 [ -1, %1 ], [ %22, %66 ]
%13 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %2
%15 = call i32 @assume(i32 %13, i32 1, i32 %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* %2
%17 = icmp sgt i32 %12, %16
br i1 %17, label %18, label %21
18: ; preds = %11
%19 = call i32 @assume(i32 0, i32 1, i32 %16, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%20 = load i32, i32* %2
br label %21
21: ; preds = %18, %11
%22 = phi i32 [ %20, %18 ], [ %16, %11 ]
%23 = call i8* @fread_string(i32* %0)
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 36
br i1 %25, label %95, label %26
26: ; preds = %21
%27 = call i8* @fread_string(i32* %0)
%28 = call i8* @fread_string(i32* %0)
%29 = call i8* @fread_string(i32* %0)
%30 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%31 = load i32, i32* %2
%32 = call i32 @assume(i32 %30, i32 1, i32 %31, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%33 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%34 = load i32, i32* %2
%35 = call i32 @assume(i32 %33, i32 1, i32 %34, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%36 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%37 = load i32, i32* %2
%38 = call i32 @assume(i32 %36, i32 1, i32 %37, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%39 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%40 = load i32, i32* %2
%41 = call i32 @assume(i32 %39, i32 1, i32 %40, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%42 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%43 = load i32, i32* %2
%44 = call i32 @assume(i32 %42, i32 1, i32 %43, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%45 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%46 = load i32, i32* %2
%47 = call i32 @assume(i32 %45, i32 1, i32 %46, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%48 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%49 = load i32, i32* %2
%50 = call i32 @assume(i32 %48, i32 1, i32 %49, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%51 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%52 = load i32, i32* %2
%53 = call i32 @assume(i32 %51, i32 1, i32 %52, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%54 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32* %3)
%55 = load i32, i32* %2
%56 = call i32 @assume(i32 %54, i32 1, i32 %55, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%57 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32* %3)
%58 = load i32, i32* %2
%59 = call i32 @assume(i32 %57, i32 1, i32 %58, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0))
%60 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
%61 = load i8, i8* %7
%62 = icmp eq i8 %61, 69
br i1 %62, label %79, label %63
63: ; preds = %79, %26
%64 = phi i8 [ %61, %26 ], [ %83, %79 ]
%65 = icmp eq i8 %64, 65
br i1 %65, label %67, label %66
66: ; preds = %67, %85, %63
br label %11
67: ; preds = %63
%68 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%69 = load i32, i32* %2
%70 = call i32 @assume(i32 %68, i32 1, i32 %69, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
%71 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32* %3)
%72 = load i32, i32* %2
%73 = call i32 @assume(i32 %71, i32 1, i32 %72, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0))
%74 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
%75 = load i32, i32* %2
%76 = call i32 @assume(i32 %74, i32 1, i32 %75, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0))
%77 = load i8, i8* %7
%78 = icmp eq i8 %77, 65
br i1 %78, label %85, label %66
79: ; preds = %26, %79
%80 = call i8* @fread_string(i32* %0)
%81 = call i8* @fread_string(i32* %0)
%82 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
%83 = load i8, i8* %7
%84 = icmp eq i8 %83, 69
br i1 %84, label %79, label %63
85: ; preds = %67
%86 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%87 = load i32, i32* %2
%88 = call i32 @assume(i32 %86, i32 1, i32 %87, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
%89 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32* %3)
%90 = load i32, i32* %2
%91 = call i32 @assume(i32 %89, i32 1, i32 %90, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0))
%92 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
%93 = load i32, i32* %2
%94 = call i32 @assume(i32 %92, i32 1, i32 %93, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0))
br label %66
95: ; preds = %21
ret void
}