#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 *, ...);
int strlen(char *);
int main(int argc, char **argv) {
  if (argc != 2)
    return -1;
  printf("\033[%d;%dH", 1, 1);
  printf("\033[%dm", 42);
  ;
  printf("\033[%dm", 30);
  ;
  int i;
  for (i = 0; i < 80; ++i)
    printf(" ");
  printf("\033[%d;%dH", 1, ((80 - strlen(argv[1])) / 2));
  ;
  printf("[%s]", argv[1]);
  printf("\033[%dm", 0);
  ;
  printf("\033[%d;%dH", 2, 1);
  ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1225 <main+0x105>
lea    0xead(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea1(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8e(%rip),%rdi
mov    $0x1e,%esi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x50,-0x14(%rbp)
jge    11b4 <main+0x94>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118e <main+0x6e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x50,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xe25(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe05(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdec(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0xffffffff,%ebp
cmp    $0x2,%edi
jne    1206 <main+0xd6>
mov    %rsi,%rbx
lea    0xeb4(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea5(%rip),%rbp
mov    %rbp,%rdi
mov    $0x2a,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    $0x1e,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x50,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1190 <main+0x60>
mov    0x8(%rbx),%rdi
call   1040 <strlen@plt>
mov    $0x50,%ecx
sub    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
lea    0xe41(%rip),%r14
xor    %ebp,%ebp
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xe34(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe20(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
@.str.1 = [6 x i8] c"\1B[%dm\00"
@.str.3 = [5 x i8] c"[%s]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %24
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 42)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 30)
br label %8
8: ; preds = %4, %8
%9 = phi i32 [ 0, %4 ], [ %11, %8 ]
%10 = tail call i32 @putchar(i32 32)
%11 = add nuw nsw i32 %9, 1
%12 = icmp eq i32 %11, 80
br i1 %12, label %13, label %8
13: ; preds = %8
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i32 @strlen(i8* %15)
%17 = sub nsw i32 80, %16
%18 = sdiv i32 %17, 2
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 %18)
%20 = load i8*, i8** %14
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %20)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 0)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2, i32 1)
br label %24
24: ; preds = %2, %13
%25 = phi i32 [ 0, %13 ], [ -1, %2 ]
ret i32 %25
}