#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*/ fprintf(int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void printdata(size_t *d, size_t t) {
  size_t i;
  double n;
  for (i = 0; i < 4; i++)
    if ((d[i] == 0) || (t == 0))
      fputs("   ", stdout);
    else {
      n = ((double)d[i] / (double)t) * 100.0;
      if (n <= 0.5)
        fputs("  .", stdout);
      else if (n >= 99.5)
        fputs(" %%", stdout);
      else
        fprintf(stdout, " %2.0f", n);
    }
}


x86 assembly (clang, -O0):
<printdata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x4,-0x18(%rbp)
jae    126f <printdata+0x14f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1161 <printdata+0x41>
cmpq   $0x0,-0x10(%rbp)
jne    117b <printdata+0x5b>
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
jmp    1259 <printdata+0x139>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movq   (%rax,%rcx,8),%xmm0
movaps 0xe91(%rip),%xmm3
punpckldq %xmm3,%xmm0
movapd 0xe95(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x10(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xe3a(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe21(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1204 <printdata+0xe4>
mov    0x2def(%rip),%rax
mov    (%rax),%esi
lea    0xe4a(%rip),%rdi
call   1030 <fputs@plt>
jmp    1254 <printdata+0x134>
movsd  -0x20(%rbp),%xmm0
movsd  0xdff(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1235 <printdata+0x115>
mov    0x2dbe(%rip),%rax
mov    (%rax),%esi
lea    0xe1d(%rip),%rdi
call   1030 <fputs@plt>
jmp    124f <printdata+0x12f>
mov    0x2da4(%rip),%rax
mov    (%rax),%edi
movsd  -0x20(%rbp),%xmm0
lea    0xe02(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1254 <printdata+0x134>
jmp    1259 <printdata+0x139>
jmp    125e <printdata+0x13e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <printdata+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printdata>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
movq   %rsi,%xmm0
punpckldq 0xec9(%rip),%xmm0
subpd  0xed1(%rip),%xmm0
mov    %rdi,%r14
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
test   %rsi,%rsi
je     11c7 <printdata+0xa7>
mov    (%r14),%rax
test   %rax,%rax
je     11c7 <printdata+0xa7>
movq   %rax,%xmm1
punpckldq 0xe93(%rip),%xmm1
subpd  0xe9b(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
divsd  (%rsp),%xmm0
mulsd  0xe92(%rip),%xmm0
movsd  0xe92(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    11d9 <printdata+0xb9>
ucomisd 0xe8c(%rip),%xmm0
mov    0x2e35(%rip),%rax
mov    (%rax),%eax
jae    11eb <printdata+0xcb>
lea    0xe8e(%rip),%rsi
mov    %eax,%edi
call   1040 <fprintf@plt>
test   %rbx,%rbx
jne    11fe <printdata+0xde>
jmp    126e <printdata+0x14e>
mov    0x2e12(%rip),%rax
mov    (%rax),%esi
lea    0xe61(%rip),%rdi
jmp    11f4 <printdata+0xd4>
mov    0x2e00(%rip),%rax
mov    (%rax),%esi
lea    0xe53(%rip),%rdi
jmp    11f4 <printdata+0xd4>
lea    0xe4e(%rip),%rdi
mov    %eax,%esi
call   1030 <fputs@plt>
test   %rbx,%rbx
je     126e <printdata+0x14e>
mov    0x8(%r14),%rax
test   %rax,%rax
je     126e <printdata+0x14e>
movq   %rax,%xmm1
punpckldq 0xdec(%rip),%xmm1
subpd  0xdf4(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
divsd  (%rsp),%xmm0
mulsd  0xdeb(%rip),%xmm0
movsd  0xdeb(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1280 <printdata+0x160>
ucomisd 0xde5(%rip),%xmm0
mov    0x2d8e(%rip),%rax
mov    (%rax),%eax
jae    1292 <printdata+0x172>
lea    0xde7(%rip),%rsi
mov    %eax,%edi
call   1040 <fprintf@plt>
test   %rbx,%rbx
jne    12a5 <printdata+0x185>
jmp    1315 <printdata+0x1f5>
mov    0x2d6b(%rip),%rax
mov    (%rax),%esi
lea    0xdba(%rip),%rdi
jmp    129b <printdata+0x17b>
mov    0x2d59(%rip),%rax
mov    (%rax),%esi
lea    0xdac(%rip),%rdi
jmp    129b <printdata+0x17b>
lea    0xda7(%rip),%rdi
mov    %eax,%esi
call   1030 <fputs@plt>
test   %rbx,%rbx
je     1315 <printdata+0x1f5>
mov    0x10(%r14),%rax
test   %rax,%rax
je     1315 <printdata+0x1f5>
movq   %rax,%xmm1
punpckldq 0xd45(%rip),%xmm1
subpd  0xd4d(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
divsd  (%rsp),%xmm0
mulsd  0xd44(%rip),%xmm0
movsd  0xd44(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1327 <printdata+0x207>
ucomisd 0xd3e(%rip),%xmm0
mov    0x2ce7(%rip),%rax
mov    (%rax),%eax
jae    1339 <printdata+0x219>
lea    0xd40(%rip),%rsi
mov    %eax,%edi
call   1040 <fprintf@plt>
test   %rbx,%rbx
jne    134c <printdata+0x22c>
jmp    13b9 <printdata+0x299>
mov    0x2cc4(%rip),%rax
mov    (%rax),%esi
lea    0xd13(%rip),%rdi
jmp    1342 <printdata+0x222>
mov    0x2cb2(%rip),%rax
mov    (%rax),%esi
lea    0xd05(%rip),%rdi
jmp    1342 <printdata+0x222>
lea    0xd00(%rip),%rdi
mov    %eax,%esi
call   1030 <fputs@plt>
test   %rbx,%rbx
je     13b9 <printdata+0x299>
mov    0x18(%r14),%rax
test   %rax,%rax
je     13b9 <printdata+0x299>
movq   %rax,%xmm1
punpckldq 0xc9e(%rip),%xmm1
subpd  0xca6(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
divsd  (%rsp),%xmm0
mulsd  0xc9d(%rip),%xmm0
movsd  0xc9d(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    13cb <printdata+0x2ab>
ucomisd 0xc97(%rip),%xmm0
mov    0x2c40(%rip),%rax
mov    (%rax),%eax
jae    13dd <printdata+0x2bd>
lea    0xc99(%rip),%rsi
mov    %eax,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fprintf@plt>
mov    0x2c20(%rip),%rax
mov    (%rax),%esi
lea    0xc6f(%rip),%rdi
jmp    13e6 <printdata+0x2c6>
mov    0x2c0e(%rip),%rax
mov    (%rax),%esi
lea    0xc61(%rip),%rdi
jmp    13e6 <printdata+0x2c6>
lea    0xc5c(%rip),%rdi
mov    %eax,%esi
add    $0x18,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" \00"
@stdout = global i32 0
@.str.1 = [4 x i8] c" .\00"
@.str.2 = [4 x i8] c" %%\00"
@.str.3 = [7 x i8] c" %2.0f\00"
define void @printdata(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
%6 = alloca double
store i64* %0, i64** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %7
7: ; preds = %50, %2
%8 = load i64, i64* %5
%9 = icmp ult i64 %8, 4
br i1 %9, label %10, label %53
10: ; preds = %7
%11 = load i64*, i64** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i64, i64* %11, i64 %12
%14 = load i64, i64* %13
%15 = icmp eq i64 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %10
%17 = load i64, i64* %4
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16, %10
%20 = load i32, i32* @stdout
%21 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
br label %49
22: ; preds = %16
%23 = load i64*, i64** %3
%24 = load i64, i64* %5
%25 = getelementptr inbounds i64, i64* %23, i64 %24
%26 = load i64, i64* %25
%27 = uitofp i64 %26 to double
%28 = load i64, i64* %4
%29 = uitofp i64 %28 to double
%30 = fdiv double %27, %29
%31 = fmul double %30, 1.000000e+02
store double %31, double* %6
%32 = load double, double* %6
%33 = fcmp ole double %32, 5.000000e-01
br i1 %33, label %34, label %37
34: ; preds = %22
%35 = load i32, i32* @stdout
%36 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %35)
br label %48
37: ; preds = %22
%38 = load double, double* %6
%39 = fcmp oge double %38, 9.950000e+01
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = load i32, i32* @stdout
%42 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %41)
br label %47
43: ; preds = %37
%44 = load i32, i32* @stdout
%45 = load double, double* %6
%46 = call i32 @fprintf(i32 %44, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %45)
br label %47
47: ; preds = %43, %40
br label %48
48: ; preds = %47, %34
br label %49
49: ; preds = %48, %19
br label %50
50: ; preds = %49
%51 = load i64, i64* %5
%52 = add i64 %51, 1
store i64 %52, i64* %5
br label %7
53: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
@stdout = global i32 0
@.str.1 = [4 x i8] c" .\00"
@.str.2 = [4 x i8] c" %%\00"
@.str.3 = [7 x i8] c" %2.0f\00"
define void @printdata(i64* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = uitofp i64 %1 to double
%5 = load i64, i64* %0
%6 = icmp eq i64 %5, 0
%7 = or i1 %3, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stdout
%10 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %26
11: ; preds = %2
%12 = uitofp i64 %5 to double
%13 = fdiv double %12, %4
%14 = fmul double %13, 1.000000e+02
%15 = fcmp ugt double %14, 5.000000e-01
br i1 %15, label %19, label %16
16: ; preds = %11
%17 = load i32, i32* @stdout
%18 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %26
19: ; preds = %11
%20 = fcmp ult double %14, 9.950000e+01
%21 = load i32, i32* @stdout
br i1 %20, label %24, label %22
22: ; preds = %19
%23 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %21)
br label %26
24: ; preds = %19
%25 = tail call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %14)
br label %26
26: ; preds = %8, %22, %24, %16
%27 = getelementptr inbounds i64, i64* %0, i64 1
%28 = load i64, i64* %27
%29 = icmp eq i64 %28, 0
%30 = or i1 %3, %29
br i1 %30, label %46, label %31
31: ; preds = %26
%32 = uitofp i64 %28 to double
%33 = fdiv double %32, %4
%34 = fmul double %33, 1.000000e+02
%35 = fcmp ugt double %34, 5.000000e-01
br i1 %35, label %39, label %36
36: ; preds = %31
%37 = load i32, i32* @stdout
%38 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
br label %49
39: ; preds = %31
%40 = fcmp ult double %34, 9.950000e+01
%41 = load i32, i32* @stdout
br i1 %40, label %44, label %42
42: ; preds = %39
%43 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %41)
br label %49
44: ; preds = %39
%45 = tail call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %34)
br label %49
46: ; preds = %26
%47 = load i32, i32* @stdout
%48 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %47)
br label %49
49: ; preds = %46, %44, %42, %36
%50 = getelementptr inbounds i64, i64* %0, i64 2
%51 = load i64, i64* %50
%52 = icmp eq i64 %51, 0
%53 = or i1 %3, %52
br i1 %53, label %69, label %54
54: ; preds = %49
%55 = uitofp i64 %51 to double
%56 = fdiv double %55, %4
%57 = fmul double %56, 1.000000e+02
%58 = fcmp ugt double %57, 5.000000e-01
br i1 %58, label %62, label %59
59: ; preds = %54
%60 = load i32, i32* @stdout
%61 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %60)
br label %72
62: ; preds = %54
%63 = fcmp ult double %57, 9.950000e+01
%64 = load i32, i32* @stdout
br i1 %63, label %67, label %65
65: ; preds = %62
%66 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %64)
br label %72
67: ; preds = %62
%68 = tail call i32 @fprintf(i32 %64, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %57)
br label %72
69: ; preds = %49
%70 = load i32, i32* @stdout
%71 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %70)
br label %72
72: ; preds = %69, %67, %65, %59
%73 = getelementptr inbounds i64, i64* %0, i64 3
%74 = load i64, i64* %73
%75 = icmp eq i64 %74, 0
%76 = or i1 %3, %75
br i1 %76, label %92, label %77
77: ; preds = %72
%78 = uitofp i64 %74 to double
%79 = fdiv double %78, %4
%80 = fmul double %79, 1.000000e+02
%81 = fcmp ugt double %80, 5.000000e-01
br i1 %81, label %85, label %82
82: ; preds = %77
%83 = load i32, i32* @stdout
%84 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %83)
br label %95
85: ; preds = %77
%86 = fcmp ult double %80, 9.950000e+01
%87 = load i32, i32* @stdout
br i1 %86, label %90, label %88
88: ; preds = %85
%89 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %87)
br label %95
90: ; preds = %85
%91 = tail call i32 @fprintf(i32 %87, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %80)
br label %95
92: ; preds = %72
%93 = load i32, i32* @stdout
%94 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %93)
br label %95
95: ; preds = %92, %90, %88, %82
ret void
}