#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*/ cprint(int, int, char *);
int /*<<< orphan*/ dprint(int, int, float, int, int);
void print_cpu_line(float dram_freq, float fsb_freq, int ram_type) {
  int cur_col = 41;
  cprint(7, cur_col, "RAM:                                ");
  cur_col += 5;
  dprint(7, cur_col, dram_freq, 4, 1);
  cur_col += 4;
  cprint(7, cur_col, "MHz (");
  cur_col += 5;
  switch (ram_type) {
  default:
  case 1:
    cprint(7, cur_col, "DDR-");
    cur_col += 4;
    break;
  case 2:
    cprint(7, cur_col, "DDR2-");
    cur_col += 5;
    break;
  case 3:
    cprint(7, cur_col, "DDR3-");
    cur_col += 5;
    break;
  }
  if (dram_freq < 500) {
    dprint(7, cur_col, dram_freq * 2, 3, 0);
    cur_col += 3;
  } else {
    dprint(7, cur_col, dram_freq * 2, 4, 0);
    cur_col += 4;
  }
  cprint(7, cur_col, ")");
  cur_col++;
  if (fsb_freq > 10) {
    cprint(7, cur_col, " - BCLK: ");
    cur_col += 9;
    dprint(7, cur_col, fsb_freq, 3, 0);
  }
}


x86 assembly (clang, -O0):
<print_cpu_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movl   $0x29,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec6(%rip),%rdx
mov    $0x7,%edi
mov    %edi,-0x18(%rbp)
call   1030 <cprint@plt>
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
movss  -0x4(%rbp),%xmm0
mov    $0x4,%edx
mov    $0x1,%ecx
call   1040 <dprint@plt>
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea5(%rip),%rdx
call   1030 <cprint@plt>
mov    -0x10(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     11d5 <print_cpu_line+0xb5>
jmp    11ae <print_cpu_line+0x8e>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     11f7 <print_cpu_line+0xd7>
jmp    11bf <print_cpu_line+0x9f>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
je     1219 <print_cpu_line+0xf9>
jmp    11d0 <print_cpu_line+0xb0>
jmp    11d5 <print_cpu_line+0xb5>
mov    -0x10(%rbp),%esi
mov    $0x7,%edi
lea    0xe53(%rip),%rdx
call   1030 <cprint@plt>
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
jmp    1236 <print_cpu_line+0x116>
mov    -0x10(%rbp),%esi
mov    $0x7,%edi
lea    0xe36(%rip),%rdx
call   1030 <cprint@plt>
mov    -0x10(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x10(%rbp)
jmp    1236 <print_cpu_line+0x116>
mov    -0x10(%rbp),%esi
mov    $0x7,%edi
lea    0xe1a(%rip),%rdx
call   1030 <cprint@plt>
mov    -0x10(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x10(%rbp)
movss  0xdc2(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1277 <print_cpu_line+0x157>
mov    -0x10(%rbp),%esi
movss  0xdb1(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mov    $0x7,%edi
mov    $0x3,%edx
xor    %ecx,%ecx
call   1040 <dprint@plt>
mov    -0x10(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x10(%rbp)
jmp    12a1 <print_cpu_line+0x181>
mov    -0x10(%rbp),%esi
movss  0xd82(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mov    $0x7,%edi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <dprint@plt>
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    $0x7,%edi
lea    0xd98(%rip),%rdx
call   1030 <cprint@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xd3d(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    130a <print_cpu_line+0x1ea>
mov    -0x10(%rbp),%esi
mov    $0x7,%edi
lea    0xd67(%rip),%rdx
call   1030 <cprint@plt>
mov    -0x10(%rbp),%eax
add    $0x9,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
movss  -0x8(%rbp),%xmm0
mov    $0x7,%edi
mov    $0x3,%edx
xor    %ecx,%ecx
call   1040 <dprint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cpu_line>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
lea    0xed0(%rip),%rdx
mov    $0x7,%edi
mov    $0x29,%esi
call   1030 <cprint@plt>
mov    $0x7,%edi
mov    $0x2e,%esi
movss  0x4(%rsp),%xmm0
mov    $0x4,%edx
mov    $0x1,%ecx
call   1040 <dprint@plt>
lea    0xec0(%rip),%rdx
mov    $0x7,%edi
mov    $0x32,%esi
call   1030 <cprint@plt>
cmp    $0x3,%ebx
je     1195 <print_cpu_line+0x75>
cmp    $0x2,%ebx
jne    11a4 <print_cpu_line+0x84>
mov    $0x3c,%r14d
lea    0xea5(%rip),%rdx
jmp    11b1 <print_cpu_line+0x91>
mov    $0x3c,%r14d
lea    0xe9c(%rip),%rdx
jmp    11b1 <print_cpu_line+0x91>
mov    $0x3b,%r14d
lea    0xe82(%rip),%rdx
mov    $0x7,%edi
mov    $0x37,%esi
call   1030 <cprint@plt>
movss  0xe38(%rip),%xmm1
xor    %ebx,%ebx
movss  0x4(%rsp),%xmm0
ucomiss %xmm0,%xmm1
seta   %bl
mov    $0x4,%edx
sub    %ebx,%edx
addss  %xmm0,%xmm0
mov    $0x7,%edi
mov    %r14d,%esi
xor    %ecx,%ecx
call   1040 <dprint@plt>
neg    %ebx
add    %r14d,%ebx
add    $0x4,%ebx
lea    0xe45(%rip),%rdx
mov    $0x7,%edi
mov    %ebx,%esi
call   1030 <cprint@plt>
movss  (%rsp),%xmm0
ucomiss 0xded(%rip),%xmm0
jbe    124f <print_cpu_line+0x12f>
lea    0x1(%rbx),%esi
lea    0xe23(%rip),%rdx
mov    $0x7,%edi
call   1030 <cprint@plt>
add    $0xa,%ebx
mov    $0x7,%edi
mov    %ebx,%esi
movss  (%rsp),%xmm0
mov    $0x3,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <dprint@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [37 x i8] c"RAM: \00"
@.str.1 = [6 x i8] c"MHz (\00"
@.str.2 = [5 x i8] c"DDR-\00"
@.str.3 = [6 x i8] c"DDR2-\00"
@.str.4 = [6 x i8] c"DDR3-\00"
@.str.5 = [2 x i8] c")\00"
@.str.6 = [10 x i8] c" - BCLK: \00"
define void @print_cpu_line(float %0, float %1, i32 %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
store float %0, float* %4
store float %1, float* %5
store i32 %2, i32* %6
store i32 41, i32* %7
%8 = load i32, i32* %7
%9 = call i32 @cprint(i32 7, i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %7
%11 = add nsw i32 %10, 5
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load float, float* %4
%14 = call i32 @dprint(i32 7, i32 %12, float %13, i32 4, i32 1)
%15 = load i32, i32* %7
%16 = add nsw i32 %15, 4
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = call i32 @cprint(i32 7, i32 %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* %7
%20 = add nsw i32 %19, 5
store i32 %20, i32* %7
%21 = load i32, i32* %6
switch i32 %21, label %22 [
i32 1, label %23
i32 2, label %28
i32 3, label %33
]
22: ; preds = %3
br label %23
23: ; preds = %3, %22
%24 = load i32, i32* %7
%25 = call i32 @cprint(i32 7, i32 %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 4
store i32 %27, i32* %7
br label %38
28: ; preds = %3
%29 = load i32, i32* %7
%30 = call i32 @cprint(i32 7, i32 %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 5
store i32 %32, i32* %7
br label %38
33: ; preds = %3
%34 = load i32, i32* %7
%35 = call i32 @cprint(i32 7, i32 %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 5
store i32 %37, i32* %7
br label %38
38: ; preds = %33, %28, %23
%39 = load float, float* %4
%40 = fcmp olt float %39, 5.000000e+02
br i1 %40, label %41, label %48
41: ; preds = %38
%42 = load i32, i32* %7
%43 = load float, float* %4
%44 = fmul float %43, 2.000000e+00
%45 = call i32 @dprint(i32 7, i32 %42, float %44, i32 3, i32 0)
%46 = load i32, i32* %7
%47 = add nsw i32 %46, 3
store i32 %47, i32* %7
br label %55
48: ; preds = %38
%49 = load i32, i32* %7
%50 = load float, float* %4
%51 = fmul float %50, 2.000000e+00
%52 = call i32 @dprint(i32 7, i32 %49, float %51, i32 4, i32 0)
%53 = load i32, i32* %7
%54 = add nsw i32 %53, 4
store i32 %54, i32* %7
br label %55
55: ; preds = %48, %41
%56 = load i32, i32* %7
%57 = call i32 @cprint(i32 7, i32 %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
store i32 %59, i32* %7
%60 = load float, float* %5
%61 = fcmp ogt float %60, 1.000000e+01
br i1 %61, label %62, label %70
62: ; preds = %55
%63 = load i32, i32* %7
%64 = call i32 @cprint(i32 7, i32 %63, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%65 = load i32, i32* %7
%66 = add nsw i32 %65, 9
store i32 %66, i32* %7
%67 = load i32, i32* %7
%68 = load float, float* %5
%69 = call i32 @dprint(i32 7, i32 %67, float %68, i32 3, i32 0)
br label %70
70: ; preds = %62, %55
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"RAM: \00"
@.str.1 = [6 x i8] c"MHz (\00"
@.str.2 = [5 x i8] c"DDR-\00"
@.str.3 = [6 x i8] c"DDR2-\00"
@.str.4 = [6 x i8] c"DDR3-\00"
@.str.5 = [2 x i8] c")\00"
@.str.6 = [10 x i8] c" - BCLK: \00"
define void @print_cpu_line(float %0, float %1, i32 %2) {
%4 = tail call i32 @cprint(i32 7, i32 41, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @dprint(i32 7, i32 46, float %0, i32 4, i32 1)
%6 = tail call i32 @cprint(i32 7, i32 50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
switch i32 %2, label %9 [
i32 3, label %8
i32 2, label %7
]
7: ; preds = %3
br label %9
8: ; preds = %3
br label %9
9: ; preds = %3, %8, %7
%10 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %8 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %7 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %3 ]
%11 = phi i32 [ 60, %8 ], [ 60, %7 ], [ 59, %3 ]
%12 = tail call i32 @cprint(i32 7, i32 55, i8* %10)
%13 = fcmp olt float %0, 5.000000e+02
%14 = select i1 %13, i32 3, i32 4
%15 = fmul float %0, 2.000000e+00
%16 = tail call i32 @dprint(i32 7, i32 %11, float %15, i32 %14, i32 0)
%17 = add nuw nsw i32 %11, %14
%18 = tail call i32 @cprint(i32 7, i32 %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%19 = fcmp ogt float %1, 1.000000e+01
br i1 %19, label %20, label %25
20: ; preds = %9
%21 = add nuw nsw i32 %17, 1
%22 = tail call i32 @cprint(i32 7, i32 %21, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%23 = add nuw nsw i32 %17, 10
%24 = tail call i32 @dprint(i32 7, i32 %23, float %1, i32 3, i32 0)
br label %25
25: ; preds = %20, %9
ret void
}