#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*/ scanf(char *, long double *);
int /*<<< orphan*/ sprintf(char *, char *, long double);
int main() {
  long double X;
  char s[120];
  scanf("%LE", &X);
  sprintf(s, "%LE", X);
  if (s[0] != '-')
    printf("+");
  printf("%.4LE\n", X);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
lea    -0xa0(%rbp),%rdi
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe98(%rip),%rsi
call   1050 <sprintf@plt>
movsbl -0xa0(%rbp),%eax
cmp    $0x2d,%eax
je     118b <main+0x5b>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe6c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xa0,%rsp
lea    0xeb1(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
fldt   0x10(%rsp)
fstpt  (%rsp)
lea    0x20(%rsp),%rdi
mov    %rbx,%rsi
call   1060 <sprintf@plt>
cmpb   $0x2d,0x20(%rsp)
je     1181 <main+0x41>
mov    $0x2b,%edi
call   1030 <putchar@plt>
fldt   0x10(%rsp)
fstpt  (%rsp)
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%LE\00"
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [7 x i8] c"%.4LE\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca x86_fp80
%3 = alloca [120 x i8]
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80* %2)
%5 = getelementptr inbounds [120 x i8], [120 x i8]* %3, i64 0, i64 0
%6 = load x86_fp80, x86_fp80* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80 %6)
%8 = getelementptr inbounds [120 x i8], [120 x i8]* %3, i64 0, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 45
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %0
%15 = load x86_fp80, x86_fp80* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), x86_fp80 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%LE\00"
@.str.2 = [7 x i8] c"%.4LE\0A\00"
define i32 @main() {
%1 = alloca x86_fp80
%2 = alloca [120 x i8]
%3 = bitcast x86_fp80* %1 to i8*
%4 = getelementptr inbounds [120 x i8], [120 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80* %1)
%6 = load x86_fp80, x86_fp80* %1
%7 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80 %6)
%8 = load i8, i8* %4
%9 = icmp eq i8 %8, 45
br i1 %9, label %12, label %10
10: ; preds = %0
%11 = call i32 @putchar(i32 43)
br label %12
12: ; preds = %10, %0
%13 = load x86_fp80, x86_fp80* %1
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), x86_fp80 %13)
ret i32 0
}