#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 */
scalar_t__ error();
int number_of_objects(int);
int number_of_all_objects() {
  int tn, n;
  int object_type;
  tn = 0;
  for (object_type = 1; object_type <= 112; object_type++) {
    n = number_of_objects(object_type);
    if (error())
      return (0);
    tn += n;
  }
  return (tn);
}


x86 assembly (clang, -O0):
<number_of_all_objects>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x70,-0x10(%rbp)
jg     117f <number_of_all_objects+0x5f>
mov    -0x10(%rbp),%edi
call   1040 <number_of_objects@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <error@plt>
cmp    $0x0,%rax
je     1168 <number_of_all_objects+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1185 <number_of_all_objects+0x65>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <number_of_all_objects+0x16>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_all_objects>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebp
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %ebp,%edi
call   1040 <number_of_objects@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <error@plt>
test   %rax,%rax
jne    1152 <number_of_all_objects+0x32>
add    %ebx,%r14d
add    $0x1,%ebp
cmp    $0x71,%ebp
jne    1130 <number_of_all_objects+0x10>
jmp    1155 <number_of_all_objects+0x35>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @number_of_all_objects() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %2
store i32 1, i32* %4
br label %5
5: ; preds = %18, %0
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 112
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i32, i32* %4
%10 = call i32 @number_of_objects(i32 %9)
store i32 %10, i32* %3
%11 = call i64 (...) @error()
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 0, i32* %1
br label %23
14: ; preds = %8
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = add nsw i32 %16, %15
store i32 %17, i32* %2
br label %18
18: ; preds = %14
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %5
21: ; preds = %5
%22 = load i32, i32* %2
store i32 %22, i32* %1
br label %23
23: ; preds = %21, %13
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
define i32 @number_of_all_objects() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 1, %0 ], [ %9, %7 ]
%3 = phi i32 [ 0, %0 ], [ %8, %7 ]
%4 = tail call i32 @number_of_objects(i32 %2)
%5 = tail call i64 (...) @error()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = add nsw i32 %4, %3
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 113
br i1 %10, label %11, label %1
11: ; preds = %7, %1
%12 = phi i32 [ 0, %1 ], [ %8, %7 ]
ret i32 %12
}