#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 *, char const *);
int /*<<< orphan*/ putchar(char);
int strlen(char const *);
void PrintMsg(const char *_msg) {
  int i;
  printf("%s", "\033[1A");
  for (i = 0; i < strlen(_msg) - 5; ++i) {
    putchar('-');
  }
  putchar('\n');
  printf("| %s |\n", _msg);
  for (i = 0; i < strlen(_msg) - 5; ++i) {
    putchar('-');
  }
  putchar('\n');
  return;
}


x86 assembly (clang, -O0):
<PrintMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    $0x5,%ecx
cmp    %ecx,%eax
jge    118d <PrintMsg+0x5d>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <PrintMsg+0x26>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rsi
lea    0xe66(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    $0x5,%ecx
cmp    %ecx,%eax
jge    11e5 <PrintMsg+0xb5>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ae <PrintMsg+0x7e>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintMsg>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xec3(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0x6,%eax
jl     117c <PrintMsg+0x4c>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    $0xfffffffb,%eax
cmp    %eax,%ebp
jl     1160 <PrintMsg+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe7b(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0x6,%eax
jl     11cc <PrintMsg+0x9c>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    $0xfffffffb,%eax
cmp    %eax,%ebp
jl     11b0 <PrintMsg+0x80>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"\1B[1A\00"
@.str.2 = [8 x i8] c"| %s |\0A\00"
define void @PrintMsg(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %3
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = sub nsw i32 %8, 5
%10 = icmp slt i32 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = call i32 @putchar(i8 signext 45)
br label %13
13: ; preds = %11
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = call i32 @putchar(i8 signext 10)
%18 = load i8*, i8** %2
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %18)
store i32 0, i32* %3
br label %20
20: ; preds = %28, %16
%21 = load i32, i32* %3
%22 = load i8*, i8** %2
%23 = call i32 @strlen(i8* %22)
%24 = sub nsw i32 %23, 5
%25 = icmp slt i32 %21, %24
br i1 %25, label %26, label %31
26: ; preds = %20
%27 = call i32 @putchar(i8 signext 45)
br label %28
28: ; preds = %26
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %20
31: ; preds = %20
%32 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"\1B[1A\00"
@.str.2 = [8 x i8] c"| %s |\0A\00"
define void @PrintMsg(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 5
br i1 %4, label %5, label %12
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 @putchar(i8 signext 45)
%8 = add nuw nsw i32 %6, 1
%9 = tail call i32 @strlen(i8* %0)
%10 = add nsw i32 %9, -5
%11 = icmp slt i32 %8, %10
br i1 %11, label %5, label %12
12: ; preds = %5, %1
%13 = tail call i32 @putchar(i8 signext 10)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%15 = tail call i32 @strlen(i8* %0)
%16 = icmp sgt i32 %15, 5
br i1 %16, label %17, label %24
17: ; preds = %12, %17
%18 = phi i32 [ %20, %17 ], [ 0, %12 ]
%19 = tail call i32 @putchar(i8 signext 45)
%20 = add nuw nsw i32 %18, 1
%21 = tail call i32 @strlen(i8* %0)
%22 = add nsw i32 %21, -5
%23 = icmp slt i32 %20, %22
br i1 %23, label %17, label %24
24: ; preds = %17, %12
%25 = tail call i32 @putchar(i8 signext 10)
ret void
}