#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 KRun_calcNoteLen(char *, int, int);
int /*<<< orphan*/ s_test_long_eq_(int, int, char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
void k_run_test_len() {
  char buf[100];
  int len, v;
  strcpy(buf, "4");
  len = KRun_calcNoteLen(buf, 96, 96);
  s_test_long_eq_(len, 96, "KRun_calcNoteLen:1",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/kujirahand/sakuramml-c/"
                  "refs/heads/master/src/k_run_test.c",
                  15);
  strcpy(buf, "^");
  len = KRun_calcNoteLen(buf, 96, 96);
  v = 96 * 2;
  s_test_long_eq_(len, v, "KRun_calcNoteLen:2",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/kujirahand/sakuramml-c/"
                  "refs/heads/master/src/k_run_test.c",
                  20);
  strcpy(buf, "4.");
  len = KRun_calcNoteLen(buf, 96, 96);
  v = 96 + 96 / 2;
  s_test_long_eq_(len, v, "KRun_calcNoteLen:3",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/kujirahand/sakuramml-c/"
                  "refs/heads/master/src/k_run_test.c",
                  26);
  strcpy(buf, "1");
  len = KRun_calcNoteLen(buf, 96, 96);
  v = 96 * 4;
  s_test_long_eq_(len, v, "KRun_calcNoteLen:4",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/kujirahand/sakuramml-c/"
                  "refs/heads/master/src/k_run_test.c",
                  32);
  strcpy(buf, "1^2");
  len = KRun_calcNoteLen(buf, 96, 96);
  v = 96 * 4 + 96 * 2;
  s_test_long_eq_(len, v, "KRun_calcNoteLen:4",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/kujirahand/sakuramml-c/"
                  "refs/heads/master/src/k_run_test.c",
                  38);
  strcpy(buf, "4^^^");
  len = KRun_calcNoteLen(buf, 96, 96);
  v = 96 * 4;
  s_test_long_eq_(len, v, "KRun_calcNoteLen:4",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/kujirahand/sakuramml-c/"
                  "refs/heads/master/src/k_run_test.c",
                  44);
  strcpy(buf, "%24^%24");
  len = KRun_calcNoteLen(buf, 96, 96);
  s_test_long_eq_(len, 48, "KRun_calcNoteLen:5",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/kujirahand/sakuramml-c/"
                  "refs/heads/master/src/k_run_test.c",
                  49);
}


x86 assembly (clang, -O0):
<k_run_test_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rdi
lea    0xfac(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x60,%edx
mov    %edx,%esi
call   1050 <KRun_calcNoteLen@plt>
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%edi
mov    $0x60,%esi
lea    0xe93(%rip),%rdx
lea    0xe9f(%rip),%rcx
mov    $0xf,%r8d
call   1040 <s_test_long_eq_@plt>
lea    -0x70(%rbp),%rdi
lea    0xf60(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x60,%edx
mov    %edx,%esi
call   1050 <KRun_calcNoteLen@plt>
mov    %eax,-0x74(%rbp)
movl   $0xc0,-0x78(%rbp)
mov    -0x74(%rbp),%edi
mov    -0x78(%rbp),%esi
lea    0xef1(%rip),%rdx
lea    0xe56(%rip),%rcx
mov    $0x14,%r8d
call   1040 <s_test_long_eq_@plt>
lea    -0x70(%rbp),%rdi
lea    0xee7(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x60,%edx
mov    %edx,%esi
call   1050 <KRun_calcNoteLen@plt>
mov    %eax,-0x74(%rbp)
movl   $0x90,-0x78(%rbp)
mov    -0x74(%rbp),%edi
mov    -0x78(%rbp),%esi
lea    0xebe(%rip),%rdx
lea    0xe0d(%rip),%rcx
mov    $0x1a,%r8d
call   1040 <s_test_long_eq_@plt>
lea    -0x70(%rbp),%rdi
lea    0xdf5(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x60,%edx
mov    %edx,%esi
call   1050 <KRun_calcNoteLen@plt>
mov    %eax,-0x74(%rbp)
movl   $0x180,-0x78(%rbp)
mov    -0x74(%rbp),%edi
mov    -0x78(%rbp),%esi
lea    0xe88(%rip),%rdx
lea    0xdc4(%rip),%rcx
mov    $0x20,%r8d
call   1040 <s_test_long_eq_@plt>
lea    -0x70(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x60,%edx
mov    %edx,%esi
call   1050 <KRun_calcNoteLen@plt>
mov    %eax,-0x74(%rbp)
movl   $0x240,-0x78(%rbp)
mov    -0x74(%rbp),%edi
mov    -0x78(%rbp),%esi
lea    0xe3f(%rip),%rdx
lea    0xd7b(%rip),%rcx
mov    $0x26,%r8d
call   1040 <s_test_long_eq_@plt>
lea    -0x70(%rbp),%rdi
lea    0xe39(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x60,%edx
mov    %edx,%esi
call   1050 <KRun_calcNoteLen@plt>
mov    %eax,-0x74(%rbp)
movl   $0x180,-0x78(%rbp)
mov    -0x74(%rbp),%edi
mov    -0x78(%rbp),%esi
lea    0xdf6(%rip),%rdx
lea    0xd32(%rip),%rcx
mov    $0x2c,%r8d
call   1040 <s_test_long_eq_@plt>
lea    -0x70(%rbp),%rdi
lea    0xdf5(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x60,%edx
mov    %edx,%esi
call   1050 <KRun_calcNoteLen@plt>
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%edi
mov    $0x30,%esi
lea    0xdd6(%rip),%rdx
lea    0xcee(%rip),%rcx
mov    $0x31,%r8d
call   1040 <s_test_long_eq_@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_run_test_len>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
lea    0xfb2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x60,%esi
mov    $0x60,%edx
call   1050 <KRun_calcNoteLen@plt>
lea    0xe9c(%rip),%rdx
lea    0xea8(%rip),%r14
mov    %eax,%edi
mov    $0x60,%esi
mov    %r14,%rcx
mov    $0xf,%r8d
call   1040 <s_test_long_eq_@plt>
lea    0xf63(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x60,%esi
mov    $0x60,%edx
call   1050 <KRun_calcNoteLen@plt>
lea    0xeff(%rip),%rdx
mov    %eax,%edi
mov    $0xc0,%esi
mov    %r14,%rcx
mov    $0x14,%r8d
call   1040 <s_test_long_eq_@plt>
lea    0xef6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x60,%esi
mov    $0x60,%edx
call   1050 <KRun_calcNoteLen@plt>
lea    0xed8(%rip),%rdx
mov    %eax,%edi
mov    $0x90,%esi
mov    %r14,%rcx
mov    $0x1a,%r8d
call   1040 <s_test_long_eq_@plt>
lea    0xe10(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x60,%esi
mov    $0x60,%edx
call   1050 <KRun_calcNoteLen@plt>
lea    0xeae(%rip),%r15
mov    %eax,%edi
mov    $0x180,%esi
mov    %r15,%rdx
mov    %r14,%rcx
mov    $0x20,%r8d
call   1040 <s_test_long_eq_@plt>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x60,%esi
mov    $0x60,%edx
call   1050 <KRun_calcNoteLen@plt>
mov    %eax,%edi
mov    $0x240,%esi
mov    %r15,%rdx
mov    %r14,%rcx
mov    $0x26,%r8d
call   1040 <s_test_long_eq_@plt>
lea    0xe6d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x60,%esi
mov    $0x60,%edx
call   1050 <KRun_calcNoteLen@plt>
mov    %eax,%edi
mov    $0x180,%esi
mov    %r15,%rdx
mov    %r14,%rcx
mov    $0x2c,%r8d
call   1040 <s_test_long_eq_@plt>
lea    0xe39(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x60,%esi
mov    $0x60,%edx
call   1050 <KRun_calcNoteLen@plt>
lea    0xe20(%rip),%rdx
mov    %eax,%edi
mov    $0x30,%esi
mov    %r14,%rcx
mov    $0x31,%r8d
call   1040 <s_test_long_eq_@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"4\00"
@.str.1 = [19 x i8] c"KRun_calcNoteLen:1\00"
@.str.2 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kujirahand/sakuramml-c/refs/heads/master/src/k_run_test.c\00"
@.str.3 = [2 x i8] c"^\00"
@.str.4 = [19 x i8] c"KRun_calcNoteLen:2\00"
@.str.5 = [3 x i8] c"4.\00"
@.str.6 = [19 x i8] c"KRun_calcNoteLen:3\00"
@.str.7 = [2 x i8] c"1\00"
@.str.8 = [19 x i8] c"KRun_calcNoteLen:4\00"
@.str.9 = [4 x i8] c"1^2\00"
@.str.10 = [5 x i8] c"4^^^\00"
@.str.11 = [8 x i8] c"%24^%24\00"
@.str.12 = [19 x i8] c"KRun_calcNoteLen:5\00"
define void @k_run_test_len() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = call i32 @KRun_calcNoteLen(i8* %6, i32 96, i32 96)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @s_test_long_eq_(i32 %8, i32 96, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 15)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%13 = call i32 @KRun_calcNoteLen(i8* %12, i32 96, i32 96)
store i32 %13, i32* %2
store i32 192, i32* %3
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = call i32 @s_test_long_eq_(i32 %14, i32 %15, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 20)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%18 = call i32 @strcpy(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%20 = call i32 @KRun_calcNoteLen(i8* %19, i32 96, i32 96)
store i32 %20, i32* %2
store i32 144, i32* %3
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = call i32 @s_test_long_eq_(i32 %21, i32 %22, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 26)
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%25 = call i32 @strcpy(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%27 = call i32 @KRun_calcNoteLen(i8* %26, i32 96, i32 96)
store i32 %27, i32* %2
store i32 384, i32* %3
%28 = load i32, i32* %2
%29 = load i32, i32* %3
%30 = call i32 @s_test_long_eq_(i32 %28, i32 %29, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 32)
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%32 = call i32 @strcpy(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%34 = call i32 @KRun_calcNoteLen(i8* %33, i32 96, i32 96)
store i32 %34, i32* %2
store i32 576, i32* %3
%35 = load i32, i32* %2
%36 = load i32, i32* %3
%37 = call i32 @s_test_long_eq_(i32 %35, i32 %36, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 38)
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%39 = call i32 @strcpy(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%41 = call i32 @KRun_calcNoteLen(i8* %40, i32 96, i32 96)
store i32 %41, i32* %2
store i32 384, i32* %3
%42 = load i32, i32* %2
%43 = load i32, i32* %3
%44 = call i32 @s_test_long_eq_(i32 %42, i32 %43, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 44)
%45 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%46 = call i32 @strcpy(i8* %45, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%47 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%48 = call i32 @KRun_calcNoteLen(i8* %47, i32 96, i32 96)
store i32 %48, i32* %2
%49 = load i32, i32* %2
%50 = call i32 @s_test_long_eq_(i32 %49, i32 48, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 49)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"4\00"
@.str.1 = [19 x i8] c"KRun_calcNoteLen:1\00"
@.str.2 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kujirahand/sakuramml-c/refs/heads/master/src/k_run_test.c\00"
@.str.3 = [2 x i8] c"^\00"
@.str.4 = [19 x i8] c"KRun_calcNoteLen:2\00"
@.str.5 = [3 x i8] c"4.\00"
@.str.6 = [19 x i8] c"KRun_calcNoteLen:3\00"
@.str.7 = [2 x i8] c"1\00"
@.str.8 = [19 x i8] c"KRun_calcNoteLen:4\00"
@.str.9 = [4 x i8] c"1^2\00"
@.str.10 = [5 x i8] c"4^^^\00"
@.str.11 = [8 x i8] c"%24^%24\00"
@.str.12 = [19 x i8] c"KRun_calcNoteLen:5\00"
define void @k_run_test_len() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @KRun_calcNoteLen(i8* %2, i32 96, i32 96)
%5 = call i32 @s_test_long_eq_(i32 %4, i32 96, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 15)
%6 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @KRun_calcNoteLen(i8* %2, i32 96, i32 96)
%8 = call i32 @s_test_long_eq_(i32 %7, i32 192, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 20)
%9 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @KRun_calcNoteLen(i8* %2, i32 96, i32 96)
%11 = call i32 @s_test_long_eq_(i32 %10, i32 144, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 26)
%12 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 @KRun_calcNoteLen(i8* %2, i32 96, i32 96)
%14 = call i32 @s_test_long_eq_(i32 %13, i32 384, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 32)
%15 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%16 = call i32 @KRun_calcNoteLen(i8* %2, i32 96, i32 96)
%17 = call i32 @s_test_long_eq_(i32 %16, i32 576, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 38)
%18 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%19 = call i32 @KRun_calcNoteLen(i8* %2, i32 96, i32 96)
%20 = call i32 @s_test_long_eq_(i32 %19, i32 384, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 44)
%21 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%22 = call i32 @KRun_calcNoteLen(i8* %2, i32 96, i32 96)
%23 = call i32 @s_test_long_eq_(i32 %22, i32 48, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 49)
ret void
}