#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*/ assert(int);
int /*<<< orphan*/ end_test();
int get_accidentals_value(char *);
int /*<<< orphan*/ start_test(char *);
void test_get_accidentals_value() {
  start_test("get_accidentals_value");
  assert(get_accidentals_value("C###") == 3);
  assert(get_accidentals_value("C###bb") == 1);
  assert(get_accidentals_value("Cb#b#######") == 6);
  assert(get_accidentals_value("C######b####b##b###") == 12);
  assert(get_accidentals_value("Cbb") == -2);
  end_test();
}


x86 assembly (clang, -O0):
<test_get_accidentals_value>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <start_test@plt>
lea    0xebf(%rip),%rdi
call   1060 <get_accidentals_value@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xea8(%rip),%rdi
call   1060 <get_accidentals_value@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe93(%rip),%rdi
call   1060 <get_accidentals_value@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe83(%rip),%rdi
call   1060 <get_accidentals_value@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe7b(%rip),%rdi
call   1060 <get_accidentals_value@plt>
cmp    $0xfffffffe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1030 <end_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_get_accidentals_value>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <start_test@plt>
lea    0xec2(%rip),%rdi
call   1060 <get_accidentals_value@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xead(%rip),%rdi
call   1060 <get_accidentals_value@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe9a(%rip),%rdi
call   1060 <get_accidentals_value@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe8c(%rip),%rdi
call   1060 <get_accidentals_value@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe86(%rip),%rdi
call   1060 <get_accidentals_value@plt>
xor    %edi,%edi
cmp    $0xfffffffe,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <end_test@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"get_accidentals_value\00"
@.str.1 = [5 x i8] c"C###\00"
@.str.2 = [7 x i8] c"C###bb\00"
@.str.3 = [12 x i8] c"Cb#b#######\00"
@.str.4 = [20 x i8] c"C######b####b##b###\00"
@.str.5 = [4 x i8] c"Cbb\00"
define void @test_get_accidentals_value() {
%1 = call i32 @start_test(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @get_accidentals_value(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %2, 3
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @get_accidentals_value(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @get_accidentals_value(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp eq i32 %10, 6
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 @get_accidentals_value(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i32 %14, 12
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i32 @get_accidentals_value(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%19 = icmp eq i32 %18, -2
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call i32 (...) @end_test()
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"get_accidentals_value\00"
@.str.1 = [5 x i8] c"C###\00"
@.str.2 = [7 x i8] c"C###bb\00"
@.str.3 = [12 x i8] c"Cb#b#######\00"
@.str.4 = [20 x i8] c"C######b####b##b###\00"
@.str.5 = [4 x i8] c"Cbb\00"
define void @test_get_accidentals_value() {
%1 = tail call i32 @start_test(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @get_accidentals_value(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %2, 3
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @get_accidentals_value(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @get_accidentals_value(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp eq i32 %10, 6
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = tail call i32 @get_accidentals_value(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i32 %14, 12
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = tail call i32 @get_accidentals_value(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%19 = icmp eq i32 %18, -2
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
%22 = tail call i32 (...) @end_test()
ret void
}