#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 main(void) {
  int i = 873;
  double f = 123.94536;
  char s[] = "Happy Birthday";
  printf("Using precision for integers\n");
  printf("\t%.4d\n\t%.9d\n\n", i, i);
  printf("Using precision for floating-point numbers\n");
  printf("\t%.3f\n\t%.3e\n\t%.3g\n\n", f, f, f);
  printf("Using precision for strings\n");
  printf("\t%.11s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x369,-0x8(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xec6(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xebe(%rip),%al
mov    %al,-0x11(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
lea    0xece(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1f(%rbp),%rsi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x79616468747269,%rax
mov    %rax,0xf(%rsp)
movabs $0x6942207970706148,%rax
20 42 69
mov    %rax,0x8(%rsp)
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec2(%rip),%rdi
mov    $0x369,%esi
mov    $0x369,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
movsd  0xe7f(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
mov    $0x3,%al
call   1040 <printf@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [15 x i8] c"Happy Birthday\00"
@.str = [30 x i8] c"Using precision for integers\0A\00"
@.str.1 = [14 x i8] c"\09%.4d\0A\09%.9d\0A\0A\00"
@.str.2 = [44 x i8] c"Using precision for floating-point numbers\0A\00"
@.str.3 = [20 x i8] c"\09%.3f\0A\09%.3e\0A\09%.3g\0A\0A\00"
@.str.4 = [29 x i8] c"Using precision for strings\0A\00"
@.str.5 = [8 x i8] c"\09%.11s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca [15 x i8]
store i32 0, i32* %1
store i32 873, i32* %2
store double 0x405EFC80C73ABC94, double* %3
%5 = bitcast [15 x i8]* %4 to i8*
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%11 = load double, double* %3
%12 = load double, double* %3
%13 = load double, double* %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double %11, double %12, double %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%16 = getelementptr inbounds [15 x i8], [15 x i8]* %4, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [15 x i8] c"Happy Birthday\00"
@.str.1 = [14 x i8] c"\09%.4d\0A\09%.9d\0A\0A\00"
@.str.3 = [20 x i8] c"\09%.3f\0A\09%.3e\0A\09%.3g\0A\0A\00"
@.str.5 = [8 x i8] c"\09%.11s\0A\00"
@str = [29 x i8] c"Using precision for integers\00"
@str.6 = [43 x i8] c"Using precision for floating-point numbers\00"
@str.7 = [28 x i8] c"Using precision for strings\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 873, i32 873)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.6, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double 0x405EFC80C73ABC94, double 0x405EFC80C73ABC94, double 0x405EFC80C73ABC94)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.7, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %2)
ret i32 0
}