#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*/ send_one_midiled(int, int);
void korgnano_reset(void) {
  int j, i;
  for (j = 0x20; j < 0x50; j += 0x10) {
    for (i = 0; i < 8; i++) {
      send_one_midiled(i + j, 0x00);
    }
  }
  send_one_midiled(0x29, 0x00);
  send_one_midiled(0x2a, 0x00);
  send_one_midiled(0x2b, 0x00);
  send_one_midiled(0x2c, 0x00);
  send_one_midiled(0x2d, 0x00);
}


x86 assembly (clang, -O0):
<korgnano_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x20,-0x4(%rbp)
cmpl   $0x50,-0x4(%rbp)
jge    1168 <korgnano_reset+0x58>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1155 <korgnano_reset+0x45>
mov    -0x8(%rbp),%edi
add    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <korgnano_reset+0x20>
jmp    115a <korgnano_reset+0x4a>
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <korgnano_reset+0xf>
mov    $0x29,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x2a,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x2b,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x2c,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x2d,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<korgnano_reset>:
push   %rax
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x22,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x23,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x24,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x25,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x26,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x27,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x30,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x31,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x32,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x33,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x34,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x35,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x36,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x37,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x40,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x41,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x42,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x43,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x44,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x45,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x46,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x47,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x29,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x2a,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x2b,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x2c,%edi
xor    %esi,%esi
call   1030 <send_one_midiled@plt>
mov    $0x2d,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <send_one_midiled@plt>

LLVM IR (-O0):
define void @korgnano_reset() {
%1 = alloca i32
%2 = alloca i32
store i32 32, i32* %1
br label %3
3: ; preds = %19, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 80
br i1 %5, label %6, label %22
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %15, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %1
%13 = add nsw i32 %11, %12
%14 = call i32 @send_one_midiled(i32 %13, i32 0)
br label %15
15: ; preds = %10
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %7
18: ; preds = %7
br label %19
19: ; preds = %18
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 16
store i32 %21, i32* %1
br label %3
22: ; preds = %3
%23 = call i32 @send_one_midiled(i32 41, i32 0)
%24 = call i32 @send_one_midiled(i32 42, i32 0)
%25 = call i32 @send_one_midiled(i32 43, i32 0)
%26 = call i32 @send_one_midiled(i32 44, i32 0)
%27 = call i32 @send_one_midiled(i32 45, i32 0)
ret void
}

LLVM IR (-O2):
define void @korgnano_reset() {
%1 = tail call i32 @send_one_midiled(i32 32, i32 0)
%2 = tail call i32 @send_one_midiled(i32 33, i32 0)
%3 = tail call i32 @send_one_midiled(i32 34, i32 0)
%4 = tail call i32 @send_one_midiled(i32 35, i32 0)
%5 = tail call i32 @send_one_midiled(i32 36, i32 0)
%6 = tail call i32 @send_one_midiled(i32 37, i32 0)
%7 = tail call i32 @send_one_midiled(i32 38, i32 0)
%8 = tail call i32 @send_one_midiled(i32 39, i32 0)
%9 = tail call i32 @send_one_midiled(i32 48, i32 0)
%10 = tail call i32 @send_one_midiled(i32 49, i32 0)
%11 = tail call i32 @send_one_midiled(i32 50, i32 0)
%12 = tail call i32 @send_one_midiled(i32 51, i32 0)
%13 = tail call i32 @send_one_midiled(i32 52, i32 0)
%14 = tail call i32 @send_one_midiled(i32 53, i32 0)
%15 = tail call i32 @send_one_midiled(i32 54, i32 0)
%16 = tail call i32 @send_one_midiled(i32 55, i32 0)
%17 = tail call i32 @send_one_midiled(i32 64, i32 0)
%18 = tail call i32 @send_one_midiled(i32 65, i32 0)
%19 = tail call i32 @send_one_midiled(i32 66, i32 0)
%20 = tail call i32 @send_one_midiled(i32 67, i32 0)
%21 = tail call i32 @send_one_midiled(i32 68, i32 0)
%22 = tail call i32 @send_one_midiled(i32 69, i32 0)
%23 = tail call i32 @send_one_midiled(i32 70, i32 0)
%24 = tail call i32 @send_one_midiled(i32 71, i32 0)
%25 = tail call i32 @send_one_midiled(i32 41, i32 0)
%26 = tail call i32 @send_one_midiled(i32 42, i32 0)
%27 = tail call i32 @send_one_midiled(i32 43, i32 0)
%28 = tail call i32 @send_one_midiled(i32 44, i32 0)
%29 = tail call i32 @send_one_midiled(i32 45, i32 0)
ret void
}