#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*/ output(char *);
int /*<<< orphan*/ printClassName(int);
int /*<<< orphan*/ showClassInheritance(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void showClass(int cla) {
  char str[80];
  if (cla < 1) {
    sprintf(str, "Class index %d is out of range.", cla);
    output(str);
    return;
  }
  output("$t");
  printClassName(cla);
  sprintf(str, "[%d]", cla);
  output(str);
  showClassInheritance(cla);
}


x86 assembly (clang, -O0):
<showClass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1176 <showClass+0x36>
lea    -0x60(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe9d(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <output@plt>
jmp    11ae <showClass+0x6e>
lea    0xea3(%rip),%rdi
call   1030 <output@plt>
mov    -0x4(%rbp),%edi
call   1040 <printClassName@plt>
lea    -0x60(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe8b(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <output@plt>
mov    -0x4(%rbp),%edi
call   1060 <showClassInheritance@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showClass>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %edi,%ebx
test   %edi,%edi
jle    1185 <showClass+0x45>
lea    0xecc(%rip),%rdi
call   1030 <output@plt>
mov    %ebx,%edi
call   1040 <printClassName@plt>
lea    0xebc(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <output@plt>
mov    %ebx,%edi
call   1060 <showClassInheritance@plt>
jmp    11a1 <showClass+0x61>
lea    0xe74(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <output@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Class index %d is out of range.\00"
@.str.1 = [3 x i8] c"$t\00"
@.str.2 = [5 x i8] c"[%d]\00"
define void @showClass(i32 %0) {
%2 = alloca i32
%3 = alloca [80 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%11 = call i32 @output(i8* %10)
br label %23
12: ; preds = %1
%13 = call i32 @output(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* %2
%15 = call i32 @printClassName(i32 %14)
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%17 = load i32, i32* %2
%18 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%20 = call i32 @output(i8* %19)
%21 = load i32, i32* %2
%22 = call i32 @showClassInheritance(i32 %21)
br label %23
23: ; preds = %12, %6
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Class index %d is out of range.\00"
@.str.1 = [3 x i8] c"$t\00"
@.str.2 = [5 x i8] c"[%d]\00"
define void @showClass(i32 %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = icmp slt i32 %0, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 @output(i8* %3)
br label %14
8: ; preds = %1
%9 = tail call i32 @output(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @printClassName(i32 %0)
%11 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%12 = call i32 @output(i8* %3)
%13 = call i32 @showClassInheritance(i32 %0)
br label %14
14: ; preds = %8, %5
ret void
}