#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 */
struct SYMBOL {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ a2b(char *, ...);
int /*<<< orphan*/ identify_note(struct SYMBOL *, int, int *, int *, int *);
void draw_notempo(struct SYMBOL *s, int len, float sc) {
  int head, dots, flags;
  float dx;
  a2b("gsave %.2f dup scale 8 3 RM currentpoint ", sc);
  identify_note(s, len, &head, &dots, &flags);
  switch (head) {
  case 2:
    a2b("HD");
    break;
  case 1:
    a2b("Hd");
    break;
  default:
    a2b("hd");
    break;
  }
  dx = 4;
  if (dots) {
    float dotx;
    dotx = 8;
    if (flags > 0)
      dotx += 4;
    switch (head) {
    case 3:
    case 2:
      dotx += 2;
      break;
    case 1:
      dotx += 1;
      break;
    }
    while (--dots >= 0) {
      a2b(" %.1f 0 dt", dotx);
      dx = dotx;
      dotx += 3.5;
    }
  }
  if (len < 1536) {
    if (flags <= 0)
      a2b(" %d su", 20);
    else {
      a2b(" %d %d sfu", flags, 20);
      if (dx < 6)
        dx = 6;
    }
  }
  a2b(" grestore %.1f 0 RM\n", (dx + 15) * sc);
}


x86 assembly (clang, -O0):
<draw_notempo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xedc(%rip),%rdi
mov    $0x1,%al
call   1040 <a2b@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1030 <identify_note@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x1,%eax
je     119b <draw_notempo+0x7b>
jmp    1177 <draw_notempo+0x57>
mov    -0x28(%rbp),%eax
sub    $0x2,%eax
jne    11ae <draw_notempo+0x8e>
jmp    1188 <draw_notempo+0x68>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <a2b@plt>
jmp    11bc <draw_notempo+0x9c>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <a2b@plt>
jmp    11bc <draw_notempo+0x9c>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <a2b@plt>
movss  0xe3c(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     12ad <draw_notempo+0x18d>
movss  0xe29(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    11fc <draw_notempo+0xdc>
movss  0xe0e(%rip),%xmm0
addss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x1,%eax
je     123b <draw_notempo+0x11b>
jmp    1210 <draw_notempo+0xf0>
mov    -0x2c(%rbp),%eax
add    $0xfffffffe,%eax
sub    $0x1,%eax
ja     124d <draw_notempo+0x12d>
jmp    1224 <draw_notempo+0x104>
movss  0xde0(%rip),%xmm0
addss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    124d <draw_notempo+0x12d>
movss  0xdc5(%rip),%xmm0
addss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    1252 <draw_notempo+0x132>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jl     12a8 <draw_notempo+0x188>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xddf(%rip),%rdi
mov    $0x1,%al
call   1040 <a2b@plt>
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd82(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    1252 <draw_notempo+0x132>
jmp    12ad <draw_notempo+0x18d>
cmpl   $0x600,-0xc(%rbp)
jge    131b <draw_notempo+0x1fb>
cmpl   $0x0,-0x1c(%rbp)
jg     12dc <draw_notempo+0x1bc>
lea    0xd93(%rip),%rdi
mov    $0x14,%esi
mov    $0x0,%al
call   1040 <a2b@plt>
jmp    1316 <draw_notempo+0x1f6>
mov    -0x1c(%rbp),%esi
lea    0xd7f(%rip),%rdi
mov    $0x14,%edx
mov    $0x0,%al
call   1040 <a2b@plt>
movss  0xd16(%rip),%xmm0
ucomiss -0x20(%rbp),%xmm0
jbe    1311 <draw_notempo+0x1f1>
movss  0xd04(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
jmp    1316 <draw_notempo+0x1f6>
jmp    131b <draw_notempo+0x1fb>
movss  0xcf1(%rip),%xmm0
addss  -0x20(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd38(%rip),%rdi
mov    $0x1,%al
call   1040 <a2b@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_notempo>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
movss  %xmm0,0x8(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xee4(%rip),%rdi
mov    $0x1,%al
call   1040 <a2b@plt>
lea    0x10(%rsp),%rdx
lea    0x4(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <identify_note@plt>
mov    0x10(%rsp),%eax
cmp    $0x1,%eax
lea    0xee3(%rip),%rcx
lea    0xedf(%rip),%rdx
cmove  %rcx,%rdx
cmp    $0x2,%eax
lea    0xecb(%rip),%rdi
cmovne %rdx,%rdi
xor    %eax,%eax
call   1040 <a2b@plt>
mov    0x4(%rsp),%eax
movss  0xe6a(%rip),%xmm0
test   %eax,%eax
movss  %xmm0,(%rsp)
je     1229 <draw_notempo+0x109>
xor    %ecx,%ecx
cmpl   $0x0,0xc(%rsp)
setg   %cl
lea    0xe64(%rip),%rdx
movss  (%rdx,%rcx,4),%xmm1
mov    0x10(%rsp),%ecx
lea    -0x2(%rcx),%edx
cmp    $0x2,%edx
jae    11cf <draw_notempo+0xaf>
addss  0xe3b(%rip),%xmm1
jmp    11dc <draw_notempo+0xbc>
cmp    $0x1,%ecx
jne    11dc <draw_notempo+0xbc>
addss  0xe28(%rip),%xmm1
lea    -0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
test   %eax,%eax
jle    1229 <draw_notempo+0x109>
lea    0xe65(%rip),%rbx
xchg   %ax,%ax
movss  %xmm1,0x14(%rsp)
movss  %xmm1,(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <a2b@plt>
movss  0x14(%rsp),%xmm1
addss  0xdf2(%rip),%xmm1
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
test   %eax,%eax
jg     11f0 <draw_notempo+0xd0>
cmp    $0x5ff,%ebp
jg     127c <draw_notempo+0x15c>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    1269 <draw_notempo+0x149>
lea    0xe25(%rip),%rdi
mov    $0x14,%edx
xor    %eax,%eax
call   1040 <a2b@plt>
movss  0xdbc(%rip),%xmm0
movss  (%rsp),%xmm2
ucomiss %xmm2,%xmm0
movss  0x8(%rsp),%xmm1
jbe    1287 <draw_notempo+0x167>
movaps %xmm0,%xmm2
jmp    1287 <draw_notempo+0x167>
lea    0xdee(%rip),%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1040 <a2b@plt>
movss  0x8(%rsp),%xmm1
movss  (%rsp),%xmm2
addss  0xd85(%rip),%xmm2
mulss  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
lea    0xdcf(%rip),%rdi
mov    $0x1,%al
call   1040 <a2b@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.SYMBOL = type { i32 }
@.str = [42 x i8] c"gsave %.2f dup scale 8 3 RM currentpoint \00"
@.str.1 = [3 x i8] c"HD\00"
@.str.2 = [3 x i8] c"Hd\00"
@.str.3 = [3 x i8] c"hd\00"
@.str.4 = [11 x i8] c" %.1f 0 dt\00"
@.str.5 = [7 x i8] c" %d su\00"
@.str.6 = [11 x i8] c" %d %d sfu\00"
@.str.7 = [21 x i8] c" grestore %.1f 0 RM\0A\00"
define void @draw_notempo(%struct.SYMBOL* %0, i32 %1, float %2) {
%4 = alloca %struct.SYMBOL*
%5 = alloca i32
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
%11 = alloca float
store %struct.SYMBOL* %0, %struct.SYMBOL** %4
store i32 %1, i32* %5
store float %2, float* %6
%12 = load float, float* %6
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @a2b(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), double %13)
%15 = load %struct.SYMBOL*, %struct.SYMBOL** %4
%16 = load i32, i32* %5
%17 = call i32 @identify_note(%struct.SYMBOL* %15, i32 %16, i32* %7, i32* %8, i32* %9)
%18 = load i32, i32* %7
switch i32 %18, label %23 [
i32 2, label %19
i32 1, label %21
]
19: ; preds = %3
%20 = call i32 (i8*, ...) @a2b(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %25
21: ; preds = %3
%22 = call i32 (i8*, ...) @a2b(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %25
23: ; preds = %3
%24 = call i32 (i8*, ...) @a2b(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %21, %19
store float 4.000000e+00, float* %10
%26 = load i32, i32* %8
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %57
28: ; preds = %25
store float 8.000000e+00, float* %11
%29 = load i32, i32* %9
%30 = icmp sgt i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load float, float* %11
%33 = fadd float %32, 4.000000e+00
store float %33, float* %11
br label %34
34: ; preds = %31, %28
%35 = load i32, i32* %7
switch i32 %35, label %42 [
i32 3, label %36
i32 2, label %36
i32 1, label %39
]
36: ; preds = %34, %34
%37 = load float, float* %11
%38 = fadd float %37, 2.000000e+00
store float %38, float* %11
br label %42
39: ; preds = %34
%40 = load float, float* %11
%41 = fadd float %40, 1.000000e+00
store float %41, float* %11
br label %42
42: ; preds = %34, %39, %36
br label %43
43: ; preds = %47, %42
%44 = load i32, i32* %8
%45 = add nsw i32 %44, -1
store i32 %45, i32* %8
%46 = icmp sge i32 %45, 0
br i1 %46, label %47, label %56
47: ; preds = %43
%48 = load float, float* %11
%49 = fpext float %48 to double
%50 = call i32 (i8*, ...) @a2b(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), double %49)
%51 = load float, float* %11
store float %51, float* %10
%52 = load float, float* %11
%53 = fpext float %52 to double
%54 = fadd double %53, 3.500000e+00
%55 = fptrunc double %54 to float
store float %55, float* %11
br label %43
56: ; preds = %43
br label %57
57: ; preds = %56, %25
%58 = load i32, i32* %5
%59 = icmp slt i32 %58, 1536
br i1 %59, label %60, label %73
60: ; preds = %57
%61 = load i32, i32* %9
%62 = icmp sle i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %60
%64 = call i32 (i8*, ...) @a2b(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 20)
br label %72
65: ; preds = %60
%66 = load i32, i32* %9
%67 = call i32 (i8*, ...) @a2b(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %66, i32 20)
%68 = load float, float* %10
%69 = fcmp olt float %68, 6.000000e+00
br i1 %69, label %70, label %71
70: ; preds = %65
store float 6.000000e+00, float* %10
br label %71
71: ; preds = %70, %65
br label %72
72: ; preds = %71, %63
br label %73
73: ; preds = %72, %57
%74 = load float, float* %10
%75 = fadd float %74, 1.500000e+01
%76 = load float, float* %6
%77 = fmul float %75, %76
%78 = fpext float %77 to double
%79 = call i32 (i8*, ...) @a2b(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), double %78)
ret void
}

LLVM IR (-O2):
%struct.SYMBOL = type { i32 }
@.str = [42 x i8] c"gsave %.2f dup scale 8 3 RM currentpoint \00"
@.str.1 = [3 x i8] c"HD\00"
@.str.2 = [3 x i8] c"Hd\00"
@.str.3 = [3 x i8] c"hd\00"
@.str.4 = [11 x i8] c" %.1f 0 dt\00"
@.str.5 = [7 x i8] c" %d su\00"
@.str.6 = [11 x i8] c" %d %d sfu\00"
@.str.7 = [21 x i8] c" grestore %.1f 0 RM\0A\00"
define void @draw_notempo(%struct.SYMBOL* %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = bitcast i32* %6 to i8*
%10 = fpext float %2 to double
%11 = tail call i32 (i8*, ...) @a2b(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), double %10)
%12 = call i32 @identify_note(%struct.SYMBOL* %0, i32 %1, i32* %4, i32* %5, i32* %6)
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 1
%15 = select i1 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%16 = icmp eq i32 %13, 2
%17 = select i1 %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15
%18 = call i32 (i8*, ...) @a2b(i8* %17)
%19 = load i32, i32* %5
%20 = icmp eq i32 %19, 0
br i1 %20, label %42, label %21
21: ; preds = %3
%22 = load i32, i32* %6
%23 = icmp sgt i32 %22, 0
%24 = select i1 %23, float 1.200000e+01, float 8.000000e+00
%25 = load i32, i32* %4
switch i32 %25, label %30 [
i32 3, label %26
i32 2, label %26
i32 1, label %28
]
26: ; preds = %21, %21
%27 = fadd float %24, 2.000000e+00
br label %30
28: ; preds = %21
%29 = fadd float %24, 1.000000e+00
br label %30
30: ; preds = %21, %28, %26
%31 = phi float [ %24, %21 ], [ %29, %28 ], [ %27, %26 ]
%32 = add nsw i32 %19, -1
store i32 %32, i32* %5
%33 = icmp sgt i32 %19, 0
br i1 %33, label %34, label %42
34: ; preds = %30, %34
%35 = phi float [ %38, %34 ], [ %31, %30 ]
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @a2b(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), double %36)
%38 = fadd float %35, 3.500000e+00
%39 = load i32, i32* %5
%40 = add nsw i32 %39, -1
store i32 %40, i32* %5
%41 = icmp sgt i32 %39, 0
br i1 %41, label %34, label %42
42: ; preds = %34, %30, %3
%43 = phi float [ 4.000000e+00, %3 ], [ 4.000000e+00, %30 ], [ %35, %34 ]
%44 = icmp slt i32 %1, 1536
br i1 %44, label %45, label %54
45: ; preds = %42
%46 = load i32, i32* %6
%47 = icmp slt i32 %46, 1
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 (i8*, ...) @a2b(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 20)
br label %54
50: ; preds = %45
%51 = call i32 (i8*, ...) @a2b(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %46, i32 20)
%52 = fcmp olt float %43, 6.000000e+00
br i1 %52, label %53, label %54
53: ; preds = %50
br label %54
54: ; preds = %48, %53, %50, %42
%55 = phi float [ %43, %48 ], [ 6.000000e+00, %53 ], [ %43, %50 ], [ %43, %42 ]
%56 = fadd float %55, 1.500000e+01
%57 = fmul float %56, %2
%58 = fpext float %57 to double
%59 = call i32 (i8*, ...) @a2b(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), double %58)
ret void
}