#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 lsr(char *);
int open(char *, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  char *hue = "/usr/src/EP4-Testes/arquivoNovo.c";
  int result = 1337;
  result = lsr(hue);
  printf("Resultado do lsr: %d\n", result);
  result = open(hue, 01024, 0666);
  printf("OLHA SO %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x539,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <lsr@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x214,%esi
mov    $0x1b6,%edx
call   1050 <open@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <lsr@plt>
lea    0xedb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x214,%esi
mov    $0x1b6,%edx
call   1050 <open@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"/usr/src/EP4-Testes/arquivoNovo.c\00"
@.str.1 = [22 x i8] c"Resultado do lsr: %d\0A\00"
@.str.2 = [12 x i8] c"OLHA SO %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8** %6
store i32 1337, i32* %7
%8 = load i8*, i8** %6
%9 = call i32 @lsr(i8* %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i8*, i8** %6
%13 = call i32 @open(i8* %12, i32 532, i32 438)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"/usr/src/EP4-Testes/arquivoNovo.c\00"
@.str.1 = [22 x i8] c"Resultado do lsr: %d\0A\00"
@.str.2 = [12 x i8] c"OLHA SO %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @lsr(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @open(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 532, i32 438)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}