#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() {
  printf("Ola Mundo\n\n");
  int variavel = 10;
  printf("A variavel tem o valor de - %d \n\n", variavel);
  printf("Caracteres especiais:\n");
  printf("1. Teste A\n (Nova Linha)\n");
  printf("2. Teste B\t (Tab)\n");
  printf("3. Teste C\b (Backspace)\n");
  printf("4. Teste D\r (Return)\n\n");
  printf("Numero comum (int): %d\n", 12345);
  printf("Numero comum com zeros a esquerda (int): %04d\n", 25);
  printf("Numero com virgula (float): %3.2f\n", 3.14159);
  printf("Hexadecimal: %x\n", 255);
  printf("Octal: %o\n", 255);
  printf("Porcentagem: %d %%\n\n", 10);
  printf("String completa:                     |%s|\n",
         "Terminal de Informacao");
  printf("10 Caracteres:                       |%.10s|\n",
         "Terminal de Informacao");
  printf("15 Caracteres:                       |%.15s|\n",
         "Terminal de Informacao");
  printf("10 Caracteres com espaco a esquerda: |%15.10s|\n",
         "Terminal de Informacao");
  printf("10 Caracteres com espaco a direita:  |%-15.10s|\n",
         "Terminal de Informacao");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf18(%rip),%rdi
mov    $0x3039,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
mov    $0x19,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf39(%rip),%rdi
movsd  0xe40(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf46(%rip),%rdi
mov    $0xff,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf44(%rip),%rdi
mov    $0xff,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf3c(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf3e(%rip),%rdi
lea    0xf62(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf6b(%rip),%rdi
lea    0xf4d(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf84(%rip),%rdi
lea    0xf38(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf9d(%rip),%rdi
lea    0xf23(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfb8(%rip),%rdi
lea    0xf0e(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0x109c(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1088(%rip),%rdi
call   1030 <puts@plt>
lea    0x1092(%rip),%rdi
call   1030 <puts@plt>
lea    0x109f(%rip),%rdi
call   1030 <puts@plt>
lea    0x10a5(%rip),%rdi
call   1030 <puts@plt>
lea    0x10b1(%rip),%rdi
call   1030 <puts@plt>
lea    0xea7(%rip),%rdi
mov    $0x3039,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x19,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
movsd  0xe4f(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0xff,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0xff,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0xef1(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf14(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf31(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf50(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Ola Mundo\0A\0A\00"
@.str.1 = [34 x i8] c"A variavel tem o valor de - %d \0A\0A\00"
@.str.2 = [23 x i8] c"Caracteres especiais:\0A\00"
@.str.3 = [26 x i8] c"1. Teste A\0A (Nova Linha)\0A\00"
@.str.4 = [19 x i8] c"2. Teste B\09 (Tab)\0A\00"
@.str.5 = [25 x i8] c"3. Teste C\08 (Backspace)\0A\00"
@.str.6 = [23 x i8] c"4. Teste D\0D (Return)\0A\0A\00"
@.str.7 = [24 x i8] c"Numero comum (int): %d\0A\00"
@.str.8 = [47 x i8] c"Numero comum com zeros a esquerda (int): %04d\0A\00"
@.str.9 = [35 x i8] c"Numero com virgula (float): %3.2f\0A\00"
@.str.10 = [17 x i8] c"Hexadecimal: %x\0A\00"
@.str.11 = [11 x i8] c"Octal: %o\0A\00"
@.str.12 = [21 x i8] c"Porcentagem: %d %%\0A\0A\00"
@.str.13 = [43 x i8] c"String completa: |%s|\0A\00"
@.str.14 = [23 x i8] c"Terminal de Informacao\00"
@.str.15 = [46 x i8] c"10 Caracteres: |%.10s|\0A\00"
@.str.16 = [46 x i8] c"15 Caracteres: |%.15s|\0A\00"
@.str.17 = [48 x i8] c"10 Caracteres com espaco a esquerda: |%15.10s|\0A\00"
@.str.18 = [49 x i8] c"10 Caracteres com espaco a direita: |%-15.10s|\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 10, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 12345)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0), i32 25)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), double 3.141590e+00)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 255)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i32 255)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i32 10)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"A variavel tem o valor de - %d \0A\0A\00"
@.str.7 = [24 x i8] c"Numero comum (int): %d\0A\00"
@.str.8 = [47 x i8] c"Numero comum com zeros a esquerda (int): %04d\0A\00"
@.str.9 = [35 x i8] c"Numero com virgula (float): %3.2f\0A\00"
@.str.10 = [17 x i8] c"Hexadecimal: %x\0A\00"
@.str.11 = [11 x i8] c"Octal: %o\0A\00"
@.str.12 = [21 x i8] c"Porcentagem: %d %%\0A\0A\00"
@.str.13 = [43 x i8] c"String completa: |%s|\0A\00"
@.str.14 = [23 x i8] c"Terminal de Informacao\00"
@.str.15 = [46 x i8] c"10 Caracteres: |%.10s|\0A\00"
@.str.16 = [46 x i8] c"15 Caracteres: |%.15s|\0A\00"
@.str.17 = [48 x i8] c"10 Caracteres com espaco a esquerda: |%15.10s|\0A\00"
@.str.18 = [49 x i8] c"10 Caracteres com espaco a direita: |%-15.10s|\0A\00"
@str = [11 x i8] c"Ola Mundo\0A\00"
@str.19 = [22 x i8] c"Caracteres especiais:\00"
@str.20 = [25 x i8] c"1. Teste A\0A (Nova Linha)\00"
@str.21 = [18 x i8] c"2. Teste B\09 (Tab)\00"
@str.22 = [24 x i8] c"3. Teste C\08 (Backspace)\00"
@str.23 = [22 x i8] c"4. Teste D\0D (Return)\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.19, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.20, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.21, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.22, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.23, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 12345)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0), i32 25)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), double 3.141590e+00)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 255)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i32 255)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i32 10)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
ret i32 0
}