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


x86 assembly (clang, -O0):
<output_line_left>:
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_left+0x39>
lea    0xe7c(%rip),%rdi
call   1060 <error@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    $0x3c,%eax
sub    %ecx,%eax
sub    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1070 <strcat@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     11f6 <output_line_left+0xa6>
mov    -0x10(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11cc <output_line_left+0x7c>
mov    -0x10(%rbp),%rdi
lea    0xe20(%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_left>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x3e,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    117d <output_line_left+0x2d>
lea    0xe88(%rip),%rdi
call   1060 <error@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
lea    0xe90(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <strcat@plt>
cmp    $0x39,%ebp
je     11bf <output_line_left+0x6f>
add    $0xffffffc7,%ebp
lea    0xe6f(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <strcat@plt>
inc    %ebp
jne    11b0 <output_line_left+0x60>
lea    0xe5b(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"print_info(): Out of memory !\00"
@.str.1 = [3 x i8] c"* \00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [3 x i8] c"*\0A\00"
define i8* @output_line_left(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 = sub nsw i32 60, %13
%15 = sub nsw i32 %14, 3
store i32 %15, i32* %4
%16 = load i8*, i8** %3
%17 = call i32 @strcat(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%18 = load i8*, i8** %3
%19 = load i8*, i8** %2
%20 = call i32 @strcat(i8* %18, i8* %19)
store i32 0, i32* %5
br label %21
21: ; preds = %28, %11
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = icmp ne i32 %22, %23
br i1 %24, label %25, label %31
25: ; preds = %21
%26 = load i8*, i8** %3
%27 = call i32 @strcat(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %25
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %21
31: ; preds = %21
%32 = load i8*, i8** %3
%33 = call i32 @strcat(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%34 = load i8*, i8** %2
%35 = call i32 @free(i8* %34)
%36 = load i8*, i8** %3
%37 = getelementptr inbounds i8, i8* %36, i64 0
store i8* %37, i8** %2
%38 = load i8*, i8** %2
ret i8* %38
}

LLVM IR (-O2):
@.str = [30 x i8] c"print_info(): Out of memory !\00"
@.str.1 = [3 x i8] c"* \00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [3 x i8] c"*\0A\00"
define i8* @output_line_left(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 = sub i32 57, %7
%9 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @strcat(i8* %2, i8* %0)
%11 = icmp eq i32 %7, 57
br i1 %11, label %17, label %12
12: ; preds = %6, %12
%13 = phi i32 [ %15, %12 ], [ 0, %6 ]
%14 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = add nuw nsw i32 %13, 1
%16 = icmp eq i32 %15, %8
br i1 %16, label %17, label %12
17: ; preds = %12, %6
%18 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%19 = tail call i32 @free(i8* %0)
ret i8* %2
}