#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 */
typedef scalar_t__ uint16_t;
typedef int int8_t;

/* Variables and functions */
void tune_stopnote(int8_t chan) {
  uint16_t *chan_ptr;
  if (chan == 0)
    chan_ptr = (uint16_t *)0x60001006;
  if (chan == 1)
    chan_ptr = (uint16_t *)0x60001008;
  if (chan == 2)
    chan_ptr = (uint16_t *)0x6000100a;
  if (chan == 3)
    chan_ptr = (uint16_t *)0x6000100c;
  if (chan == 4)
    chan_ptr = (uint16_t *)0x6000100e;
  if (chan == 5)
    chan_ptr = (uint16_t *)0x60001010;
  if (chan == 6)
    chan_ptr = (uint16_t *)0x60001012;
  if (chan == 7)
    chan_ptr = (uint16_t *)0x60001014;
  *chan_ptr = 0;
}


x86 assembly (clang, -O0):
<tune_stopnote>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111a <tune_stopnote+0x1a>
mov    $0x60001006,%eax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    112d <tune_stopnote+0x2d>
mov    $0x60001008,%eax
mov    %rax,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1140 <tune_stopnote+0x40>
mov    $0x6000100a,%eax
mov    %rax,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    1153 <tune_stopnote+0x53>
mov    $0x6000100c,%eax
mov    %rax,-0x10(%rbp)
cmpl   $0x4,-0x4(%rbp)
jne    1166 <tune_stopnote+0x66>
mov    $0x6000100e,%eax
mov    %rax,-0x10(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    1179 <tune_stopnote+0x79>
mov    $0x60001010,%eax
mov    %rax,-0x10(%rbp)
cmpl   $0x6,-0x4(%rbp)
jne    118c <tune_stopnote+0x8c>
mov    $0x60001012,%eax
mov    %rax,-0x10(%rbp)
cmpl   $0x7,-0x4(%rbp)
jne    119f <tune_stopnote+0x9f>
mov    $0x60001014,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tune_stopnote>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
add    %rax,%rax
add    $0x60001006,%rax
cmp    $0x2,%edi
mov    $0x6000100a,%ecx
cmovne %rax,%rcx
cmp    $0x3,%edi
mov    $0x6000100c,%eax
cmovne %rcx,%rax
cmp    $0x4,%edi
mov    $0x6000100e,%ecx
cmovne %rax,%rcx
cmp    $0x5,%edi
mov    $0x60001010,%eax
cmovne %rcx,%rax
cmp    $0x6,%edi
mov    $0x60001012,%ecx
cmovne %rax,%rcx
cmp    $0x7,%edi
mov    $0x60001014,%eax
cmovne %rcx,%rax
movq   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @tune_stopnote(i32 %0) {
%2 = alloca i32
%3 = alloca i64*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64* inttoptr (i64 1610616838 to i64*), i64** %3
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i64* inttoptr (i64 1610616840 to i64*), i64** %3
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %15
14: ; preds = %11
store i64* inttoptr (i64 1610616842 to i64*), i64** %3
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %19
18: ; preds = %15
store i64* inttoptr (i64 1610616844 to i64*), i64** %3
br label %19
19: ; preds = %18, %15
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 4
br i1 %21, label %22, label %23
22: ; preds = %19
store i64* inttoptr (i64 1610616846 to i64*), i64** %3
br label %23
23: ; preds = %22, %19
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 5
br i1 %25, label %26, label %27
26: ; preds = %23
store i64* inttoptr (i64 1610616848 to i64*), i64** %3
br label %27
27: ; preds = %26, %23
%28 = load i32, i32* %2
%29 = icmp eq i32 %28, 6
br i1 %29, label %30, label %31
30: ; preds = %27
store i64* inttoptr (i64 1610616850 to i64*), i64** %3
br label %31
31: ; preds = %30, %27
%32 = load i32, i32* %2
%33 = icmp eq i32 %32, 7
br i1 %33, label %34, label %35
34: ; preds = %31
store i64* inttoptr (i64 1610616852 to i64*), i64** %3
br label %35
35: ; preds = %34, %31
%36 = load i64*, i64** %3
store i64 0, i64* %36
ret void
}

LLVM IR (-O2):
define void @tune_stopnote(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i64* inttoptr (i64 1610616840 to i64*), i64* inttoptr (i64 1610616838 to i64*)
%4 = icmp eq i32 %0, 2
%5 = select i1 %4, i64* inttoptr (i64 1610616842 to i64*), i64* %3
%6 = icmp eq i32 %0, 3
%7 = select i1 %6, i64* inttoptr (i64 1610616844 to i64*), i64* %5
%8 = icmp eq i32 %0, 4
%9 = select i1 %8, i64* inttoptr (i64 1610616846 to i64*), i64* %7
%10 = icmp eq i32 %0, 5
%11 = select i1 %10, i64* inttoptr (i64 1610616848 to i64*), i64* %9
%12 = icmp eq i32 %0, 6
%13 = select i1 %12, i64* inttoptr (i64 1610616850 to i64*), i64* %11
%14 = icmp eq i32 %0, 7
%15 = select i1 %14, i64* inttoptr (i64 1610616852 to i64*), i64* %13
store i64 0, i64* %15
ret void
}