#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 */
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, long);
int sscanf(char *, char *, double *);
int /*<<< orphan*/ stdin;
main() {
  char buf[256];
  int count = 0;
  while (fgets(buf, 256, stdin) > 0) {
    double p;
    if (sscanf(buf, "%lf", &p) == 1) {
      p *= 65536 * 16;
      printf("%ld,\n", (long)p);
      count++;
      if (count == 512)
        break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x114(%rbp)
lea    -0x110(%rbp),%rdi
mov    0x2e8e(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
jle    11ee <main+0xbe>
lea    -0x110(%rbp),%rdi
lea    0xe8a(%rip),%rsi
lea    -0x120(%rbp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    11e9 <main+0xb9>
movsd  0xe65(%rip),%xmm0
mulsd  -0x120(%rbp),%xmm0
ff
movsd  %xmm0,-0x120(%rbp)
ff
cvttsd2si -0x120(%rbp),%rsi
ff ff
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
cmpl   $0x200,-0x114(%rbp)
jne    11e4 <main+0xb4>
jmp    11ee <main+0xbe>
jmp    11e9 <main+0xb9>
jmp    114c <main+0x1c>
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    0x2ea0(%rip),%r13
mov    0x0(%r13),%edx
lea    0x10(%rsp),%rdi
mov    $0x100,%esi
call   1040 <fgets@plt>
test   %rax,%rax
jle    11d5 <main+0xa5>
xor    %ebp,%ebp
lea    0xe9f(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%r15
lea    0xe92(%rip),%r12
jmp    1196 <main+0x66>
nopl   0x0(%rax)
mov    0x0(%r13),%edx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <fgets@plt>
test   %rax,%rax
jle    11d5 <main+0xa5>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1180 <main+0x50>
movsd  0x8(%rsp),%xmm0
mulsd  0xe49(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
cvttsd2si %xmm0,%rsi
mov    %r12,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x200,%ebp
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%lf\00"
@.str.1 = [6 x i8] c"%ld,\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i32
%4 = alloca double
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %26, %0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i64 @fgets(i8* %6, i32 256, i32 %7)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %27
10: ; preds = %5
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%12 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %26
14: ; preds = %10
%15 = load double, double* %4
%16 = fmul double %15, 0x4130000000000000
store double %16, double* %4
%17 = load double, double* %4
%18 = fptosi double %17 to i64
%19 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %18)
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 512
br i1 %23, label %24, label %25
24: ; preds = %14
br label %27
25: ; preds = %14
br label %26
26: ; preds = %25, %10
br label %5
27: ; preds = %24, %5
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%lf\00"
@.str.1 = [6 x i8] c"%ld,\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca double
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i64 @fgets(i8* %3, i32 256, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %26
7: ; preds = %0
%8 = bitcast double* %2 to i8*
br label %9
9: ; preds = %7, %21
%10 = phi i32 [ 0, %7 ], [ %22, %21 ]
%11 = call i32 @sscanf(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load double, double* %2
%15 = fmul double %14, 0x4130000000000000
store double %15, double* %2
%16 = fptosi double %15 to i64
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %16)
%18 = add nsw i32 %10, 1
%19 = icmp eq i32 %18, 512
br i1 %19, label %20, label %21
20: ; preds = %13
br label %26
21: ; preds = %9, %13
%22 = phi i32 [ %18, %13 ], [ %10, %9 ]
%23 = load i32, i32* @stdin
%24 = call i64 @fgets(i8* %3, i32 256, i32 %23)
%25 = icmp sgt i64 %24, 0
br i1 %25, label %9, label %26
26: ; preds = %21, %0, %20
ret i32 0
}