#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*/ DisassemblyPrompt();
int /*<<< orphan*/ DwTrace();
int /*<<< orphan*/ Fail(char *);
scalar_t__ IsDwDebugNumeric(int /*<<< orphan*/);
int /*<<< orphan*/ NextCh();
int ReadNumber(int /*<<< orphan*/);
int /*<<< orphan*/ Sb();
int /*<<< orphan*/ Wl();
void TraceCommand(void) {
  int count = 1;
  Sb();
  if (IsDwDebugNumeric(NextCh())) {
    count = ReadNumber(0);
  }
  if (count < 1)
    Fail("Trace count should be at least 1");
  DwTrace();
  while (count > 1) {
    DisassemblyPrompt();
    Wl();
    DwTrace();
    count--;
  }
}


x86 assembly (clang, -O0):
<TraceCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Sb@plt>
mov    $0x0,%al
call   1050 <NextCh@plt>
mov    %eax,%edi
call   1040 <IsDwDebugNumeric@plt>
cmp    $0x0,%rax
je     11b8 <TraceCommand+0x38>
xor    %edi,%edi
call   1090 <ReadNumber@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    11ce <TraceCommand+0x4e>
lea    0xe37(%rip),%rdi
call   10a0 <Fail@plt>
mov    $0x0,%al
call   1060 <DwTrace@plt>
cmpl   $0x1,-0x4(%rbp)
jle    1202 <TraceCommand+0x82>
mov    $0x0,%al
call   1070 <DisassemblyPrompt@plt>
mov    $0x0,%al
call   1080 <Wl@plt>
mov    $0x0,%al
call   1060 <DwTrace@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    11d5 <TraceCommand+0x55>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TraceCommand>:
push   %rbx
xor    %eax,%eax
call   1030 <Sb@plt>
xor    %eax,%eax
call   1050 <NextCh@plt>
mov    %eax,%edi
call   1040 <IsDwDebugNumeric@plt>
test   %rax,%rax
je     11eb <TraceCommand+0x6b>
xor    %edi,%edi
call   1090 <ReadNumber@plt>
test   %eax,%eax
jle    11df <TraceCommand+0x5f>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <DwTrace@plt>
cmp    $0x1,%ebx
je     11dd <TraceCommand+0x5d>
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <DisassemblyPrompt@plt>
xor    %eax,%eax
call   1080 <Wl@plt>
xor    %eax,%eax
call   1060 <DwTrace@plt>
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     11c0 <TraceCommand+0x40>
pop    %rbx
ret
lea    0xe1a(%rip),%rdi
call   10a0 <Fail@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <DwTrace@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Trace count should be at least 1\00"
define void @TraceCommand() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 (...) @Sb()
%3 = call i32 (...) @NextCh()
%4 = call i64 @IsDwDebugNumeric(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @ReadNumber(i32 0)
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @Fail(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
%14 = call i32 (...) @DwTrace()
br label %15
15: ; preds = %18, %13
%16 = load i32, i32* %1
%17 = icmp sgt i32 %16, 1
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = call i32 (...) @DisassemblyPrompt()
%20 = call i32 (...) @Wl()
%21 = call i32 (...) @DwTrace()
%22 = load i32, i32* %1
%23 = add nsw i32 %22, -1
store i32 %23, i32* %1
br label %15
24: ; preds = %15
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Trace count should be at least 1\00"
define void @TraceCommand() {
%1 = tail call i32 (...) @Sb()
%2 = tail call i32 (...) @NextCh()
%3 = tail call i64 @IsDwDebugNumeric(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0
%6 = tail call i32 @ReadNumber(i32 0)
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i32 @Fail(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = tail call i32 (...) @DwTrace()
br label %22
12: ; preds = %5
%13 = tail call i32 (...) @DwTrace()
%14 = icmp eq i32 %6, 1
br i1 %14, label %22, label %15
15: ; preds = %12, %15
%16 = phi i32 [ %20, %15 ], [ %6, %12 ]
%17 = tail call i32 (...) @DisassemblyPrompt()
%18 = tail call i32 (...) @Wl()
%19 = tail call i32 (...) @DwTrace()
%20 = add nsw i32 %16, -1
%21 = icmp ugt i32 %16, 2
br i1 %21, label %15, label %22
22: ; preds = %15, %10, %12
ret void
}