#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*/ SPISend(int, int /*<<< orphan*/);
int /*<<< orphan*/ toHexShort(unsigned int, char *);
int /*<<< orphan*/ usicBufferedSendCh0(char *);
void tickleMax1112x(void) {
  unsigned int buff_index = 0;
  char buff[64];
  unsigned int i;
  for (i = 0; i < 8; i++) {
    SPISend(0x48000200, 0);
    unsigned int rbufsr =
        (*((volatile unsigned int *const)(0x48000200 + 0x050)));
    while (rbufsr & ((1 << 13) | (1 << 14))) {
      unsigned int result =
          (*((volatile unsigned int *const)(0x48000200 + 0x054)));
      toHexShort(result, &buff[buff_index]);
      buff_index += 4;
      buff[buff_index] = ' ';
      buff_index += 1;
      rbufsr = (*((volatile unsigned int *const)(0x48000200 + 0x050)));
    }
    (*((volatile unsigned int *const)(0x48000200 + 0x048))) = 0;
  }
  buff[buff_index++] = '\r';
  buff[buff_index++] = '\n';
  buff[buff_index++] = '\0';
  usicBufferedSendCh0(buff);
}


x86 assembly (clang, -O0):
<tickleMax1112x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x8,-0x54(%rbp)
jae    11d5 <tickleMax1112x+0xa5>
mov    $0x48000200,%edi
xor    %esi,%esi
call   1030 <SPISend@plt>
mov    $0x48000250,%eax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%eax
and    $0x6000,%eax
cmp    $0x0,%eax
je     11bc <tickleMax1112x+0x8c>
mov    $0x48000254,%eax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%edi
mov    -0x4(%rbp),%eax
lea    -0x50(%rbp),%rsi
add    %rax,%rsi
call   1040 <toHexShort@plt>
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movb   $0x20,-0x50(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x48000250,%eax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
jmp    1166 <tickleMax1112x+0x36>
mov    $0x48000248,%eax
movl   $0x0,(%rax)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1146 <tickleMax1112x+0x16>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    %eax,%eax
movb   $0xd,-0x50(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    %eax,%eax
movb   $0xa,-0x50(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    %eax,%eax
movb   $0x0,-0x50(%rbp,%rax,1)
lea    -0x50(%rbp),%rdi
call   1050 <usicBufferedSendCh0@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tickleMax1112x>:
push   %rbp
push   %rbx
sub    $0x48,%rsp
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    1153 <tickleMax1112x+0x23>
nopl   0x0(%rax)
movl   $0x0,0x48000248
add    $0x1,%ebp
cmp    $0x8,%ebp
je     119b <tickleMax1112x+0x6b>
mov    $0x48000200,%edi
xor    %esi,%esi
call   1030 <SPISend@plt>
testl  $0x6000,0x48000250
je     1140 <tickleMax1112x+0x10>
nopl   0x0(%rax)
mov    0x48000254,%edi
mov    %ebx,%eax
lea    (%rsp,%rax,1),%rsi
call   1040 <toHexShort@plt>
lea    0x4(%rbx),%eax
movb   $0x20,(%rsp,%rax,1)
add    $0x5,%ebx
testl  $0x6000,0x48000250
jne    1170 <tickleMax1112x+0x40>
jmp    1140 <tickleMax1112x+0x10>
lea    0x1(%rbx),%eax
mov    %ebx,%ecx
movb   $0xd,(%rsp,%rcx,1)
add    $0x2,%ebx
movb   $0xa,(%rsp,%rax,1)
movb   $0x0,(%rsp,%rbx,1)
mov    %rsp,%rdi
call   1050 <usicBufferedSendCh0@plt>
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @tickleMax1112x() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %6
6: ; preds = %32, %0
%7 = load i32, i32* %3
%8 = icmp ult i32 %7, 8
br i1 %8, label %9, label %35
9: ; preds = %6
%10 = call i32 @SPISend(i32 1207960064, i32 0)
%11 = load volatile i32, i32* inttoptr (i64 1207960144 to i32*)
store i32 %11, i32* %4
br label %12
12: ; preds = %16, %9
%13 = load i32, i32* %4
%14 = and i32 %13, 24576
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %31
16: ; preds = %12
%17 = load volatile i32, i32* inttoptr (i64 1207960148 to i32*)
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = load i32, i32* %1
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 %20
%22 = call i32 @toHexShort(i32 %18, i8* %21)
%23 = load i32, i32* %1
%24 = add i32 %23, 4
store i32 %24, i32* %1
%25 = load i32, i32* %1
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 %26
store i8 32, i8* %27
%28 = load i32, i32* %1
%29 = add i32 %28, 1
store i32 %29, i32* %1
%30 = load volatile i32, i32* inttoptr (i64 1207960144 to i32*)
store i32 %30, i32* %4
br label %12
31: ; preds = %12
store volatile i32 0, i32* inttoptr (i64 1207960136 to i32*)
br label %32
32: ; preds = %31
%33 = load i32, i32* %3
%34 = add i32 %33, 1
store i32 %34, i32* %3
br label %6
35: ; preds = %6
%36 = load i32, i32* %1
%37 = add i32 %36, 1
store i32 %37, i32* %1
%38 = zext i32 %36 to i64
%39 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 %38
store i8 13, i8* %39
%40 = load i32, i32* %1
%41 = add i32 %40, 1
store i32 %41, i32* %1
%42 = zext i32 %40 to i64
%43 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 %42
store i8 10, i8* %43
%44 = load i32, i32* %1
%45 = add i32 %44, 1
store i32 %45, i32* %1
%46 = zext i32 %44 to i64
%47 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 %46
store i8 0, i8* %47
%48 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%49 = call i32 @usicBufferedSendCh0(i8* %48)
ret void
}

LLVM IR (-O2):
define void @tickleMax1112x() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %23
%4 = phi i32 [ 0, %0 ], [ %24, %23 ]
%5 = phi i32 [ 0, %0 ], [ %25, %23 ]
%6 = call i32 @SPISend(i32 1207960064, i32 0)
%7 = load volatile i32, i32* inttoptr (i64 1207960144 to i32*)
%8 = and i32 %7, 24576
%9 = icmp eq i32 %8, 0
br i1 %9, label %23, label %10
10: ; preds = %3, %10
%11 = phi i32 [ %19, %10 ], [ %4, %3 ]
%12 = load volatile i32, i32* inttoptr (i64 1207960148 to i32*)
%13 = zext i32 %11 to i64
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %13
%15 = call i32 @toHexShort(i32 %12, i8* %14)
%16 = add i32 %11, 4
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %17
store i8 32, i8* %18
%19 = add i32 %11, 5
%20 = load volatile i32, i32* inttoptr (i64 1207960144 to i32*)
%21 = and i32 %20, 24576
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %10
23: ; preds = %10, %3
%24 = phi i32 [ %4, %3 ], [ %19, %10 ]
store volatile i32 0, i32* inttoptr (i64 1207960136 to i32*)
%25 = add nuw nsw i32 %5, 1
%26 = icmp eq i32 %25, 8
br i1 %26, label %27, label %3
27: ; preds = %23
%28 = add i32 %24, 1
%29 = zext i32 %24 to i64
%30 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %29
store i8 13, i8* %30
%31 = add i32 %24, 2
%32 = zext i32 %28 to i64
%33 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %32
store i8 10, i8* %33
%34 = zext i32 %31 to i64
%35 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %34
store i8 0, i8* %35
%36 = call i32 @usicBufferedSendCh0(i8* %2)
ret void
}