#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*/ GETPC();
int /*<<< orphan*/ GETSP();
int /*<<< orphan*/ PUT32(int, int);
int /*<<< orphan*/ hexstring(int /*<<< orphan*/);
int /*<<< orphan*/ uart_init();
int /*<<< orphan*/ uart_putc(int);
int notmain(void) {
  unsigned int ra;
  uart_init();
  hexstring(GETPC());
  hexstring(GETSP());
  for (ra = 0; ra < 10; ra++) {
    uart_putc('A' + ra);
  }
  uart_putc(0x0D);
  uart_putc(0x0A);
  uart_putc(0x55);
  uart_putc(0x30);
  PUT32(0xF0000000, 1);
  return (0);
}


x86 assembly (clang, -O0):
<notmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <uart_init@plt>
mov    $0x0,%al
call   1070 <GETPC@plt>
mov    %eax,%edi
call   1050 <hexstring@plt>
mov    $0x0,%al
call   1080 <GETSP@plt>
mov    %eax,%edi
call   1050 <hexstring@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jae    11b5 <notmain+0x55>
mov    -0x4(%rbp),%edi
add    $0x41,%edi
call   1030 <uart_putc@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1192 <notmain+0x32>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
mov    $0xa,%edi
call   1030 <uart_putc@plt>
mov    $0x55,%edi
call   1030 <uart_putc@plt>
mov    $0x30,%edi
call   1030 <uart_putc@plt>
mov    $0xf0000000,%edi
mov    $0x1,%esi
call   1060 <PUT32@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notmain>:
push   %rax
xor    %eax,%eax
call   1040 <uart_init@plt>
xor    %eax,%eax
call   1070 <GETPC@plt>
mov    %eax,%edi
call   1050 <hexstring@plt>
xor    %eax,%eax
call   1080 <GETSP@plt>
mov    %eax,%edi
call   1050 <hexstring@plt>
mov    $0x41,%edi
call   1030 <uart_putc@plt>
mov    $0x42,%edi
call   1030 <uart_putc@plt>
mov    $0x43,%edi
call   1030 <uart_putc@plt>
mov    $0x44,%edi
call   1030 <uart_putc@plt>
mov    $0x45,%edi
call   1030 <uart_putc@plt>
mov    $0x46,%edi
call   1030 <uart_putc@plt>
mov    $0x47,%edi
call   1030 <uart_putc@plt>
mov    $0x48,%edi
call   1030 <uart_putc@plt>
mov    $0x49,%edi
call   1030 <uart_putc@plt>
mov    $0x4a,%edi
call   1030 <uart_putc@plt>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
mov    $0xa,%edi
call   1030 <uart_putc@plt>
mov    $0x55,%edi
call   1030 <uart_putc@plt>
mov    $0x30,%edi
call   1030 <uart_putc@plt>
mov    $0xf0000000,%edi
mov    $0x1,%esi
call   1060 <PUT32@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @notmain() {
%1 = alloca i32
%2 = call i32 (...) @uart_init()
%3 = call i32 (...) @GETPC()
%4 = call i32 @hexstring(i32 %3)
%5 = call i32 (...) @GETSP()
%6 = call i32 @hexstring(i32 %5)
store i32 0, i32* %1
br label %7
7: ; preds = %14, %0
%8 = load i32, i32* %1
%9 = icmp ult i32 %8, 10
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %1
%12 = add i32 65, %11
%13 = call i32 @uart_putc(i32 %12)
br label %14
14: ; preds = %10
%15 = load i32, i32* %1
%16 = add i32 %15, 1
store i32 %16, i32* %1
br label %7
17: ; preds = %7
%18 = call i32 @uart_putc(i32 13)
%19 = call i32 @uart_putc(i32 10)
%20 = call i32 @uart_putc(i32 85)
%21 = call i32 @uart_putc(i32 48)
%22 = call i32 @PUT32(i32 -268435456, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @notmain() {
%1 = tail call i32 (...) @uart_init()
%2 = tail call i32 (...) @GETPC()
%3 = tail call i32 @hexstring(i32 %2)
%4 = tail call i32 (...) @GETSP()
%5 = tail call i32 @hexstring(i32 %4)
%6 = tail call i32 @uart_putc(i32 65)
%7 = tail call i32 @uart_putc(i32 66)
%8 = tail call i32 @uart_putc(i32 67)
%9 = tail call i32 @uart_putc(i32 68)
%10 = tail call i32 @uart_putc(i32 69)
%11 = tail call i32 @uart_putc(i32 70)
%12 = tail call i32 @uart_putc(i32 71)
%13 = tail call i32 @uart_putc(i32 72)
%14 = tail call i32 @uart_putc(i32 73)
%15 = tail call i32 @uart_putc(i32 74)
%16 = tail call i32 @uart_putc(i32 13)
%17 = tail call i32 @uart_putc(i32 10)
%18 = tail call i32 @uart_putc(i32 85)
%19 = tail call i32 @uart_putc(i32 48)
%20 = tail call i32 @PUT32(i32 -268435456, i32 1)
ret i32 0
}