#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() {
  int a = 1;
  float b = 2;
  double c = 3;
  char d = '4';
  printf("a)Sem especificadores de conversão: 1,2,3,4\n");
  printf("b)Com especificadores de conversão: %d,%.1f,%.lf,%c\n", a, b, c, d);
  printf("c)Utilizando quatro printf: ");
  printf("1,");
  printf("%.f,", b);
  printf("3,");
  printf("%c", d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movss  0xeda(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movb   $0x34,-0x19(%rbp)
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x18(%rbp),%xmm1
movsbl -0x19(%rbp),%edx
lea    0xecc(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeef(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x19(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf36(%rip),%rdi
call   1040 <puts@plt>
lea    0xecc(%rip),%rdi
movsd  0xeb4(%rip),%xmm0
movsd  0xeb4(%rip),%xmm1
mov    $0x1,%esi
mov    $0x34,%edx
mov    $0x2,%al
call   1050 <printf@plt>
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xee9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xede(%rip),%rdi
movsd  0xe70(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x34,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"a)Sem especificadores de convers\C3\A3o: 1,2,3,4\0A\00"
@.str.1 = [54 x i8] c"b)Com especificadores de convers\C3\A3o: %d,%.1f,%.lf,%c\0A\00"
@.str.2 = [29 x i8] c"c)Utilizando quatro printf: \00"
@.str.3 = [3 x i8] c"1,\00"
@.str.4 = [5 x i8] c"%.f,\00"
@.str.5 = [3 x i8] c"3,\00"
@.str.6 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca double
%5 = alloca i8
store i32 0, i32* %1
store i32 1, i32* %2
store float 2.000000e+00, float* %3
store double 3.000000e+00, double* %4
store i8 52, i8* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = load double, double* %4
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 %7, double %9, double %10, i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%20 = load i8, i8* %5
%21 = sext i8 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [54 x i8] c"b)Com especificadores de convers\C3\A3o: %d,%.1f,%.lf,%c\0A\00"
@.str.2 = [29 x i8] c"c)Utilizando quatro printf: \00"
@.str.3 = [3 x i8] c"1,\00"
@.str.4 = [5 x i8] c"%.f,\00"
@.str.5 = [3 x i8] c"3,\00"
@str = [45 x i8] c"a)Sem especificadores de convers\C3\A3o: 1,2,3,4\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 1, double 2.000000e+00, double 3.000000e+00, i32 52)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double 2.000000e+00)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%7 = tail call i32 @putchar(i32 52)
ret i32 0
}