#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*/ disp7s(float *, int, int, int, int, int, char, float);
int /*<<< orphan*/ draw_rectangle(float *, int, int, int, int, int, int, float);
int /*<<< orphan*/ sprintf(char *, char *, float);
void dispF(float *sl, int w, int h, int x, int y, int v, float n, char *f,
           float gray) {
  char str[64];
  int i;
  sprintf(str, f, n);
  i = 0;
  while (str[i] != 0) {
    if (str[i] == '-')
      draw_rectangle(sl, w, h, x + i * (v + v / 3 + 1), y - v, v, 1, gray);
    else
      disp7s(sl, w, h, x + i * (v + v / 3 + 1), y, v, str[i] - 48, gray);
    i++;
  }
}


x86 assembly (clang, -O0):
<dispF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
movss  %xmm0,-0x20(%rbp)
movss  %xmm1,-0x24(%rbp)
lea    -0x70(%rbp),%rdi
mov    0x10(%rbp),%rsi
movss  -0x20(%rbp),%xmm0
call   1050 <sprintf@plt>
movl   $0x0,-0x74(%rbp)
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     126f <dispF+0x13f>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x2d,%eax
jne    11fa <dispF+0xca>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x74(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x1c(%rbp),%r8d
mov    -0x1c(%rbp),%eax
mov    $0x3,%r9d
cltd
idiv   %r9d
mov    -0x7c(%rbp),%edx
mov    %eax,%r9d
mov    -0x78(%rbp),%eax
add    %r9d,%r8d
add    $0x1,%r8d
imul   %r8d,%eax
add    %eax,%ecx
mov    -0x18(%rbp),%r8d
sub    -0x1c(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
movss  -0x24(%rbp),%xmm0
movl   $0x1,(%rsp)
call   1030 <draw_rectangle@plt>
jmp    1261 <dispF+0x131>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x74(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x1c(%rbp),%r8d
mov    -0x1c(%rbp),%eax
mov    $0x3,%r9d
cltd
idiv   %r9d
mov    -0x84(%rbp),%edx
mov    %eax,%r9d
mov    -0x80(%rbp),%eax
add    %r9d,%r8d
add    $0x1,%r8d
imul   %r8d,%eax
add    %eax,%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
sub    $0x30,%eax
movss  -0x24(%rbp),%xmm0
movsbl %al,%eax
mov    %eax,(%rsp)
call   1040 <disp7s@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1177 <dispF+0x47>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispF>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
movss  %xmm1,0x18(%rsp)
mov    %r9d,%r15d
mov    %r8d,0x10(%rsp)
mov    %ecx,%ebp
mov    %edx,0x14(%rsp)
mov    %esi,%r13d
mov    %rdi,%rbx
mov    0xa0(%rsp),%rsi
lea    0x20(%rsp),%r14
mov    %r14,%rdi
call   1050 <sprintf@plt>
mov    %r15d,%r12d
movslq %r15d,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rax,%rcx,1),%r15d
add    $0x1,%r15d
mov    0x10(%rsp),%ecx
sub    %eax,%ecx
mov    %ecx,0x1c(%rsp)
jmp    11cd <dispF+0x9d>
nopl   0x0(%rax,%rax,1)
movl   $0x1,(%rsp)
mov    %rbx,%rdi
mov    %r13d,%esi
mov    0x14(%rsp),%edx
mov    %ebp,%ecx
mov    0x1c(%rsp),%r8d
mov    %r12d,%r9d
movss  0x18(%rsp),%xmm0
call   1030 <draw_rectangle@plt>
add    $0x1,%r14
add    %r15d,%ebp
movzbl (%r14),%eax
cmp    $0x2d,%al
je     11a0 <dispF+0x70>
test   %al,%al
je     1202 <dispF+0xd2>
add    $0xd0,%al
movsbl %al,%eax
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    %r13d,%esi
mov    0x14(%rsp),%edx
mov    %ebp,%ecx
mov    0x10(%rsp),%r8d
mov    %r12d,%r9d
movss  0x18(%rsp),%xmm0
call   1040 <disp7s@plt>
jmp    11c6 <dispF+0x96>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @dispF(float* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, float %6, i8* %7, float %8) {
%10 = alloca float*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca float
%17 = alloca i8*
%18 = alloca float
%19 = alloca [64 x i8]
%20 = alloca i32
store float* %0, float** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store float %6, float* %16
store i8* %7, i8** %17
store float %8, float* %18
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %19, i64 0, i64 0
%22 = load i8*, i8** %17
%23 = load float, float* %16
%24 = call i32 @sprintf(i8* %21, i8* %22, float %23)
store i32 0, i32* %20
br label %25
25: ; preds = %82, %9
%26 = load i32, i32* %20
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [64 x i8], [64 x i8]* %19, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %85
32: ; preds = %25
%33 = load i32, i32* %20
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [64 x i8], [64 x i8]* %19, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 45
br i1 %38, label %39, label %58
39: ; preds = %32
%40 = load float*, float** %10
%41 = load i32, i32* %11
%42 = load i32, i32* %12
%43 = load i32, i32* %13
%44 = load i32, i32* %20
%45 = load i32, i32* %15
%46 = load i32, i32* %15
%47 = sdiv i32 %46, 3
%48 = add nsw i32 %45, %47
%49 = add nsw i32 %48, 1
%50 = mul nsw i32 %44, %49
%51 = add nsw i32 %43, %50
%52 = load i32, i32* %14
%53 = load i32, i32* %15
%54 = sub nsw i32 %52, %53
%55 = load i32, i32* %15
%56 = load float, float* %18
%57 = call i32 @draw_rectangle(float* %40, i32 %41, i32 %42, i32 %51, i32 %54, i32 %55, i32 1, float %56)
br label %82
58: ; preds = %32
%59 = load float*, float** %10
%60 = load i32, i32* %11
%61 = load i32, i32* %12
%62 = load i32, i32* %13
%63 = load i32, i32* %20
%64 = load i32, i32* %15
%65 = load i32, i32* %15
%66 = sdiv i32 %65, 3
%67 = add nsw i32 %64, %66
%68 = add nsw i32 %67, 1
%69 = mul nsw i32 %63, %68
%70 = add nsw i32 %62, %69
%71 = load i32, i32* %14
%72 = load i32, i32* %15
%73 = load i32, i32* %20
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [64 x i8], [64 x i8]* %19, i64 0, i64 %74
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = sub nsw i32 %77, 48
%79 = trunc i32 %78 to i8
%80 = load float, float* %18
%81 = call i32 @disp7s(float* %59, i32 %60, i32 %61, i32 %70, i32 %71, i32 %72, i8 signext %79, float %80)
br label %82
82: ; preds = %58, %39
%83 = load i32, i32* %20
%84 = add nsw i32 %83, 1
store i32 %84, i32* %20
br label %25
85: ; preds = %25
ret void
}

LLVM IR (-O2):
define void @dispF(float* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, float %6, i8* nocapture %7, float %8) {
%10 = alloca [64 x i8]
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %10, i64 0, i64 0
%12 = call i32 @sprintf(i8* %11, i8* dereferenceable(1) %7, float %6)
%13 = sdiv i32 %5, 3
%14 = add i32 %5, 1
%15 = add i32 %14, %13
%16 = sub nsw i32 %4, %5
br label %17
17: ; preds = %32, %9
%18 = phi i64 [ %33, %32 ], [ 0, %9 ]
%19 = getelementptr inbounds [64 x i8], [64 x i8]* %10, i64 0, i64 %18
%20 = load i8, i8* %19
switch i8 %20, label %26 [
i8 0, label %34
i8 45, label %21
]
21: ; preds = %17
%22 = trunc i64 %18 to i32
%23 = mul nsw i32 %15, %22
%24 = add nsw i32 %23, %3
%25 = tail call i32 @draw_rectangle(float* %0, i32 %1, i32 %2, i32 %24, i32 %16, i32 %5, i32 1, float %8)
br label %32
26: ; preds = %17
%27 = trunc i64 %18 to i32
%28 = mul nsw i32 %15, %27
%29 = add nsw i32 %28, %3
%30 = add i8 %20, -48
%31 = tail call i32 @disp7s(float* %0, i32 %1, i32 %2, i32 %29, i32 %4, i32 %5, i8 signext %30, float %8)
br label %32
32: ; preds = %26, %21
%33 = add nuw i64 %18, 1
br label %17
34: ; preds = %17
ret void
}