#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*/ Lcd_Out(int, int, char *);
int /*<<< orphan*/ Lcd_OutText(unsigned char, char *);
int /*<<< orphan*/ strcpy_rom(char *, char const *);
int strlen_rom(char const *);
char *tech_malloc(int);
int /*<<< orphan*/ yield();
void task1(void *params) {
  unsigned char *var = (unsigned char *)params;
  const char text_rom[] = "TechOS:";
  const char website_rom[] = "-Blinking Text-";
  static char *website;
  static char *text;
  text = tech_malloc((strlen_rom(text_rom) + 1) * sizeof(char));
  strcpy_rom(text, text_rom);
  website = tech_malloc((strlen_rom(website_rom) + 1) * sizeof(char));
  strcpy_rom(website, website_rom);
  for (;; yield()) {
    Lcd_OutText(*var, website);
    Lcd_Out(1, 1, text);
  }
}


x86 assembly (clang, -O0):
<task1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0xe85(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe8a(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe87(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x18(%rbp),%rdi
call   1060 <strlen_rom@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <tech_malloc@plt>
mov    %rax,0x2eab(%rip)
mov    0x2ea4(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1070 <strcpy_rom@plt>
lea    -0x30(%rbp),%rdi
call   1060 <strlen_rom@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <tech_malloc@plt>
mov    %rax,0x2e73(%rip)
mov    0x2e6c(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1070 <strcpy_rom@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    0x2e56(%rip),%rsi
movzbl %al,%edi
call   1080 <Lcd_OutText@plt>
mov    0x2e4f(%rip),%rdx
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <Lcd_Out@plt>
mov    $0x0,%al
call   1050 <yield@plt>
jmp    11f5 <task1+0x95>

x86 assembly (clang, -O2):
<task1>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
movabs $0x3a534f68636554,%rax
mov    %rax,0x8(%rsp)
movaps 0xe80(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1060 <strlen_rom@plt>
lea    0x1(%rax),%edi
call   1030 <tech_malloc@plt>
mov    %rax,0x2ebf(%rip)
mov    %rax,%rdi
mov    %r14,%rsi
call   1070 <strcpy_rom@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1060 <strlen_rom@plt>
lea    0x1(%rax),%edi
call   1030 <tech_malloc@plt>
mov    %rax,0x2e90(%rip)
mov    %rax,%rdi
mov    %r14,%rsi
call   1070 <strcpy_rom@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%edi
mov    0x2e6e(%rip),%rsi
call   1080 <Lcd_OutText@plt>
mov    0x2e6a(%rip),%rdx
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <Lcd_Out@plt>
xor    %eax,%eax
call   1050 <yield@plt>
jmp    11e0 <task1+0x80>

LLVM IR (-O0):
@__const.task1.text_rom = [8 x i8] c"TechOS:\00"
@__const.task1.website_rom = [16 x i8] c"-Blinking Text-\00"
@task1.website = internal global i8* null
@task1.text = internal global i8* null
define void @task1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [8 x i8]
%5 = alloca [16 x i8]
store i8* %0, i8** %2
%6 = load i8*, i8** %2
store i8* %6, i8** %3
%7 = bitcast [8 x i8]* %4 to i8*
%8 = bitcast [16 x i8]* %5 to i8*
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%10 = call i32 @strlen_rom(i8* %9)
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 1
%14 = trunc i64 %13 to i32
%15 = call i8* @tech_malloc(i32 %14)
store i8* %15, i8** @task1.text
%16 = load i8*, i8** @task1.text
%17 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%18 = call i32 @strcpy_rom(i8* %16, i8* %17)
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%20 = call i32 @strlen_rom(i8* %19)
%21 = add nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = mul i64 %22, 1
%24 = trunc i64 %23 to i32
%25 = call i8* @tech_malloc(i32 %24)
store i8* %25, i8** @task1.website
%26 = load i8*, i8** @task1.website
%27 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%28 = call i32 @strcpy_rom(i8* %26, i8* %27)
br label %29
29: ; preds = %36, %1
%30 = load i8*, i8** %3
%31 = load i8, i8* %30
%32 = load i8*, i8** @task1.website
%33 = call i32 @Lcd_OutText(i8 zeroext %31, i8* %32)
%34 = load i8*, i8** @task1.text
%35 = call i32 @Lcd_Out(i32 1, i32 1, i8* %34)
br label %36
36: ; preds = %29
%37 = call i32 (...) @yield()
br label %29
}

LLVM IR (-O2):
@__const.task1.website_rom = [16 x i8] c"-Blinking Text-\00"
@task1.website = internal unnamed_addr global i8* null
@task1.text = internal unnamed_addr global i8* null
define void @task1(i8* nocapture %0) {
%2 = alloca i64
%3 = alloca [16 x i8]
%4 = bitcast i64* %2 to i8*
store i64 16417149168084308, i64* %2
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = call i32 @strlen_rom(i8* %4)
%7 = add nsw i32 %6, 1
%8 = call i8* @tech_malloc(i32 %7)
store i8* %8, i8** @task1.text
%9 = call i32 @strcpy_rom(i8* %8, i8* %4)
%10 = call i32 @strlen_rom(i8* %5)
%11 = add nsw i32 %10, 1
%12 = call i8* @tech_malloc(i32 %11)
store i8* %12, i8** @task1.website
%13 = call i32 @strcpy_rom(i8* %12, i8* %5)
br label %14
14: ; preds = %14, %1
%15 = load i8, i8* %0
%16 = load i8*, i8** @task1.website
%17 = call i32 @Lcd_OutText(i8 zeroext %15, i8* %16)
%18 = load i8*, i8** @task1.text
%19 = call i32 @Lcd_Out(i32 1, i32 1, i8* %18)
%20 = call i32 (...) @yield()
br label %14
}