#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
int strlen(char *);
void centrar(char cadena[]) {
  int i, tabulacion;
  tabulacion = (80 - strlen(cadena)) / 2;
  for (i = 0; i < tabulacion; i = i + 1)
    fprintf(stdout, " ");
  fprintf(stdout, "%s", cadena);
}


x86 assembly (clang, -O0):
<centrar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x50,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1181 <centrar+0x61>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <centrar+0x30>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe6d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<centrar>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
cmp    $0x4e,%eax
jg     1162 <centrar+0x42>
mov    $0x50,%ebp
sub    %eax,%ebp
shr    %ebp
mov    0x2e9c(%rip),%r15
lea    0xeb5(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%r15),%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1150 <centrar+0x30>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [2 x i8] c" \00"
@.str.1 = [3 x i8] c"%s\00"
define void @centrar(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sub nsw i32 80, %6
%8 = sdiv i32 %7, 2
store i32 %8, i32* %4
store i32 0, i32* %3
br label %9
9: ; preds = %16, %1
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i32, i32* @stdout
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %13
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %9
19: ; preds = %9
%20 = load i32, i32* @stdout
%21 = load i8*, i8** %2
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %21)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c" \00"
@.str.1 = [3 x i8] c"%s\00"
define void @centrar(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 79
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = sub nsw i32 80, %2
%6 = lshr i32 %5, 1
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %11, %7 ], [ 0, %4 ]
%9 = load i32, i32* @stdout
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = add nuw nsw i32 %8, 1
%12 = icmp eq i32 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %1
%14 = load i32, i32* @stdout
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}