#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*/ pspeak(int, int);
int /*<<< orphan*/ rspeak(char);
scalar_t__ toting(int);
inventory() {
  char msg;
  int i;
  msg = 98;
  for (i = 1; i <= 100; ++i) {
    if (i == 35 || !toting(i))
      continue;
    if (msg)
      rspeak(99);
    msg = 0;
    pspeak(i, -1);
  }
  if (toting(35))
    msg = 141;
  if (msg)
    rspeak(msg);
}


x86 assembly (clang, -O0):
<inventory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x62,-0x5(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jg     11a1 <inventory+0x71>
cmpl   $0x23,-0xc(%rbp)
je     1169 <inventory+0x39>
mov    -0xc(%rbp),%edi
call   1050 <toting@plt>
cmp    $0x0,%rax
jne    116e <inventory+0x3e>
jmp    1193 <inventory+0x63>
cmpb   $0x0,-0x5(%rbp)
je     1182 <inventory+0x52>
mov    $0x63,%edi
call   1030 <rspeak@plt>
movb   $0x0,-0x5(%rbp)
mov    -0xc(%rbp),%edi
mov    $0xffffffff,%esi
call   1040 <pspeak@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <inventory+0x13>
mov    $0x23,%edi
call   1050 <toting@plt>
cmp    $0x0,%rax
je     11b9 <inventory+0x89>
movb   $0x8d,-0x5(%rbp)
cmpb   $0x0,-0x5(%rbp)
je     11cc <inventory+0x9c>
movsbl -0x5(%rbp),%edi
call   1030 <rspeak@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inventory>:
push   %rbp
push   %rbx
push   %rax
mov    $0x62,%bpl
mov    $0x1,%ebx
jmp    1156 <inventory+0x26>
nopl   (%rax)
mov    %ebx,%edi
mov    $0xffffffff,%esi
call   1040 <pspeak@plt>
xor    %ebp,%ebp
add    $0x1,%ebx
cmp    $0x65,%ebx
je     1178 <inventory+0x48>
cmp    $0x23,%ebx
je     114e <inventory+0x1e>
mov    %ebx,%edi
call   1050 <toting@plt>
test   %rax,%rax
je     114e <inventory+0x1e>
test   %bpl,%bpl
je     1140 <inventory+0x10>
mov    $0x63,%edi
call   1030 <rspeak@plt>
jmp    1140 <inventory+0x10>
mov    $0x23,%edi
call   1050 <toting@plt>
test   %rax,%rax
movzbl %bpl,%ecx
mov    $0x8d,%eax
cmove  %ecx,%eax
test   %al,%al
je     119d <inventory+0x6d>
movsbl %al,%edi
call   1030 <rspeak@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @inventory() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i8 98, i8* %2
store i32 1, i32* %3
br label %4
4: ; preds = %23, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %26
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 35
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i64 @toting(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %10, %7
br label %23
15: ; preds = %10
%16 = load i8, i8* %2
%17 = icmp ne i8 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @rspeak(i8 signext 99)
br label %20
20: ; preds = %18, %15
store i8 0, i8* %2
%21 = load i32, i32* %3
%22 = call i32 @pspeak(i32 %21, i32 -1)
br label %23
23: ; preds = %20, %14
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %4
26: ; preds = %4
%27 = call i64 @toting(i32 35)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %26
store i8 -115, i8* %2
br label %30
30: ; preds = %29, %26
%31 = load i8, i8* %2
%32 = icmp ne i8 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i8, i8* %2
%35 = call i32 @rspeak(i8 signext %34)
br label %36
36: ; preds = %33, %30
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
define i32 @inventory() {
br label %1
1: ; preds = %0, %14
%2 = phi i32 [ 1, %0 ], [ %16, %14 ]
%3 = phi i8 [ 98, %0 ], [ %15, %14 ]
%4 = icmp eq i32 %2, 35
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = tail call i64 @toting(i32 %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = icmp eq i8 %3, 0
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = tail call i32 @rspeak(i8 signext 99)
br label %12
12: ; preds = %10, %8
%13 = tail call i32 @pspeak(i32 %2, i32 -1)
br label %14
14: ; preds = %1, %5, %12
%15 = phi i8 [ %3, %1 ], [ 0, %12 ], [ %3, %5 ]
%16 = add nuw nsw i32 %2, 1
%17 = icmp eq i32 %16, 101
br i1 %17, label %18, label %1
18: ; preds = %14
%19 = tail call i64 @toting(i32 35)
%20 = icmp eq i64 %19, 0
%21 = select i1 %20, i8 %15, i8 -115
%22 = icmp eq i8 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %18
%24 = tail call i32 @rspeak(i8 signext %21)
br label %25
25: ; preds = %23, %18
ret i32 undef
}