#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*/ imprime_string(char *);
int /*<<< orphan*/ printf(char *, ...);
int string_para_inteiro(char *);
int /*<<< orphan*/ string_para_maiuscula(char *);
int main() {
  char meu_texto[] =
      "Vai, minha tristeza, e diz a ela que sem ela nao pode ser...";
  imprime_string(meu_texto);
  printf("\n%s\n", meu_texto);
  string_para_maiuscula(meu_texto);
  printf("%s\n", meu_texto);
  printf("%d\n", string_para_inteiro("0001050"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xe96(%rip),%rsi
mov    $0x3d,%edx
call   1060 <memcpy@plt>
lea    -0x50(%rbp),%rdi
call   1040 <imprime_string@plt>
lea    -0x50(%rbp),%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1070 <string_para_maiuscula@plt>
lea    -0x50(%rbp),%rsi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe95(%rip),%rdi
call   1030 <string_para_inteiro@plt>
mov    %eax,%esi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movups 0xed1(%rip),%xmm0
movups %xmm0,0x2d(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe80(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <imprime_string@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1070 <string_para_maiuscula@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xe8f(%rip),%rdi
call   1030 <string_para_inteiro@plt>
lea    0xe7f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.meu_texto = [61 x i8] c"Vai, minha tristeza, e diz a ela que sem ela nao pode ser...\00"
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [8 x i8] c"0001050\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [61 x i8]
store i32 0, i32* %1
%3 = bitcast [61 x i8]* %2 to i8*
%4 = getelementptr inbounds [61 x i8], [61 x i8]* %2, i64 0, i64 0
%5 = call i32 @imprime_string(i8* %4)
%6 = getelementptr inbounds [61 x i8], [61 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [61 x i8], [61 x i8]* %2, i64 0, i64 0
%9 = call i32 @string_para_maiuscula(i8* %8)
%10 = getelementptr inbounds [61 x i8], [61 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 @string_para_inteiro(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.meu_texto = [61 x i8] c"Vai, minha tristeza, e diz a ela que sem ela nao pode ser...\00"
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [8 x i8] c"0001050\00"
define i32 @main() {
%1 = alloca [61 x i8]
%2 = getelementptr inbounds [61 x i8], [61 x i8]* %1, i64 0, i64 0
%3 = call i32 @imprime_string(i8* %2)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @string_para_maiuscula(i8* %2)
%6 = call i32 @puts(i8* %2)
%7 = call i32 @string_para_inteiro(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}