#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*/ ht1632_clear();
int /*<<< orphan*/ ht1632_sendcmd(int, int);
int /*<<< orphan*/ setBPin(int, char *);
void ht1632_initialize() {
  setBPin(3, "HIGH");
  for (int i = 1; i <= (2 * 4); i++) {
    ht1632_sendcmd(i, 0x00);
    ht1632_sendcmd(i, 0x20);
    ht1632_sendcmd(i, 0x18);
    ht1632_sendcmd(i, 0x01);
    ht1632_sendcmd(i, 0x03);
  }
  ht1632_clear();
}


x86 assembly (clang, -O0):
<ht1632_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
lea    0xebc(%rip),%rsi
call   1040 <setBPin@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jg     11a6 <ht1632_initialize+0x76>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <ht1632_sendcmd@plt>
mov    -0x4(%rbp),%edi
mov    $0x20,%esi
call   1030 <ht1632_sendcmd@plt>
mov    -0x4(%rbp),%edi
mov    $0x18,%esi
call   1030 <ht1632_sendcmd@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <ht1632_sendcmd@plt>
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
call   1030 <ht1632_sendcmd@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <ht1632_initialize+0x20>
mov    $0x0,%al
call   1050 <ht1632_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht1632_initialize>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x3,%edi
call   1040 <setBPin@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x1,%edi
mov    $0x20,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x1,%edi
mov    $0x18,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x2,%edi
mov    $0x20,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x2,%edi
mov    $0x18,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x3,%edi
mov    $0x20,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x3,%edi
mov    $0x18,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x3,%edi
mov    $0x3,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x4,%edi
mov    $0x20,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x4,%edi
mov    $0x18,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x4,%edi
mov    $0x3,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x5,%edi
xor    %esi,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x5,%edi
mov    $0x20,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x5,%edi
mov    $0x18,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x5,%edi
mov    $0x1,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x5,%edi
mov    $0x3,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x6,%edi
mov    $0x20,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x6,%edi
mov    $0x18,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x6,%edi
mov    $0x1,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x6,%edi
mov    $0x3,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x7,%edi
mov    $0x20,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x7,%edi
mov    $0x18,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x7,%edi
mov    $0x1,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x7,%edi
mov    $0x3,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x8,%edi
xor    %esi,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x8,%edi
mov    $0x20,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x8,%edi
mov    $0x18,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1030 <ht1632_sendcmd@plt>
mov    $0x8,%edi
mov    $0x3,%esi
call   1030 <ht1632_sendcmd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ht1632_clear@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"HIGH\00"
define void @ht1632_initialize() {
%1 = alloca i32
%2 = call i32 @setBPin(i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %3
3: ; preds = %17, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 8
br i1 %5, label %6, label %20
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 @ht1632_sendcmd(i32 %7, i32 0)
%9 = load i32, i32* %1
%10 = call i32 @ht1632_sendcmd(i32 %9, i32 32)
%11 = load i32, i32* %1
%12 = call i32 @ht1632_sendcmd(i32 %11, i32 24)
%13 = load i32, i32* %1
%14 = call i32 @ht1632_sendcmd(i32 %13, i32 1)
%15 = load i32, i32* %1
%16 = call i32 @ht1632_sendcmd(i32 %15, i32 3)
br label %17
17: ; preds = %6
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
br label %3
20: ; preds = %3
%21 = call i32 (...) @ht1632_clear()
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"HIGH\00"
define void @ht1632_initialize() {
%1 = tail call i32 @setBPin(i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ht1632_sendcmd(i32 1, i32 0)
%3 = tail call i32 @ht1632_sendcmd(i32 1, i32 32)
%4 = tail call i32 @ht1632_sendcmd(i32 1, i32 24)
%5 = tail call i32 @ht1632_sendcmd(i32 1, i32 1)
%6 = tail call i32 @ht1632_sendcmd(i32 1, i32 3)
%7 = tail call i32 @ht1632_sendcmd(i32 2, i32 0)
%8 = tail call i32 @ht1632_sendcmd(i32 2, i32 32)
%9 = tail call i32 @ht1632_sendcmd(i32 2, i32 24)
%10 = tail call i32 @ht1632_sendcmd(i32 2, i32 1)
%11 = tail call i32 @ht1632_sendcmd(i32 2, i32 3)
%12 = tail call i32 @ht1632_sendcmd(i32 3, i32 0)
%13 = tail call i32 @ht1632_sendcmd(i32 3, i32 32)
%14 = tail call i32 @ht1632_sendcmd(i32 3, i32 24)
%15 = tail call i32 @ht1632_sendcmd(i32 3, i32 1)
%16 = tail call i32 @ht1632_sendcmd(i32 3, i32 3)
%17 = tail call i32 @ht1632_sendcmd(i32 4, i32 0)
%18 = tail call i32 @ht1632_sendcmd(i32 4, i32 32)
%19 = tail call i32 @ht1632_sendcmd(i32 4, i32 24)
%20 = tail call i32 @ht1632_sendcmd(i32 4, i32 1)
%21 = tail call i32 @ht1632_sendcmd(i32 4, i32 3)
%22 = tail call i32 @ht1632_sendcmd(i32 5, i32 0)
%23 = tail call i32 @ht1632_sendcmd(i32 5, i32 32)
%24 = tail call i32 @ht1632_sendcmd(i32 5, i32 24)
%25 = tail call i32 @ht1632_sendcmd(i32 5, i32 1)
%26 = tail call i32 @ht1632_sendcmd(i32 5, i32 3)
%27 = tail call i32 @ht1632_sendcmd(i32 6, i32 0)
%28 = tail call i32 @ht1632_sendcmd(i32 6, i32 32)
%29 = tail call i32 @ht1632_sendcmd(i32 6, i32 24)
%30 = tail call i32 @ht1632_sendcmd(i32 6, i32 1)
%31 = tail call i32 @ht1632_sendcmd(i32 6, i32 3)
%32 = tail call i32 @ht1632_sendcmd(i32 7, i32 0)
%33 = tail call i32 @ht1632_sendcmd(i32 7, i32 32)
%34 = tail call i32 @ht1632_sendcmd(i32 7, i32 24)
%35 = tail call i32 @ht1632_sendcmd(i32 7, i32 1)
%36 = tail call i32 @ht1632_sendcmd(i32 7, i32 3)
%37 = tail call i32 @ht1632_sendcmd(i32 8, i32 0)
%38 = tail call i32 @ht1632_sendcmd(i32 8, i32 32)
%39 = tail call i32 @ht1632_sendcmd(i32 8, i32 24)
%40 = tail call i32 @ht1632_sendcmd(i32 8, i32 1)
%41 = tail call i32 @ht1632_sendcmd(i32 8, i32 3)
%42 = tail call i32 (...) @ht1632_clear()
ret void
}