#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*/ bcm8544_init();
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ goto_xy(int /*<<< orphan*/, int);
int /*<<< orphan*/ write(char *);
void main(int argc, char *argv[]) {
  int i;
  bcm8544_init();
  clear_screen();
  for (i = 1; i < argc; i++) {
    goto_xy(0, i - 1);
    write(argv[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <bcm8544_init@plt>
mov    $0x0,%al
call   1040 <clear_screen@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    119c <main+0x5c>
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
xor    %edi,%edi
call   1060 <goto_xy@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <write@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <main+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <bcm8544_init@plt>
xor    %eax,%eax
call   1040 <clear_screen@plt>
cmp    $0x2,%ebx
jl     118c <main+0x4c>
mov    %ebx,%r15d
add    $0xffffffffffffffff,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %ebx,%esi
call   1060 <goto_xy@plt>
mov    0x8(%r14,%rbx,8),%rdi
call   1030 <write@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1170 <main+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (...) @bcm8544_init()
%7 = call i32 (...) @clear_screen()
store i32 1, i32* %5
br label %8
8: ; preds = %22, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 1
%15 = call i32 @goto_xy(i32 0, i32 %14)
%16 = load i8**, i8*** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @write(i8* %20)
br label %22
22: ; preds = %12
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %8
25: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @bcm8544_init()
%4 = tail call i32 (...) @clear_screen()
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %18
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 1, %6 ], [ %16, %8 ]
%10 = trunc i64 %9 to i32
%11 = add i32 %10, -1
%12 = tail call i32 @goto_xy(i32 0, i32 %11)
%13 = getelementptr inbounds i8*, i8** %1, i64 %9
%14 = load i8*, i8** %13
%15 = tail call i32 @write(i8* %14)
%16 = add nuw nsw i64 %9, 1
%17 = icmp eq i64 %16, %7
br i1 %17, label %18, label %8
18: ; preds = %8, %2
ret void
}