#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*/ beatstep_send_sysex(int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ beatstep_set_ccbutton(int, int);
int /*<<< orphan*/ beatstep_set_relative(int, int);
void beatstep_controls_init(void) {
  int knob, button;
  for (knob = 0; knob < 16; knob++)
    beatstep_set_relative((0x20 + (knob)), (0x20 + (knob)));
  beatstep_set_relative(0x30, 0x30);
  for (button = 0; button < 16; button++)
    beatstep_set_ccbutton((0x70 + (button)), (0x70 + (button)));
  beatstep_set_ccbutton(0x5e, 0x5e);
  beatstep_send_sysex(0, 0x41, 4, 2);
}


x86 assembly (clang, -O0):
<beatstep_controls_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1168 <beatstep_controls_init+0x38>
mov    -0x4(%rbp),%edi
add    $0x20,%edi
mov    -0x4(%rbp),%esi
add    $0x20,%esi
call   1050 <beatstep_set_relative@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <beatstep_controls_init+0xf>
mov    $0x30,%esi
mov    %esi,%edi
call   1050 <beatstep_set_relative@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    11a4 <beatstep_controls_init+0x74>
mov    -0x8(%rbp),%edi
add    $0x70,%edi
mov    -0x8(%rbp),%esi
add    $0x70,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117b <beatstep_controls_init+0x4b>
mov    $0x5e,%esi
mov    %esi,%edi
call   1030 <beatstep_set_ccbutton@plt>
xor    %edi,%edi
mov    $0x41,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1040 <beatstep_send_sysex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beatstep_controls_init>:
push   %rax
mov    $0x20,%edi
mov    $0x20,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x21,%edi
mov    $0x21,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x22,%edi
mov    $0x22,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x23,%edi
mov    $0x23,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x24,%edi
mov    $0x24,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x25,%edi
mov    $0x25,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x26,%edi
mov    $0x26,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x27,%edi
mov    $0x27,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x28,%edi
mov    $0x28,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x29,%edi
mov    $0x29,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x2a,%edi
mov    $0x2a,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x2b,%edi
mov    $0x2b,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x2c,%edi
mov    $0x2c,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x2d,%edi
mov    $0x2d,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x2e,%edi
mov    $0x2e,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x2f,%edi
mov    $0x2f,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x30,%edi
mov    $0x30,%esi
call   1050 <beatstep_set_relative@plt>
mov    $0x70,%edi
mov    $0x70,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x71,%edi
mov    $0x71,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x72,%edi
mov    $0x72,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x73,%edi
mov    $0x73,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x74,%edi
mov    $0x74,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x75,%edi
mov    $0x75,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x76,%edi
mov    $0x76,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x77,%edi
mov    $0x77,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x78,%edi
mov    $0x78,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x79,%edi
mov    $0x79,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x7a,%edi
mov    $0x7a,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x7b,%edi
mov    $0x7b,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x7c,%edi
mov    $0x7c,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x7d,%edi
mov    $0x7d,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x7e,%edi
mov    $0x7e,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x7f,%edi
mov    $0x7f,%esi
call   1030 <beatstep_set_ccbutton@plt>
mov    $0x5e,%edi
mov    $0x5e,%esi
call   1030 <beatstep_set_ccbutton@plt>
xor    %edi,%edi
mov    $0x41,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
pop    %rax
jmp    1040 <beatstep_send_sysex@plt>

LLVM IR (-O0):
define void @beatstep_controls_init() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load i32, i32* %1
%8 = add nsw i32 32, %7
%9 = load i32, i32* %1
%10 = add nsw i32 32, %9
%11 = call i32 @beatstep_set_relative(i32 %8, i32 %10)
br label %12
12: ; preds = %6
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %3
15: ; preds = %3
%16 = call i32 @beatstep_set_relative(i32 48, i32 48)
store i32 0, i32* %2
br label %17
17: ; preds = %26, %15
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 16
br i1 %19, label %20, label %29
20: ; preds = %17
%21 = load i32, i32* %2
%22 = add nsw i32 112, %21
%23 = load i32, i32* %2
%24 = add nsw i32 112, %23
%25 = call i32 @beatstep_set_ccbutton(i32 %22, i32 %24)
br label %26
26: ; preds = %20
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %17
29: ; preds = %17
%30 = call i32 @beatstep_set_ccbutton(i32 94, i32 94)
%31 = call i32 @beatstep_send_sysex(i32 0, i32 65, i32 4, i32 2)
ret void
}

LLVM IR (-O2):
define void @beatstep_controls_init() {
%1 = tail call i32 @beatstep_set_relative(i32 32, i32 32)
%2 = tail call i32 @beatstep_set_relative(i32 33, i32 33)
%3 = tail call i32 @beatstep_set_relative(i32 34, i32 34)
%4 = tail call i32 @beatstep_set_relative(i32 35, i32 35)
%5 = tail call i32 @beatstep_set_relative(i32 36, i32 36)
%6 = tail call i32 @beatstep_set_relative(i32 37, i32 37)
%7 = tail call i32 @beatstep_set_relative(i32 38, i32 38)
%8 = tail call i32 @beatstep_set_relative(i32 39, i32 39)
%9 = tail call i32 @beatstep_set_relative(i32 40, i32 40)
%10 = tail call i32 @beatstep_set_relative(i32 41, i32 41)
%11 = tail call i32 @beatstep_set_relative(i32 42, i32 42)
%12 = tail call i32 @beatstep_set_relative(i32 43, i32 43)
%13 = tail call i32 @beatstep_set_relative(i32 44, i32 44)
%14 = tail call i32 @beatstep_set_relative(i32 45, i32 45)
%15 = tail call i32 @beatstep_set_relative(i32 46, i32 46)
%16 = tail call i32 @beatstep_set_relative(i32 47, i32 47)
%17 = tail call i32 @beatstep_set_relative(i32 48, i32 48)
%18 = tail call i32 @beatstep_set_ccbutton(i32 112, i32 112)
%19 = tail call i32 @beatstep_set_ccbutton(i32 113, i32 113)
%20 = tail call i32 @beatstep_set_ccbutton(i32 114, i32 114)
%21 = tail call i32 @beatstep_set_ccbutton(i32 115, i32 115)
%22 = tail call i32 @beatstep_set_ccbutton(i32 116, i32 116)
%23 = tail call i32 @beatstep_set_ccbutton(i32 117, i32 117)
%24 = tail call i32 @beatstep_set_ccbutton(i32 118, i32 118)
%25 = tail call i32 @beatstep_set_ccbutton(i32 119, i32 119)
%26 = tail call i32 @beatstep_set_ccbutton(i32 120, i32 120)
%27 = tail call i32 @beatstep_set_ccbutton(i32 121, i32 121)
%28 = tail call i32 @beatstep_set_ccbutton(i32 122, i32 122)
%29 = tail call i32 @beatstep_set_ccbutton(i32 123, i32 123)
%30 = tail call i32 @beatstep_set_ccbutton(i32 124, i32 124)
%31 = tail call i32 @beatstep_set_ccbutton(i32 125, i32 125)
%32 = tail call i32 @beatstep_set_ccbutton(i32 126, i32 126)
%33 = tail call i32 @beatstep_set_ccbutton(i32 127, i32 127)
%34 = tail call i32 @beatstep_set_ccbutton(i32 94, i32 94)
%35 = tail call i32 @beatstep_send_sysex(i32 0, i32 65, i32 4, i32 2)
ret void
}