#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*/ printf(char *);
void help_message(void) {
  printf("\nStuck in a pickle? Give us a few minutes, a representative will be "
         "with you shortly!\n");
  for (int i = 0; i < 30; i++) {
    printf(".");
    int j = 0;
    while (j < 1e7 * 2) {
      j++;
    }
    if (i == 10 || i == 20) {
      printf("\r           ");
      printf("\r");
    }
  }
  printf("\n\nJK ain't nobody got time for dat!\n");
  printf("\nHere is a list of your options:\n");
  printf("\t'd' - dumps out CPU\n");
  printf("\t'h' or '?' - help menu (seems kinda redundant at this point)\n");
  printf("\t'q' - quits the program\n");
  printf("\tan integer > 0 - executes N instruction cycles (don't get too "
         "crazy with this one!)\n");
  printf("\treturn - executes one instruction cycle\n");
}


x86 assembly (clang, -O0):
<help_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x1e,-0x4(%rbp)
jge    11ac <help_message+0x9c>
lea    0xf23(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xeab(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    116d <help_message+0x5d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <help_message+0x38>
cmpl   $0xa,-0x4(%rbp)
je     1181 <help_message+0x71>
cmpl   $0x14,-0x4(%rbp)
jne    1199 <help_message+0x89>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    119e <help_message+0x8e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112b <help_message+0x1b>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
lea    0xf29(%rip),%rdi
call   1030 <printf@plt>
lea    0xf37(%rip),%rdi
call   1030 <printf@plt>
lea    0xf81(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_message>:
push   %rbp
push   %rbx
push   %rax
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
xor    %ebp,%ebp
lea    0xeb8(%rip),%rbx
jmp    116a <help_message+0x3a>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <printf@plt>
mov    $0xd,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x1e,%ebp
je     1180 <help_message+0x50>
mov    $0x2e,%edi
call   1030 <putchar@plt>
cmp    $0x14,%ebp
je     1150 <help_message+0x20>
cmp    $0xa,%ebp
je     1150 <help_message+0x20>
jmp    1162 <help_message+0x32>
lea    0xedc(%rip),%rdi
call   1040 <puts@plt>
lea    0xef4(%rip),%rdi
call   1040 <puts@plt>
lea    0xf09(%rip),%rdi
call   1040 <puts@plt>
lea    0xf12(%rip),%rdi
call   1040 <puts@plt>
lea    0xf44(%rip),%rdi
call   1040 <puts@plt>
lea    0xf51(%rip),%rdi
call   1040 <puts@plt>
lea    0xf9a(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [87 x i8] c"\0AStuck in a pickle? Give us a few minutes, a representative will be with you shortly!\0A\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [13 x i8] c"\0D \00"
@.str.3 = [2 x i8] c"\0D\00"
@.str.4 = [37 x i8] c"\0A\0AJK ain't nobody got time for dat!\0A\00"
@.str.5 = [34 x i8] c"\0AHere is a list of your options:\0A\00"
@.str.6 = [22 x i8] c"\09'd' - dumps out CPU\0A\00"
@.str.7 = [63 x i8] c"\09'h' or '?' - help menu (seems kinda redundant at this point)\0A\00"
@.str.8 = [26 x i8] c"\09'q' - quits the program\0A\00"
@.str.9 = [86 x i8] c"\09an integer > 0 - executes N instruction cycles (don't get too crazy with this one!)\0A\00"
@.str.10 = [42 x i8] c"\09return - executes one instruction cycle\0A\00"
define void @help_message() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %4
4: ; preds = %26, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 30
br i1 %6, label %7, label %29
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %9
9: ; preds = %13, %7
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to double
%12 = fcmp olt double %11, 2.000000e+07
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %9
16: ; preds = %9
%17 = load i32, i32* %1
%18 = icmp eq i32 %17, 10
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i32, i32* %1
%21 = icmp eq i32 %20, 20
br i1 %21, label %22, label %25
22: ; preds = %19, %16
%23 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %22, %19
br label %26
26: ; preds = %25
%27 = load i32, i32* %1
%28 = add nsw i32 %27, 1
store i32 %28, i32* %1
br label %4
29: ; preds = %4
%30 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%31 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%32 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%33 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0))
%34 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
%35 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.9, i64 0, i64 0))
%36 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [13 x i8] c"\0D \00"
@str = [86 x i8] c"\0AStuck in a pickle? Give us a few minutes, a representative will be with you shortly!\00"
@str.11 = [36 x i8] c"\0A\0AJK ain't nobody got time for dat!\00"
@str.12 = [33 x i8] c"\0AHere is a list of your options:\00"
@str.13 = [21 x i8] c"\09'd' - dumps out CPU\00"
@str.14 = [62 x i8] c"\09'h' or '?' - help menu (seems kinda redundant at this point)\00"
@str.15 = [25 x i8] c"\09'q' - quits the program\00"
@str.16 = [85 x i8] c"\09an integer > 0 - executes N instruction cycles (don't get too crazy with this one!)\00"
@str.17 = [41 x i8] c"\09return - executes one instruction cycle\00"
define void @help_message() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str, i64 0, i64 0))
br label %10
2: ; preds = %16
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.11, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.12, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.13, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.14, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.15, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str.16, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.17, i64 0, i64 0))
ret void
10: ; preds = %0, %16
%11 = phi i32 [ 0, %0 ], [ %17, %16 ]
%12 = tail call i32 @putchar(i32 46)
switch i32 %11, label %16 [
i32 20, label %13
i32 10, label %13
]
13: ; preds = %10, %10
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%15 = tail call i32 @putchar(i32 13)
br label %16
16: ; preds = %10, %13
%17 = add nuw nsw i32 %11, 1
%18 = icmp eq i32 %17, 30
br i1 %18, label %2, label %10
}