#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) {
  printf("Quamtity\tCost\tTotal\n");
  printf("%d\t\t$%.2f\t$%.2f\n", 3, 9.99, 29.97);
  printf("Too many spaces          \b\b\b\b\b\b\b\b\b can be fixed ");
  printf("with the \\%c Escape character\n", 'b');
  printf("\n\a\n\a\n\a\nSkip a few lines and beep ");
  printf("a few beeps.\n");
  printf("%s %c.", "You are kicking butt learning", 'C');
  printf("\n You just finished chapter %d. \nYou have finished ", 4);
  printf("%.1f%c of the book.\n", 12.500, '%');
  printf("\n\nOne third equals %.2f or ", 0.333333);
  printf("%.3f or %.4f or ", 0.333333, 0.333333);
  printf("%.5f or %.6f\n\n\n", 0.33333, 0.3333333);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf11(%rip),%rdi
mov    $0x3,%esi
movsd  0xedf(%rip),%xmm0
movsd  0xedf(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf22(%rip),%rdi
mov    $0x62,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf42(%rip),%rdi
lea    0xf42(%rip),%rsi
mov    $0x43,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4d(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf6e(%rip),%rdi
movsd  0xe4f(%rip),%xmm0
mov    $0x25,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf68(%rip),%rdi
movsd  0xe2c(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf6e(%rip),%rdi
movsd  0xe16(%rip),%xmm1
movaps %xmm1,%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xf66(%rip),%rdi
movsd  0xded(%rip),%xmm0
movsd  0xded(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x1036(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
movsd  0xec4(%rip),%xmm0
movsd  0xec4(%rip),%xmm1
mov    $0x3,%esi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xeea(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf0d(%rip),%rdi
mov    $0x62,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf19(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xfec(%rip),%rdi
call   1030 <puts@plt>
lea    0xf21(%rip),%rdi
lea    0xf21(%rip),%rsi
mov    $0x43,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf2c(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf4d(%rip),%rdi
movsd  0xe49(%rip),%xmm0
mov    $0x25,%esi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xf47(%rip),%rdi
movsd  0xe36(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xf4d(%rip),%rdi
movsd  0xe20(%rip),%xmm0
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xf45(%rip),%rdi
movsd  0xe0f(%rip),%xmm0
movsd  0xe0f(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Quamtity\09Cost\09Total\0A\00"
@.str.1 = [17 x i8] c"%d\09\09$%.2f\09$%.2f\0A\00"
@.str.2 = [49 x i8] c"Too many spaces \08\08\08\08\08\08\08\08\08 can be fixed \00"
@.str.3 = [31 x i8] c"with the \\%c Escape character\0A\00"
@.str.4 = [34 x i8] c"\0A\07\0A\07\0A\07\0ASkip a few lines and beep \00"
@.str.5 = [14 x i8] c"a few beeps.\0A\00"
@.str.6 = [7 x i8] c"%s %c.\00"
@.str.7 = [30 x i8] c"You are kicking butt learning\00"
@.str.8 = [52 x i8] c"\0A You just finished chapter %d. \0AYou have finished \00"
@.str.9 = [21 x i8] c"%.1f%c of the book.\0A\00"
@.str.10 = [28 x i8] c"\0A\0AOne third equals %.2f or \00"
@.str.11 = [17 x i8] c"%.3f or %.4f or \00"
@.str.12 = [16 x i8] c"%.5f or %.6f\0A\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 3, double 9.990000e+00, double 2.997000e+01)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 98)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 67)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.8, i64 0, i64 0), i32 4)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), double 1.250000e+01, i32 37)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), double 3.333330e-01)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), double 3.333330e-01, double 3.333330e-01)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), double 3.333300e-01, double 0x3FD55555318ABC87)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"%d\09\09$%.2f\09$%.2f\0A\00"
@.str.2 = [49 x i8] c"Too many spaces \08\08\08\08\08\08\08\08\08 can be fixed \00"
@.str.3 = [31 x i8] c"with the \\%c Escape character\0A\00"
@.str.4 = [34 x i8] c"\0A\07\0A\07\0A\07\0ASkip a few lines and beep \00"
@.str.6 = [7 x i8] c"%s %c.\00"
@.str.7 = [30 x i8] c"You are kicking butt learning\00"
@.str.8 = [52 x i8] c"\0A You just finished chapter %d. \0AYou have finished \00"
@.str.9 = [21 x i8] c"%.1f%c of the book.\0A\00"
@.str.10 = [28 x i8] c"\0A\0AOne third equals %.2f or \00"
@.str.11 = [17 x i8] c"%.3f or %.4f or \00"
@.str.12 = [16 x i8] c"%.5f or %.6f\0A\0A\0A\00"
@str = [20 x i8] c"Quamtity\09Cost\09Total\00"
@str.13 = [13 x i8] c"a few beeps.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 3, double 9.990000e+00, double 2.997000e+01)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 98)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.13, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 67)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.8, i64 0, i64 0), i32 4)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), double 1.250000e+01, i32 37)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), double 3.333330e-01)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), double 3.333330e-01, double 3.333330e-01)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), double 3.333300e-01, double 0x3FD55555318ABC87)
ret i32 0
}