#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*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, double *);
int /*<<< orphan*/ xround(double, int);
int main() {
  double num;
  scanf("%lf", &num);
  printf("|%.2lf|\n", xround(num, 2));
  printf("|%.5lf|\n", xround(num, 5));
  printf("|      %.1lf|\n", xround(num, 1));
  printf("|%.1lf      |\n", xround(num, 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <xround@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mov    $0x5,%edi
call   1030 <xround@plt>
mov    %eax,%esi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <xround@plt>
mov    %eax,%esi
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <xround@plt>
mov    %eax,%esi
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1030 <xround@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
mov    $0x5,%edi
call   1030 <xround@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
mov    $0x1,%edi
call   1030 <xround@plt>
lea    0xe86(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
mov    $0x1,%edi
call   1030 <xround@plt>
lea    0xe78(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"|%.2lf|\0A\00"
@.str.2 = [9 x i8] c"|%.5lf|\0A\00"
@.str.3 = [15 x i8] c"| %.1lf|\0A\00"
@.str.4 = [15 x i8] c"|%.1lf |\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = call i32 @xround(double %4, i32 2)
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load double, double* %2
%8 = call i32 @xround(double %7, i32 5)
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load double, double* %2
%11 = call i32 @xround(double %10, i32 1)
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = load double, double* %2
%14 = call i32 @xround(double %13, i32 1)
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"|%.2lf|\0A\00"
@.str.2 = [9 x i8] c"|%.5lf|\0A\00"
@.str.3 = [15 x i8] c"| %.1lf|\0A\00"
@.str.4 = [15 x i8] c"|%.1lf |\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = call i32 @xround(double %4, i32 2)
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load double, double* %1
%8 = call i32 @xround(double %7, i32 5)
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load double, double* %1
%11 = call i32 @xround(double %10, i32 1)
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = load double, double* %1
%14 = call i32 @xround(double %13, i32 1)
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %14)
ret i32 0
}