#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*/ println(char *);
int /*<<< orphan*/ tek_clear(char const *);
int /*<<< orphan*/ tek_enable(int);
int /*<<< orphan*/ tek_font(int);
int tek_hello(const char *the_title) {
  int n;
  tek_clear(the_title);
  tek_enable(1);
  for (n = 0; n < 4; ++n) {
    tek_font(n);
    println("Hello world!\r");
  }
  tek_enable(0);
  return (0);
}


x86 assembly (clang, -O0):
<tek_hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <tek_clear@plt>
mov    $0x1,%edi
call   1060 <tek_enable@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1192 <tek_hello+0x52>
mov    -0xc(%rbp),%edi
call   1050 <tek_font@plt>
lea    0xe81(%rip),%rdi
call   1030 <println@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1166 <tek_hello+0x26>
xor    %edi,%edi
call   1060 <tek_enable@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tek_hello>:
push   %rbx
call   1040 <tek_clear@plt>
mov    $0x1,%edi
call   1060 <tek_enable@plt>
xor    %edi,%edi
call   1050 <tek_font@plt>
lea    0xea2(%rip),%rbx
mov    %rbx,%rdi
call   1030 <println@plt>
mov    $0x1,%edi
call   1050 <tek_font@plt>
mov    %rbx,%rdi
call   1030 <println@plt>
mov    $0x2,%edi
call   1050 <tek_font@plt>
mov    %rbx,%rdi
call   1030 <println@plt>
mov    $0x3,%edi
call   1050 <tek_font@plt>
mov    %rbx,%rdi
call   1030 <println@plt>
xor    %edi,%edi
call   1060 <tek_enable@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0D\00"
define i32 @tek_hello(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @tek_clear(i8* %4)
%6 = call i32 @tek_enable(i32 1)
store i32 0, i32* %3
br label %7
7: ; preds = %14, %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i32 @tek_font(i32 %11)
%13 = call i32 @println(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %10
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %7
17: ; preds = %7
%18 = call i32 @tek_enable(i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world!\0D\00"
define i32 @tek_hello(i8* %0) {
%2 = tail call i32 @tek_clear(i8* %0)
%3 = tail call i32 @tek_enable(i32 1)
%4 = tail call i32 @tek_font(i32 0)
%5 = tail call i32 @println(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @tek_font(i32 1)
%7 = tail call i32 @println(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @tek_font(i32 2)
%9 = tail call i32 @println(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @tek_font(i32 3)
%11 = tail call i32 @println(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @tek_enable(i32 0)
ret i32 0
}