#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*/ strlen(char const *);
int /*<<< orphan*/ system_call();
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void task1(void) {
  static const char *task1_string = "TASK_1\n";
  static const char *task1_again_string = "TASK_1_again\n";
  write(1, task1_string, strlen(task1_string));
  system_call();
  write(1, task1_again_string, strlen(task1_again_string));
  system_call();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<task1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ef9(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2eee(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <system_call@plt>
mov    0x2ed3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2ec8(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x8(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <system_call@plt>
jmp    1194 <task1+0x64>

x86 assembly (clang, -O2):
<task1>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <system_call@plt>
lea    0xeab(%rip),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <system_call@plt>
nopl   0x0(%rax,%rax,1)
jmp    1180 <task1+0x50>

LLVM IR (-O0):
@task1.task1_string = internal global i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0)
@.str = [8 x i8] c"TASK_1\0A\00"
@task1.task1_again_string = internal global i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i32 0, i32 0)
@.str.1 = [14 x i8] c"TASK_1_again\0A\00"
define void @task1() {
%1 = load i8*, i8** @task1.task1_string
%2 = load i8*, i8** @task1.task1_string
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @write(i32 1, i8* %1, i32 %3)
%5 = call i32 (...) @system_call()
%6 = load i8*, i8** @task1.task1_again_string
%7 = load i8*, i8** @task1.task1_again_string
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 1, i8* %6, i32 %8)
%10 = call i32 (...) @system_call()
br label %11
11: ; preds = %0, %11
br label %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"TASK_1\0A\00"
@.str.1 = [14 x i8] c"TASK_1_again\0A\00"
define void @task1() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @system_call()
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @system_call()
br label %7
7: ; preds = %0, %7
br label %7
}