#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 *, float);
int /*<<< orphan*/ stdout;
int main() {
  float v = 1.23456e12;
  fprintf(stdout, "%f\n", v);
  fprintf(stdout, "%g\n", v);
  fprintf(stdout, "%e\n", v);
  v = 1.23;
  fprintf(stdout, "%f\n", v);
  fprintf(stdout, "%e\n", v);
  fprintf(stdout, "%g\n", v);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
movss  -0x8(%rbp),%xmm0
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
movss  -0x8(%rbp),%xmm0
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
movss  -0x8(%rbp),%xmm0
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
movss  0xe7e(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
movss  -0x8(%rbp),%xmm0
lea    0xe6c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%edi
movss  -0x8(%rbp),%xmm0
lea    0xe5a(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
movss  -0x8(%rbp),%xmm0
lea    0xe3c(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2ec1(%rip),%rbx
mov    (%rbx),%edi
lea    0xee0(%rip),%r15
movss  0xed0(%rip),%xmm0
mov    %r15,%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xecb(%rip),%r14
mov    %r14,%rsi
movss  0xeb4(%rip),%xmm0
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeb6(%rip),%r12
mov    %r12,%rsi
movss  0xe9b(%rip),%xmm0
call   1030 <fprintf@plt>
mov    (%rbx),%edi
movss  0xe90(%rip),%xmm0
mov    %r15,%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r12,%rsi
movss  0xe7b(%rip),%xmm0
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
movss  0xe69(%rip),%xmm0
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [4 x i8] c"%g\0A\00"
@.str.2 = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0x4271F71820000000, float* %2
%3 = load i32, i32* @stdout
%4 = load float, float* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %4)
%6 = load i32, i32* @stdout
%7 = load float, float* %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %7)
%9 = load i32, i32* @stdout
%10 = load float, float* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %10)
store float 0x3FF3AE1480000000, float* %2
%12 = load i32, i32* @stdout
%13 = load float, float* %2
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %13)
%15 = load i32, i32* @stdout
%16 = load float, float* %2
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %16)
%18 = load i32, i32* @stdout
%19 = load float, float* %2
%20 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %19)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [4 x i8] c"%g\0A\00"
@.str.2 = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x4271F71820000000)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 0x4271F71820000000)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float 0x4271F71820000000)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x3FF3AE1480000000)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float 0x3FF3AE1480000000)
%11 = load i32, i32* @stdout
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 0x3FF3AE1480000000)
ret i32 0
}