#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 */
char *CG_ConfigString(int);
int /*<<< orphan*/ CG_Printf(char *, ...);
void CG_BeamList_cmd(void) {
  int i;
  CG_Printf("^5"
            "RPG-X Current Beam Locations\n");
  CG_Printf("^2"
            "Location Name \t - \t Location Index\n");
  for (i = 1; i < 64; i++) {
    const char *locStr = CG_ConfigString((((33 + (1 << 9)) + 256) + 128) + i);
    if (locStr[0]) {
      CG_Printf("%s \t - \t%i\n", locStr, i);
    }
  }
}


x86 assembly (clang, -O0):
<CG_BeamList_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <CG_Printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <CG_Printf@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    119c <CG_BeamList_cmd+0x7c>
mov    -0x4(%rbp),%edi
add    $0x3a1,%edi
call   1040 <CG_ConfigString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1189 <CG_BeamList_cmd+0x69>
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <CG_Printf@plt>
jmp    118e <CG_BeamList_cmd+0x6e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <CG_BeamList_cmd+0x2b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_BeamList_cmd>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <CG_Printf@plt>
lea    0xee7(%rip),%rdi
xor    %eax,%eax
call   1030 <CG_Printf@plt>
mov    $0x3a2,%ebx
lea    0xefa(%rip),%r14
jmp    115b <CG_BeamList_cmd+0x3b>
xchg   %ax,%ax
add    $0x1,%ebx
cmp    $0x3e1,%ebx
je     117c <CG_BeamList_cmd+0x5c>
mov    %ebx,%edi
call   1040 <CG_ConfigString@plt>
cmpb   $0x0,(%rax)
je     1150 <CG_BeamList_cmd+0x30>
lea    -0x3a1(%rbx),%edx
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <CG_Printf@plt>
jmp    1150 <CG_BeamList_cmd+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"^5RPG-X Current Beam Locations\0A\00"
@.str.1 = [38 x i8] c"^2Location Name \09 - \09 Location Index\0A\00"
@.str.2 = [12 x i8] c"%s \09 - \09%i\0A\00"
define void @CG_BeamList_cmd() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 (i8*, ...) @CG_Printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @CG_Printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %5
5: ; preds = %21, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 64
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 929, %9
%11 = call i8* @CG_ConfigString(i32 %10)
store i8* %11, i8** %2
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %8
%17 = load i8*, i8** %2
%18 = load i32, i32* %1
%19 = call i32 (i8*, ...) @CG_Printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %17, i32 %18)
br label %20
20: ; preds = %16, %8
br label %21
21: ; preds = %20
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 1
store i32 %23, i32* %1
br label %5
24: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"^5RPG-X Current Beam Locations\0A\00"
@.str.1 = [38 x i8] c"^2Location Name \09 - \09 Location Index\0A\00"
@.str.2 = [12 x i8] c"%s \09 - \09%i\0A\00"
define void @CG_BeamList_cmd() {
%1 = tail call i32 (i8*, ...) @CG_Printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @CG_Printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %3
3: ; preds = %0, %11
%4 = phi i32 [ 1, %0 ], [ %12, %11 ]
%5 = add nuw nsw i32 %4, 929
%6 = tail call i8* @CG_ConfigString(i32 %5)
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 (i8*, ...) @CG_Printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %6, i32 %4)
br label %11
11: ; preds = %9, %3
%12 = add nuw nsw i32 %4, 1
%13 = icmp eq i32 %12, 64
br i1 %13, label %14, label %3
14: ; preds = %11
ret void
}