#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 */
struct ip_usbph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ip_usbph_bot_char(struct ip_usbph *, int,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ ip_usbph_flush(struct ip_usbph *);
int /*<<< orphan*/ ip_usbph_font_char(int);
int /*<<< orphan*/ sleep(int);
void bot_char_test(struct ip_usbph *ph) {
  int i;
  for (i = 0; i < 4; i++) {
    ip_usbph_bot_char(ph, i, ip_usbph_font_char(255));
  }
  ip_usbph_flush(ph);
  sleep(1);
  for (i = 0; i < 4; i++) {
    ip_usbph_bot_char(ph, i, ip_usbph_font_char(i + 'a'));
  }
  ip_usbph_flush(ph);
}


x86 assembly (clang, -O0):
<bot_char_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1191 <bot_char_test+0x51>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xff,%edi
call   1040 <ip_usbph_font_char@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    %eax,%edx
call   1050 <ip_usbph_bot_char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <bot_char_test+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <ip_usbph_flush@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    11ea <bot_char_test+0xaa>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
add    $0x61,%edi
call   1040 <ip_usbph_font_char@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
call   1050 <ip_usbph_bot_char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ab <bot_char_test+0x6b>
mov    -0x8(%rbp),%rdi
call   1030 <ip_usbph_flush@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_char_test>:
push   %rbx
mov    %rdi,%rbx
mov    $0xff,%edi
call   1040 <ip_usbph_font_char@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1050 <ip_usbph_bot_char@plt>
mov    $0xff,%edi
call   1040 <ip_usbph_font_char@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1050 <ip_usbph_bot_char@plt>
mov    $0xff,%edi
call   1040 <ip_usbph_font_char@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %eax,%edx
call   1050 <ip_usbph_bot_char@plt>
mov    $0xff,%edi
call   1040 <ip_usbph_font_char@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %eax,%edx
call   1050 <ip_usbph_bot_char@plt>
mov    %rbx,%rdi
call   1030 <ip_usbph_flush@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x61,%edi
call   1040 <ip_usbph_font_char@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1050 <ip_usbph_bot_char@plt>
mov    $0x62,%edi
call   1040 <ip_usbph_font_char@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1050 <ip_usbph_bot_char@plt>
mov    $0x63,%edi
call   1040 <ip_usbph_font_char@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %eax,%edx
call   1050 <ip_usbph_bot_char@plt>
mov    $0x64,%edi
call   1040 <ip_usbph_font_char@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %eax,%edx
call   1050 <ip_usbph_bot_char@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ip_usbph_flush@plt>

LLVM IR (-O0):
%struct.ip_usbph = type { i32 }
define void @bot_char_test(%struct.ip_usbph* %0) {
%2 = alloca %struct.ip_usbph*
%3 = alloca i32
store %struct.ip_usbph* %0, %struct.ip_usbph** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load %struct.ip_usbph*, %struct.ip_usbph** %2
%9 = load i32, i32* %3
%10 = call i32 @ip_usbph_font_char(i32 255)
%11 = call i32 @ip_usbph_bot_char(%struct.ip_usbph* %8, i32 %9, i32 %10)
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load %struct.ip_usbph*, %struct.ip_usbph** %2
%17 = call i32 @ip_usbph_flush(%struct.ip_usbph* %16)
%18 = call i32 @sleep(i32 1)
store i32 0, i32* %3
br label %19
19: ; preds = %29, %15
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 4
br i1 %21, label %22, label %32
22: ; preds = %19
%23 = load %struct.ip_usbph*, %struct.ip_usbph** %2
%24 = load i32, i32* %3
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 97
%27 = call i32 @ip_usbph_font_char(i32 %26)
%28 = call i32 @ip_usbph_bot_char(%struct.ip_usbph* %23, i32 %24, i32 %27)
br label %29
29: ; preds = %22
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %19
32: ; preds = %19
%33 = load %struct.ip_usbph*, %struct.ip_usbph** %2
%34 = call i32 @ip_usbph_flush(%struct.ip_usbph* %33)
ret void
}

LLVM IR (-O2):
%struct.ip_usbph = type { i32 }
define void @bot_char_test(%struct.ip_usbph* %0) {
%2 = tail call i32 @ip_usbph_font_char(i32 255)
%3 = tail call i32 @ip_usbph_bot_char(%struct.ip_usbph* %0, i32 0, i32 %2)
%4 = tail call i32 @ip_usbph_font_char(i32 255)
%5 = tail call i32 @ip_usbph_bot_char(%struct.ip_usbph* %0, i32 1, i32 %4)
%6 = tail call i32 @ip_usbph_font_char(i32 255)
%7 = tail call i32 @ip_usbph_bot_char(%struct.ip_usbph* %0, i32 2, i32 %6)
%8 = tail call i32 @ip_usbph_font_char(i32 255)
%9 = tail call i32 @ip_usbph_bot_char(%struct.ip_usbph* %0, i32 3, i32 %8)
%10 = tail call i32 @ip_usbph_flush(%struct.ip_usbph* %0)
%11 = tail call i32 @sleep(i32 1)
%12 = tail call i32 @ip_usbph_font_char(i32 97)
%13 = tail call i32 @ip_usbph_bot_char(%struct.ip_usbph* %0, i32 0, i32 %12)
%14 = tail call i32 @ip_usbph_font_char(i32 98)
%15 = tail call i32 @ip_usbph_bot_char(%struct.ip_usbph* %0, i32 1, i32 %14)
%16 = tail call i32 @ip_usbph_font_char(i32 99)
%17 = tail call i32 @ip_usbph_bot_char(%struct.ip_usbph* %0, i32 2, i32 %16)
%18 = tail call i32 @ip_usbph_font_char(i32 100)
%19 = tail call i32 @ip_usbph_bot_char(%struct.ip_usbph* %0, i32 3, i32 %18)
%20 = tail call i32 @ip_usbph_flush(%struct.ip_usbph* %0)
ret void
}