#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 *, float, float, ...);
int /*<<< orphan*/ puts(char *);
int main() {
  float var = 6.27E-4;
  puts("Base 10");
  printf("I must deliver %d pods to %d locations\r\n\n", 50, 0xBA3C);
  puts("Base 16");
  printf("I must deliver 0x%x pods to 0x%X locations\n\n", 50, 0xBA3C);
  puts("Base 8");
  printf("I must deliver %o pods to %o locations\n\n", 50, 0xBA3C);
  puts("Scientific representation");
  printf("I must deliver %E pods to %E locations\n", (float)50, (float)0xBA3C);
  printf("I must deliver %G pods to %g locations\n\n", (float)50,
         (float)0xBA3C);
  printf("\t\*Test for scientific to integer (e=g=f=d)\n\t  float var = "
         "6.27E-4 = \t%e = %g , %f , %d",
         var, var, var, var);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
movss  0xea9(%rip),%xmm0
movss  0xea5(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
movss  0xe7f(%rip),%xmm0
movss  0xe7b(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
movss  0xe55(%rip),%xmm0
movss  0xe51(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
movss  0xe2b(%rip),%xmm0
movss  0xe27(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xefa(%rip),%rdi
movss  0xe0d(%rip),%xmm0
movss  0xe09(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x8(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xee9(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
movss  0xec4(%rip),%xmm0
movss  0xec0(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
movss  0xe9a(%rip),%xmm0
movss  0xe96(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
movss  0xe70(%rip),%xmm0
movss  0xe6c(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
movss  0xe46(%rip),%xmm0
movss  0xe42(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xf21(%rip),%rdi
movss  0xe28(%rip),%xmm0
movss  0xe24(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xf2c(%rip),%rdi
movss  0xe12(%rip),%xmm0
movsd  0xe12(%rip),%xmm2
movaps %xmm0,%xmm1
movaps %xmm2,%xmm3
mov    $0x4,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Base 10\00"
@.str.1 = [42 x i8] c"I must deliver %d pods to %d locations\0D\0A\0A\00"
@.str.2 = [8 x i8] c"Base 16\00"
@.str.3 = [45 x i8] c"I must deliver 0x%x pods to 0x%X locations\0A\0A\00"
@.str.4 = [7 x i8] c"Base 8\00"
@.str.5 = [41 x i8] c"I must deliver %o pods to %o locations\0A\0A\00"
@.str.6 = [26 x i8] c"Scientific representation\00"
@.str.7 = [40 x i8] c"I must deliver %E pods to %E locations\0A\00"
@.str.8 = [41 x i8] c"I must deliver %G pods to %g locations\0A\0A\00"
@.str.9 = [87 x i8] c"\09*Test for scientific to integer (e=g=f=d)\0A\09 float var = 6.27E-4 = \09%e = %g , %f , %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0x3F448BA840000000, float* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), float 5.000000e+01, float 4.767600e+04)
%5 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), float 5.000000e+01, float 4.767600e+04)
%7 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), float 5.000000e+01, float 4.767600e+04)
%9 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0), float 5.000000e+01, float 4.767600e+04)
%11 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), float 5.000000e+01, float 4.767600e+04)
%12 = load float, float* %2
%13 = load float, float* %2
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = load float, float* %2
%17 = fpext float %16 to double
%18 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.9, i64 0, i64 0), float %12, float %13, double %15, double %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Base 10\00"
@.str.1 = [42 x i8] c"I must deliver %d pods to %d locations\0D\0A\0A\00"
@.str.2 = [8 x i8] c"Base 16\00"
@.str.3 = [45 x i8] c"I must deliver 0x%x pods to 0x%X locations\0A\0A\00"
@.str.4 = [7 x i8] c"Base 8\00"
@.str.5 = [41 x i8] c"I must deliver %o pods to %o locations\0A\0A\00"
@.str.6 = [26 x i8] c"Scientific representation\00"
@.str.7 = [40 x i8] c"I must deliver %E pods to %E locations\0A\00"
@.str.8 = [41 x i8] c"I must deliver %G pods to %g locations\0A\0A\00"
@.str.9 = [87 x i8] c"\09*Test for scientific to integer (e=g=f=d)\0A\09 float var = 6.27E-4 = \09%e = %g , %f , %d\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), float 5.000000e+01, float 4.767600e+04)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), float 5.000000e+01, float 4.767600e+04)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), float 5.000000e+01, float 4.767600e+04)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%8 = tail call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0), float 5.000000e+01, float 4.767600e+04)
%9 = tail call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), float 5.000000e+01, float 4.767600e+04)
%10 = tail call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.9, i64 0, i64 0), float 0x3F448BA840000000, float 0x3F448BA840000000, double 0x3F448BA840000000, double 0x3F448BA840000000)
ret i32 0
}