const char *_ast_padding(int in_amount) {
  if (in_amount > 99)
    in_amount = 99;
  static char whitespace[1000] =
      "                                                                        "
      "                            "
      "                                                                        "
      "                            "
      "                                                                        "
      "                            "
      "                                                                        "
      "                            "
      "                                                                        "
      "                            "
      "                                                                        "
      "                            "
      "                                                                        "
      "                            "
      "                                                                        "
      "                            "
      "                                                                        "
      "                            "
      "                                                                        "
      "                            ";
  static int last_amount = 0;
  whitespace[last_amount] = ' ';
  last_amount = in_amount;
  whitespace[last_amount] = 0;
  return whitespace;
}


x86 assembly (clang, -O0):
<_ast_padding>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x63,-0x4(%rbp)
jle    1118 <_ast_padding+0x18>
movl   $0x63,-0x4(%rbp)
movslq 0x32fd(%rip),%rcx
lea    0x2f0a(%rip),%rax
movb   $0x20,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
mov    %eax,0x32e9(%rip)
movslq 0x32e2(%rip),%rcx
lea    0x2eef(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2ee4(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ast_padding>:
cmp    $0x63,%edi
mov    $0x63,%ecx
cmovl  %edi,%ecx
movslq 0x330a(%rip),%rdx
lea    0x2f17(%rip),%rax
movb   $0x20,(%rdx,%rax,1)
mov    %ecx,0x32f9(%rip)
movslq %ecx,%rcx
movb   $0x0,(%rcx,%rax,1)
ret

LLVM IR (-O0):
@_ast_padding.whitespace = internal global [1000 x i8] c" "
@_ast_padding.last_amount = internal global i32 0
define i8* @_ast_padding(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 99
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 99, i32* %2
br label %6
6: ; preds = %5, %1
%7 = load i32, i32* @_ast_padding.last_amount
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* @_ast_padding.whitespace, i64 0, i64 %8
store i8 32, i8* %9
%10 = load i32, i32* %2
store i32 %10, i32* @_ast_padding.last_amount
%11 = load i32, i32* @_ast_padding.last_amount
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* @_ast_padding.whitespace, i64 0, i64 %12
store i8 0, i8* %13
ret i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @_ast_padding.whitespace, i64 0, i64 0)
}

LLVM IR (-O2):
@_ast_padding.whitespace = internal global [1000 x i8] c" "
@_ast_padding.last_amount = internal unnamed_addr global i32 0
define i8* @_ast_padding(i32 %0) {
%2 = icmp slt i32 %0, 99
%3 = select i1 %2, i32 %0, i32 99
%4 = load i32, i32* @_ast_padding.last_amount
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* @_ast_padding.whitespace, i64 0, i64 %5
store i8 32, i8* %6
store i32 %3, i32* @_ast_padding.last_amount
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* @_ast_padding.whitespace, i64 0, i64 %7
store i8 0, i8* %8
ret i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @_ast_padding.whitespace, i64 0, i64 0)
}