#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*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, int);
void _library_task(const char *task) {
  static const char txt[] = "  - \n";
  int len;
  (void)write(STDOUT_FILENO, txt, 4);
  len = 0;
  while (task[len])
    len++;
  (void)write(STDOUT_FILENO, task, len);
  (void)write(STDOUT_FILENO, txt + 4, 1);
}


x86 assembly (clang, -O0):
<_library_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115d <_library_task+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <_library_task+0x2d>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <write@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe7e(%rip),%rsi
add    $0x4,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_library_task>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ed2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,(%rbx,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1140 <_library_task+0x30>
add    $0xffffffff,%edx
mov    (%r14),%edi
mov    %rbx,%rsi
call   1030 <write@plt>
mov    (%r14),%edi
lea    0xea2(%rip),%rsi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write@plt>

LLVM IR (-O0):
@_library_task.txt = internal constant [6 x i8] c" - \0A\00"
@STDOUT_FILENO = global i32 0
define void @_library_task(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @STDOUT_FILENO
%5 = call i32 @write(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @_library_task.txt, i64 0, i64 0), i32 4)
store i32 0, i32* %3
br label %6
6: ; preds = %13, %1
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %6
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %6
16: ; preds = %6
%17 = load i32, i32* @STDOUT_FILENO
%18 = load i8*, i8** %2
%19 = load i32, i32* %3
%20 = call i32 @write(i32 %17, i8* %18, i32 %19)
%21 = load i32, i32* @STDOUT_FILENO
%22 = call i32 @write(i32 %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @_library_task.txt, i64 0, i64 4), i32 1)
ret void
}

LLVM IR (-O2):
@_library_task.txt = internal constant [6 x i8] c" - \0A\00"
@STDOUT_FILENO = global i32 0
define void @_library_task(i8* nocapture %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @write(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @_library_task.txt, i64 0, i64 0), i32 4)
br label %4
4: ; preds = %4, %1
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = add nuw i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
%12 = load i32, i32* @STDOUT_FILENO
%13 = tail call i32 @write(i32 %12, i8* %0, i32 %11)
%14 = load i32, i32* @STDOUT_FILENO
%15 = tail call i32 @write(i32 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @_library_task.txt, i64 0, i64 4), i32 1)
ret void
}