#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 */
char *calloc(int, int);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
char *output_line(char *string) {
  char *tmp;
  if (NULL == (tmp = (calloc(62, sizeof(char))))) {
    error("print_info(): Out of memory !");
  }
  int x, i, y;
  y = 0;
  if (strlen(string) % 2 == 0)
    y = 1;
  x = (60 - strlen(string)) / 2;
  strcat(tmp, "*");
  for (i = 0; i != x - y; ++i) {
    strcat(tmp, " ");
  }
  strcat(tmp, string);
  for (i = 0; i != x - 1; ++i) {
    strcat(tmp, " ");
  }
  strcat(tmp, "*\n");
  free(string);
  string = &(tmp[0]);
  return string;
}


x86 assembly (clang, -O0):
<output_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3e,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    1189 <output_line+0x39>
lea    0xe7c(%rip),%rdi
call   1060 <error@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b1 <output_line+0x61>
movl   $0x1,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    $0x3c,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe45(%rip),%rsi
call   1070 <strcat@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0x1c(%rbp),%ecx
cmp    %ecx,%eax
je     1214 <output_line+0xc4>
mov    -0x10(%rbp),%rdi
lea    0xe1f(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11e5 <output_line+0x95>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1070 <strcat@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1257 <output_line+0x107>
mov    -0x10(%rbp),%rdi
lea    0xddc(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1228 <output_line+0xd8>
mov    -0x10(%rbp),%rdi
lea    0xdc0(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_line>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r14
mov    $0x3e,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%r12
test   %rax,%rax
jne    117e <output_line+0x2e>
lea    0xe87(%rip),%rdi
call   1060 <error@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
and    $0x1,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    $0x3c,%ecx
sub    %eax,%ecx
mov    %ecx,%ebx
shr    $0x1f,%ebx
add    %ecx,%ebx
sar    %ebx
lea    0xe74(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcat@plt>
add    $0xffffffff,%ebx
add    %ebx,%ebp
je     11d0 <output_line+0x80>
lea    0xe60(%rip),%r15
mov    %r12,%rdi
mov    %r15,%rsi
call   1070 <strcat@plt>
add    $0xffffffff,%ebp
jne    11c0 <output_line+0x70>
mov    %r12,%rdi
mov    %r14,%rsi
call   1070 <strcat@plt>
test   %ebx,%ebx
je     1200 <output_line+0xb0>
lea    0xe3a(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbp,%rsi
call   1070 <strcat@plt>
add    $0xffffffff,%ebx
jne    11f0 <output_line+0xa0>
lea    0xe1b(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcat@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r12,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"print_info(): Out of memory !\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [3 x i8] c"*\0A\00"
define i8* @output_line(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = call i8* @calloc(i32 62, i32 1)
store i8* %7, i8** %3
%8 = icmp eq i8* null, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
store i32 0, i32* %6
%12 = load i8*, i8** %2
%13 = call i32 @strlen(i8* %12)
%14 = srem i32 %13, 2
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 1, i32* %6
br label %17
17: ; preds = %16, %11
%18 = load i8*, i8** %2
%19 = call i32 @strlen(i8* %18)
%20 = sub nsw i32 60, %19
%21 = sdiv i32 %20, 2
store i32 %21, i32* %4
%22 = load i8*, i8** %3
%23 = call i32 @strcat(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %5
br label %24
24: ; preds = %33, %17
%25 = load i32, i32* %5
%26 = load i32, i32* %4
%27 = load i32, i32* %6
%28 = sub nsw i32 %26, %27
%29 = icmp ne i32 %25, %28
br i1 %29, label %30, label %36
30: ; preds = %24
%31 = load i8*, i8** %3
%32 = call i32 @strcat(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %30
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
br label %24
36: ; preds = %24
%37 = load i8*, i8** %3
%38 = load i8*, i8** %2
%39 = call i32 @strcat(i8* %37, i8* %38)
store i32 0, i32* %5
br label %40
40: ; preds = %48, %36
%41 = load i32, i32* %5
%42 = load i32, i32* %4
%43 = sub nsw i32 %42, 1
%44 = icmp ne i32 %41, %43
br i1 %44, label %45, label %51
45: ; preds = %40
%46 = load i8*, i8** %3
%47 = call i32 @strcat(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %48
48: ; preds = %45
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %40
51: ; preds = %40
%52 = load i8*, i8** %3
%53 = call i32 @strcat(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%54 = load i8*, i8** %2
%55 = call i32 @free(i8* %54)
%56 = load i8*, i8** %3
%57 = getelementptr inbounds i8, i8* %56, i64 0
store i8* %57, i8** %2
%58 = load i8*, i8** %2
ret i8* %58
}

LLVM IR (-O2):
@.str = [30 x i8] c"print_info(): Out of memory !\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [3 x i8] c"*\0A\00"
define i8* @output_line(i8* %0) {
%2 = tail call dereferenceable_or_null(62) i8* @calloc(i32 62, i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @strlen(i8* %0)
%8 = and i32 %7, 1
%9 = tail call i32 @strlen(i8* %0)
%10 = sub nsw i32 60, %9
%11 = sdiv i32 %10, 2
%12 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = add nsw i32 %11, -1
%14 = add nsw i32 %13, %8
%15 = icmp eq i32 %14, 0
br i1 %15, label %21, label %16
16: ; preds = %6, %16
%17 = phi i32 [ %19, %16 ], [ 0, %6 ]
%18 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = add nuw nsw i32 %17, 1
%20 = icmp eq i32 %19, %14
br i1 %20, label %21, label %16
21: ; preds = %16, %6
%22 = tail call i32 @strcat(i8* %2, i8* %0)
%23 = icmp eq i32 %13, 0
br i1 %23, label %29, label %24
24: ; preds = %21, %24
%25 = phi i32 [ %27, %24 ], [ 0, %21 ]
%26 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%27 = add nuw nsw i32 %25, 1
%28 = icmp eq i32 %27, %13
br i1 %28, label %29, label %24
29: ; preds = %24, %21
%30 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%31 = tail call i32 @free(i8* %0)
ret i8* %2
}