#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*/ LC_ALL;
int /*<<< orphan*/ limpa();
int /*<<< orphan*/ printf(char *, int, float, char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  setlocale(LC_ALL, "Portuguese");
  int inteiro = 1, *i;
  float flutua = 1.0;
  float *f;
  char texto[20] = "Hello";
  char t[3];
  i = &inteiro;
  *i = 2;
  f = &flutua;
  *f = 2.0;
  limpa();
  strcpy(t, texto);
  strcpy(t, "Oi");
  printf("Os valores são %i, %.2f, %s.\n", *i, *f, t);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1060 <setlocale@plt>
movl   $0x1,-0x4(%rbp)
movss  0xe98(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec5(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xec3(%rip),%eax
mov    %eax,-0x30(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movss  0xe4a(%rip),%xmm0
movss  %xmm0,(%rax)
mov    $0x0,%al
call   1050 <limpa@plt>
lea    -0x43(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x43(%rbp),%rdi
lea    0xe3a(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
lea    -0x43(%rbp),%rdx
lea    0xe1f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
call   1060 <setlocale@plt>
movaps 0xedf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
xor    %eax,%eax
call   1050 <limpa@plt>
lea    0xd(%rsp),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xe81(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xe75(%rip),%rdi
movss  0xe5b(%rip),%xmm0
mov    $0x2,%esi
mov    %rbx,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@__const.main.texto = [20 x i8] c"Hello\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.1 = [3 x i8] c"Oi\00"
@.str.2 = [31 x i8] c"Os valores s\C3\A3o %i, %.2f, %s.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca float
%4 = alloca float*
%5 = alloca [20 x i8]
%6 = alloca [3 x i8]
%7 = load i32, i32* @LC_ALL
%8 = call i32 @setlocale(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
store float 1.000000e+00, float* %3
%9 = bitcast [20 x i8]* %5 to i8*
store i32* %1, i32** %2
%10 = load i32*, i32** %2
store i32 2, i32* %10
store float* %3, float** %4
%11 = load float*, float** %4
store float 2.000000e+00, float* %11
%12 = call i32 (...) @limpa()
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32*, i32** %2
%19 = load i32, i32* %18
%20 = load float*, float** %4
%21 = load float, float* %20
%22 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%23 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %19, float %21, i8* %22)
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@__const.main.texto = [20 x i8] c"Hello\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.1 = [3 x i8] c"Oi\00"
@.str.2 = [31 x i8] c"Os valores s\C3\A3o %i, %.2f, %s.\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [3 x i8]
%3 = load i32, i32* @LC_ALL
%4 = tail call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%7 = tail call i32 (...) @limpa()
%8 = call i32 @strcpy(i8* %6, i8* %5)
%9 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 2, float 2.000000e+00, i8* %6)
ret i32 0
}